| 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_NOT_OPERATOR_H |
| 10 | #define LIBSIMDPP_SIMDPP_CORE_BIT_NOT_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_not.h> |
| 18 | #include <simdpp/detail/expr/bit_not.h> |
| 19 | #include <simdpp/detail/get_expr.h> |
| 20 | |
| 21 | namespace simdpp { |
| 22 | namespace SIMDPP_ARCH_NAMESPACE { |
| 23 | |
| 24 | /** Computes bitwise NOT of an integer or floating-point vector |
| 25 | |
| 26 | @code |
| 27 | r = ~a |
| 28 | @endcode |
| 29 | |
| 30 | @todo icost |
| 31 | */ |
| 32 | template<unsigned N, class V> SIMDPP_INL |
| 33 | typename detail::get_expr<V, expr_bit_not<V>>::empty |
| 34 | operator~(const any_vec<N,V>& a) |
| 35 | { |
| 36 | typename detail::get_expr_nosign<V>::type ra; |
| 37 | ra = a.wrapped().eval(); |
| 38 | return detail::insn::i_bit_not(ra); |
| 39 | } |
| 40 | |
| 41 | /* FIXME |
| 42 | template<unsigned N, class E> SIMDPP_INL |
| 43 | mask_int32<N, expr_bit_not<mask_int32<N,E>>> operator~(mask_int32<N,E> a) |
| 44 | { |
| 45 | return { { a } }; |
| 46 | } |
| 47 | template<unsigned N, class E> SIMDPP_INL |
| 48 | mask_int64<N, expr_bit_not<mask_int64<N,E>>> operator~(mask_int64<N,E> a) |
| 49 | { |
| 50 | return { { a } }; |
| 51 | } |
| 52 | |
| 53 | template<unsigned N, class E> SIMDPP_INL |
| 54 | mask_float32<N, expr_bit_not<mask_float32<N,E>>> operator~(mask_float32<N,E> a) |
| 55 | { |
| 56 | return { { a } }; |
| 57 | } |
| 58 | template<unsigned N, class E> SIMDPP_INL |
| 59 | mask_float64<N, expr_bit_not<mask_float64<N,E>>> operator~(mask_float64<N,E> a) |
| 60 | { |
| 61 | return { { a } }; |
| 62 | } |
| 63 | */ |
| 64 | |
| 65 | } // namespace SIMDPP_ARCH_NAMESPACE |
| 66 | } // namespace simdpp |
| 67 | |
| 68 | #endif |
| 69 | |
| 70 | |