2
0

bit_not.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // This file is generated by tools/gen_operators.pl. CHANGES WILL BE OVERWRITTEN
  2. /* Copyright (C) 2013-2014 Povilas Kanapickas <[email protected]>
  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. #ifndef LIBSIMDPP_SIMDPP_CORE_BIT_NOT_OPERATOR_H
  8. #define LIBSIMDPP_SIMDPP_CORE_BIT_NOT_OPERATOR_H
  9. #ifndef LIBSIMDPP_SIMD_H
  10. #error "This file must be included through simd.h"
  11. #endif
  12. #include <simdpp/types.h>
  13. #include <simdpp/detail/insn/bit_not.h>
  14. #include <simdpp/detail/expr/bit_not.h>
  15. #include <simdpp/detail/get_expr.h>
  16. namespace simdpp {
  17. namespace SIMDPP_ARCH_NAMESPACE {
  18. /** Computes bitwise NOT of an integer or floating-point vector
  19. @code
  20. r = ~a
  21. @endcode
  22. @todo icost
  23. */
  24. template<unsigned N, class V> SIMDPP_INL
  25. typename detail::get_expr<V, expr_bit_not<V>>::empty
  26. operator~(const any_vec<N,V>& a)
  27. {
  28. typename detail::get_expr_nosign<V>::type ra;
  29. ra = a.wrapped().eval();
  30. return detail::insn::i_bit_not(ra);
  31. }
  32. /* FIXME
  33. template<unsigned N, class E> SIMDPP_INL
  34. mask_int32<N, expr_bit_not<mask_int32<N,E>>> operator~(mask_int32<N,E> a)
  35. {
  36. return { { a } };
  37. }
  38. template<unsigned N, class E> SIMDPP_INL
  39. mask_int64<N, expr_bit_not<mask_int64<N,E>>> operator~(mask_int64<N,E> a)
  40. {
  41. return { { a } };
  42. }
  43. template<unsigned N, class E> SIMDPP_INL
  44. mask_float32<N, expr_bit_not<mask_float32<N,E>>> operator~(mask_float32<N,E> a)
  45. {
  46. return { { a } };
  47. }
  48. template<unsigned N, class E> SIMDPP_INL
  49. mask_float64<N, expr_bit_not<mask_float64<N,E>>> operator~(mask_float64<N,E> a)
  50. {
  51. return { { a } };
  52. }
  53. */
  54. } // namespace SIMDPP_ARCH_NAMESPACE
  55. } // namespace simdpp
  56. #endif