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