1 | /* Copyright (C) 2013-2014 Povilas Kanapickas <povilas@radix.lt> |
2 | |
3 | Distributed under the Boost Software License, Version 1.0. |
4 | (See accompanying file LICENSE_1_0.txt or copy at |
5 | http://www.boost.org/LICENSE_1_0.txt) |
6 | */ |
7 | |
8 | #ifndef LIBSIMDPP_SIMDPP_DETAIL_EXPR_I_SUB_SAT_H |
9 | #define LIBSIMDPP_SIMDPP_DETAIL_EXPR_I_SUB_SAT_H |
10 | |
11 | #ifndef LIBSIMDPP_SIMD_H |
12 | #error "This file must be included through simd.h" |
13 | #endif |
14 | |
15 | #include <simdpp/types.h> |
16 | #include <simdpp/detail/get_expr.h> |
17 | #include <simdpp/detail/insn/i_sub_sat.h> |
18 | |
19 | namespace simdpp { |
20 | namespace SIMDPP_ARCH_NAMESPACE { |
21 | namespace detail { |
22 | |
23 | template<class R, class E1, class E2> |
24 | struct expr_eval<R, expr_isub_sat<E1, E2>> { |
25 | static SIMDPP_INL R eval(const expr_isub_sat<E1, E2>& e) |
26 | { |
27 | using E = get_expr2_same<E1, E2>; |
28 | return (R) insn::i_sub_sat( |
29 | eval_maybe_scalar<typename E::v1_final_type, E1>::eval(e.a), |
30 | eval_maybe_scalar<typename E::v2_final_type, E2>::eval(e.b)); |
31 | } |
32 | }; |
33 | |
34 | } // namespace detail |
35 | } // namespace SIMDPP_ARCH_NAMESPACE |
36 | } // namespace simdpp |
37 | |
38 | #endif |
39 | |
40 | |