cmp_ge.h 4.3 KB

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