2
0

f_sub.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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_F_SUB_OPERATOR_H
  8. #define LIBSIMDPP_SIMDPP_CORE_F_SUB_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/expr/f_sub.h>
  14. #include <simdpp/core/detail/scalar_arg_impl.h>
  15. #include <simdpp/core/detail/get_expr_uint.h>
  16. namespace simdpp {
  17. namespace SIMDPP_ARCH_NAMESPACE {
  18. /** Substracts the values of two vectors
  19. @code
  20. r0 = a0 - b0
  21. ...
  22. rN = aN - bN
  23. @endcode
  24. @par 256-bit version:
  25. @icost{SSE2-SSE4.1, NEON, ALTIVEC, 2}
  26. */
  27. template<unsigned N, class E1, class E2> SIMDPP_INL
  28. float32<N, expr_fsub<float32<N,E1>,
  29. float32<N,E2>>> operator-(const float32<N,E1>& a,
  30. const float32<N,E2>& b)
  31. {
  32. return { { a, b } };
  33. }
  34. SIMDPP_SCALAR_ARG_IMPL_EXPR(operator-, expr_fsub, float32, float32)
  35. /** Subtracts the values of two vectors
  36. @code
  37. r0 = a0 - b0
  38. ...
  39. rN = aN - bN
  40. @endcode
  41. @par 128-bit version:
  42. @novec{NEON, ALTIVEC}
  43. @par 256-bit version:
  44. @novec{NEON, ALTIVEC}
  45. @icost{SSE2-SSE4.1, 2}
  46. */
  47. template<unsigned N, class E1, class E2> SIMDPP_INL
  48. float64<N, expr_fsub<float64<N,E1>,
  49. float64<N,E2>>> operator-(const float64<N,E1>& a,
  50. const float64<N,E2>& b)
  51. {
  52. return { { a, b } };
  53. }
  54. SIMDPP_SCALAR_ARG_IMPL_EXPR(operator-, expr_fsub, float64, float64)
  55. } // namespace SIMDPP_ARCH_NAMESPACE
  56. } // namespace simdpp
  57. #endif