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_BIT_OR_OPERATOR_H |
10 | #define LIBSIMDPP_SIMDPP_CORE_BIT_OR_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/insn/bit_or.h> |
18 | #include <simdpp/detail/expr/bit_or.h> |
19 | #include <simdpp/core/detail/get_expr_bitwise.h> |
20 | #include <simdpp/core/detail/scalar_arg_impl.h> |
21 | |
22 | namespace simdpp { |
23 | namespace SIMDPP_ARCH_NAMESPACE { |
24 | |
25 | /** Computes bitwise OR of integer vectors. |
26 | |
27 | @code |
28 | r0 = a0 | b0 |
29 | ... |
30 | rN = aN | bN |
31 | @endcode |
32 | |
33 | @todo icost |
34 | */ |
35 | template<unsigned N, class V1, class V2> SIMDPP_INL |
36 | typename detail::get_expr_bit_or<V1, V2>::type |
37 | operator|(const any_vec<N,V1>& a, const any_vec<N,V2>& b) |
38 | { |
39 | return { { a.wrapped(), b.wrapped() } }; |
40 | } |
41 | |
42 | // support scalar arguments |
43 | template<unsigned N, class V> SIMDPP_INL |
44 | typename detail::get_expr_bitwise2_and<expr_bit_or, unsigned, V>::type |
45 | operator|(const unsigned& a, const any_vec<N,V>& b) |
46 | { |
47 | return { { a, b.wrapped() } }; |
48 | } |
49 | template<unsigned N, class V> SIMDPP_INL |
50 | typename detail::get_expr_bitwise2_and<expr_bit_or, unsigned long, V>::type |
51 | operator|(const unsigned long& a, const any_vec<N,V>& b) |
52 | { |
53 | return { { a, b.wrapped() } }; |
54 | } |
55 | template<unsigned N, class V> SIMDPP_INL |
56 | typename detail::get_expr_bitwise2_and<expr_bit_or, unsigned long long, V>::type |
57 | operator|(const unsigned long long& a, const any_vec<N,V>& b) |
58 | { |
59 | return { { a, b.wrapped() } }; |
60 | } |
61 | template<unsigned N, class V> SIMDPP_INL |
62 | typename detail::get_expr_bitwise2_and<expr_bit_or, int, V>::type |
63 | operator|(const int& a, const any_vec<N,V>& b) |
64 | { |
65 | return { { a, b.wrapped() } }; |
66 | } |
67 | template<unsigned N, class V> SIMDPP_INL |
68 | typename detail::get_expr_bitwise2_and<expr_bit_or, long, V>::type |
69 | operator|(const long& a, const any_vec<N,V>& b) |
70 | { |
71 | return { { a, b.wrapped() } }; |
72 | } |
73 | template<unsigned N, class V> SIMDPP_INL |
74 | typename detail::get_expr_bitwise2_and<expr_bit_or, long long, V>::type |
75 | operator|(const long long& a, const any_vec<N,V>& b) |
76 | { |
77 | return { { a, b.wrapped() } }; |
78 | } |
79 | |
80 | template<unsigned N, class V> SIMDPP_INL |
81 | typename detail::get_expr_bitwise2_and<expr_bit_or, V, unsigned>::type |
82 | operator|(const any_vec<N,V>& a, const unsigned& b) |
83 | { |
84 | return { { a.wrapped(), b } }; |
85 | } |
86 | template<unsigned N, class V> SIMDPP_INL |
87 | typename detail::get_expr_bitwise2_and<expr_bit_or, V, unsigned long>::type |
88 | operator|(const any_vec<N,V>& a, const unsigned long& b) |
89 | { |
90 | return { { a.wrapped(), b } }; |
91 | } |
92 | template<unsigned N, class V> SIMDPP_INL |
93 | typename detail::get_expr_bitwise2_and<expr_bit_or, V, unsigned long long>::type |
94 | operator|(const any_vec<N,V>& a, const unsigned long long& b) |
95 | { |
96 | return { { a.wrapped(), b } }; |
97 | } |
98 | template<unsigned N, class V> SIMDPP_INL |
99 | typename detail::get_expr_bitwise2_and<expr_bit_or, V, int>::type |
100 | operator|(const any_vec<N,V>& a, const int& b) |
101 | { |
102 | return { { a.wrapped(), b } }; |
103 | } |
104 | template<unsigned N, class V> SIMDPP_INL |
105 | typename detail::get_expr_bitwise2_and<expr_bit_or, V, long>::type |
106 | operator|(const any_vec<N,V>& a, const long& b) |
107 | { |
108 | return { { a.wrapped(), b } }; |
109 | } |
110 | template<unsigned N, class V> SIMDPP_INL |
111 | typename detail::get_expr_bitwise2_and<expr_bit_or, V, long long>::type |
112 | operator|(const any_vec<N,V>& a, const long long& b) |
113 | { |
114 | return { { a.wrapped(), b } }; |
115 | } |
116 | |
117 | |
118 | } // namespace SIMDPP_ARCH_NAMESPACE |
119 | } // namespace simdpp |
120 | |
121 | #endif |
122 | |
123 | |
124 | |