cmp_le.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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_CMP_LE_OPERATOR_H
  8. #define LIBSIMDPP_SIMDPP_CORE_CMP_LE_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/cmp_le.h>
  14. #include <simdpp/core/detail/scalar_arg_impl.h>
  15. namespace simdpp {
  16. namespace SIMDPP_ARCH_NAMESPACE {
  17. template<unsigned N, class E1, class E2> SIMDPP_INL
  18. mask_int8<N,expr_empty> operator<=(const int8<N,E1>& a,
  19. const int8<N,E2>& b)
  20. {
  21. return detail::insn::i_cmp_le(a.eval(), b.eval());
  22. }
  23. SIMDPP_SCALAR_ARG_IMPL_VEC(operator<=, mask_int8, int8)
  24. template<unsigned N, class E1, class E2> SIMDPP_INL
  25. mask_int8<N,expr_empty> operator<=(const uint8<N,E1>& a,
  26. const uint8<N,E2>& b)
  27. {
  28. return detail::insn::i_cmp_le(a.eval(), b.eval());
  29. }
  30. SIMDPP_SCALAR_ARG_IMPL_VEC(operator<=, mask_int8, uint8)
  31. template<unsigned N, class E1, class E2> SIMDPP_INL
  32. mask_int16<N,expr_empty> operator<=(const int16<N,E1>& a,
  33. const int16<N,E2>& b)
  34. {
  35. return detail::insn::i_cmp_le(a.eval(), b.eval());
  36. }
  37. SIMDPP_SCALAR_ARG_IMPL_VEC(operator<=, mask_int16, int16)
  38. template<unsigned N, class E1, class E2> SIMDPP_INL
  39. mask_int16<N,expr_empty> operator<=(const uint16<N,E1>& a,
  40. const uint16<N,E2>& b)
  41. {
  42. return detail::insn::i_cmp_le(a.eval(), b.eval());
  43. }
  44. SIMDPP_SCALAR_ARG_IMPL_VEC(operator<=, mask_int16, uint16)
  45. template<unsigned N, class E1, class E2> SIMDPP_INL
  46. mask_int32<N,expr_empty> operator<=(const int32<N,E1>& a,
  47. const int32<N,E2>& b)
  48. {
  49. return detail::insn::i_cmp_le(a.eval(), b.eval());
  50. }
  51. SIMDPP_SCALAR_ARG_IMPL_VEC(operator<=, mask_int32, int32)
  52. template<unsigned N, class E1, class E2> SIMDPP_INL
  53. mask_int32<N,expr_empty> operator<=(const uint32<N,E1>& a,
  54. const uint32<N,E2>& b)
  55. {
  56. return detail::insn::i_cmp_le(a.eval(), b.eval());
  57. }
  58. SIMDPP_SCALAR_ARG_IMPL_VEC(operator<=, mask_int32, uint32)
  59. template<unsigned N, class E1, class E2> SIMDPP_INL
  60. mask_int64<N,expr_empty> operator<=(const int64<N,E1>& a,
  61. const int64<N,E2>& b)
  62. {
  63. return detail::insn::i_cmp_le(a.eval(), b.eval());
  64. }
  65. SIMDPP_SCALAR_ARG_IMPL_VEC(operator<=, mask_int64, int64)
  66. template<unsigned N, class E1, class E2> SIMDPP_INL
  67. mask_int64<N,expr_empty> operator<=(const uint64<N,E1>& a,
  68. const uint64<N,E2>& b)
  69. {
  70. return detail::insn::i_cmp_le(a.eval(), b.eval());
  71. }
  72. SIMDPP_SCALAR_ARG_IMPL_VEC(operator<=, mask_int64, uint64)
  73. /** Compares the values of two float32x4 vectors for less-than or equal
  74. @code
  75. r0 = (a0 <= b0) ? 0xffffffff : 0x0
  76. ...
  77. rN = (aN <= bN) ? 0xffffffff : 0x0
  78. @endcode
  79. @par 256-bit version:
  80. @icost{SSE2-AVX, NEON, ALTIVEC, 2}
  81. */
  82. template<unsigned N, class E1, class E2> SIMDPP_INL
  83. mask_float32<N,expr_empty> operator<=(const float32<N,E1>& a,
  84. const float32<N,E2>& b)
  85. {
  86. return detail::insn::i_cmp_le(a.eval(), b.eval());
  87. }
  88. SIMDPP_SCALAR_ARG_IMPL_VEC(operator<=, mask_float32, float32)
  89. /** Compares the values of two float64x2 vectors for less-than or equal
  90. @code
  91. r0 = (a0 <= b0) ? 0xffffffffffffffff : 0x0
  92. ...
  93. rN = (aN <= bN) ? 0xffffffffffffffff : 0x0
  94. @endcode
  95. @par 128-bit version:
  96. @novec{NEON, ALTIVEC}
  97. @par 256-bit version:
  98. @novec{NEON, ALTIVEC}
  99. @icost{SSE2-SSE4.1, 2}
  100. */
  101. template<unsigned N, class E1, class E2> SIMDPP_INL
  102. mask_float64<N,expr_empty> operator<=(const float64<N,E1>& a,
  103. const float64<N,E2>& b)
  104. {
  105. return detail::insn::i_cmp_le(a.eval(), b.eval());
  106. }
  107. SIMDPP_SCALAR_ARG_IMPL_VEC(operator<=, mask_float64, float64)
  108. } // namespace SIMDPP_ARCH_NAMESPACE
  109. } // namespace simdpp
  110. #endif