1 | // This file is generated by tools/gen_operators.pl. CHANGES WILL BE OVERWRITTEN |
2 | /* Copyright (C) 2013-2014 Povilas Kanapickas <povilas@radix.lt> |
3 | |
4 | Distributed under the Boost Software License, Version 1.0. |
5 | (See accompanying file LICENSE_1_0.txt or copy at |
6 | http://www.boost.org/LICENSE_1_0.txt) |
7 | */ |
8 | |
9 | #ifndef LIBSIMDPP_SIMDPP_CORE_I_SUB_OPERATOR_H |
10 | #define LIBSIMDPP_SIMDPP_CORE_I_SUB_OPERATOR_H |
11 | |
12 | #ifndef LIBSIMDPP_SIMD_H |
13 | #error "This file must be included through simd.h" |
14 | #endif |
15 | |
16 | #include <simdpp/types.h> |
17 | #include <simdpp/detail/expr/i_sub.h> |
18 | #include <simdpp/core/detail/get_expr_uint.h> |
19 | #include <simdpp/core/detail/scalar_arg_impl.h> |
20 | #include <simdpp/core/detail/get_expr_uint.h> |
21 | |
22 | namespace simdpp { |
23 | namespace SIMDPP_ARCH_NAMESPACE { |
24 | |
25 | /** Subtracts 8-bit integer values. |
26 | |
27 | @code |
28 | r0 = a0 - b0 |
29 | ... |
30 | rN = aN - bN |
31 | @endcode |
32 | |
33 | @par 256-bit version: |
34 | @icost{SSE2-AVX, NEON, ALTIVEC, 2} |
35 | */ |
36 | template<unsigned N, class V1, class V2> SIMDPP_INL |
37 | typename detail::get_expr_uint<expr_isub, V1, V2>::type |
38 | operator-(const any_int8<N,V1>& a, |
39 | const any_int8<N,V2>& b) |
40 | { |
41 | return { { a.wrapped(), b.wrapped() } }; |
42 | } |
43 | |
44 | SIMDPP_SCALAR_ARG_IMPL_INT_UNSIGNED(operator-, expr_isub, any_int8, int8) |
45 | |
46 | /** Subtracts 16-bit integer values. |
47 | |
48 | @code |
49 | r0 = a0 - b0 |
50 | ... |
51 | rN = aN - bN |
52 | @endcode |
53 | |
54 | @par 256-bit version: |
55 | @icost{SSE2-AVX, NEON, ALTIVEC, 2} |
56 | */ |
57 | template<unsigned N, class V1, class V2> SIMDPP_INL |
58 | typename detail::get_expr_uint<expr_isub, V1, V2>::type |
59 | operator-(const any_int16<N,V1>& a, |
60 | const any_int16<N,V2>& b) |
61 | { |
62 | return { { a.wrapped(), b.wrapped() } }; |
63 | } |
64 | |
65 | SIMDPP_SCALAR_ARG_IMPL_INT_UNSIGNED(operator-, expr_isub, any_int16, int16) |
66 | |
67 | /** Subtracts 32-bit integer values. |
68 | |
69 | @code |
70 | r0 = a0 - b0 |
71 | ... |
72 | rN = aN - bN |
73 | @endcode |
74 | |
75 | @par 256-bit version: |
76 | @icost{SSE2-AVX, NEON, ALTIVEC, 2} |
77 | */ |
78 | template<unsigned N, class V1, class V2> SIMDPP_INL |
79 | typename detail::get_expr_uint<expr_isub, V1, V2>::type |
80 | operator-(const any_int32<N,V1>& a, |
81 | const any_int32<N,V2>& b) |
82 | { |
83 | return { { a.wrapped(), b.wrapped() } }; |
84 | } |
85 | |
86 | SIMDPP_SCALAR_ARG_IMPL_INT_UNSIGNED(operator-, expr_isub, any_int32, int32) |
87 | |
88 | /** Subtracts 64-bit integer values. |
89 | |
90 | @code |
91 | r0 = a0 - b0 |
92 | ... |
93 | rN = aN - bN |
94 | @endcode |
95 | |
96 | @par 128-bit version: |
97 | @icost{ALTIVEC, 5-6} |
98 | |
99 | @par 256-bit version: |
100 | @icost{SSE2-AVX, NEON, 2} |
101 | @icost{ALTIVEC, 10-11} |
102 | */ |
103 | template<unsigned N, class V1, class V2> SIMDPP_INL |
104 | typename detail::get_expr_uint<expr_isub, V1, V2>::type |
105 | operator-(const any_int64<N,V1>& a, |
106 | const any_int64<N,V2>& b) |
107 | { |
108 | return { { a.wrapped(), b.wrapped() } }; |
109 | } |
110 | |
111 | SIMDPP_SCALAR_ARG_IMPL_INT_UNSIGNED(operator-, expr_isub, any_int64, int64) |
112 | |
113 | |
114 | } // namespace SIMDPP_ARCH_NAMESPACE |
115 | } // namespace simdpp |
116 | |
117 | #endif |
118 | |
119 | |