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_F_DIV_OPERATOR_H |
10 | #define LIBSIMDPP_SIMDPP_CORE_F_DIV_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/f_div.h> |
18 | #include <simdpp/core/detail/scalar_arg_impl.h> |
19 | |
20 | namespace simdpp { |
21 | namespace SIMDPP_ARCH_NAMESPACE { |
22 | |
23 | /** Divides the values of two vectors. |
24 | |
25 | @code |
26 | r0 = a0 / b0 |
27 | ... |
28 | rN = aN / bN |
29 | @endcode |
30 | |
31 | @icost{NEON, 6} |
32 | @icost{ALTIVEC, 10} |
33 | |
34 | @par 256-bit version: |
35 | @icost{SSE2-SSE4.1, 2} |
36 | @icost{NEON, 12} |
37 | @icost{ALTIVEC, 19} |
38 | */ |
39 | template<unsigned N, class E1, class E2> SIMDPP_INL |
40 | float32<N,expr_empty> operator/(const float32<N,E1>& a, const float32<N,E2>& b) |
41 | { |
42 | return detail::insn::i_div(a.eval(), b.eval()); |
43 | } |
44 | |
45 | SIMDPP_SCALAR_ARG_IMPL_VEC(operator/, float32, float32) |
46 | |
47 | /** Divides the values of two vectors |
48 | |
49 | @code |
50 | r0 = a0 / b0 |
51 | ... |
52 | rN = aN / bN |
53 | @endcode |
54 | |
55 | @par 128-bit version: |
56 | @novec{NEON, ALTIVEC} |
57 | |
58 | @par 256-bit version: |
59 | @icost{SSE2-SSE4.1, 2} |
60 | @novec{NEON, ALTIVEC} |
61 | */ |
62 | template<unsigned N, class E1, class E2> SIMDPP_INL |
63 | float64<N,expr_empty> operator/(const float64<N,E1>& a, const float64<N,E2>& b) |
64 | { |
65 | return detail::insn::i_div(a.eval(), b.eval()); |
66 | } |
67 | |
68 | SIMDPP_SCALAR_ARG_IMPL_VEC(operator/, float64, float64) |
69 | |
70 | } // namespace SIMDPP_ARCH_NAMESPACE |
71 | } // namespace simdpp |
72 | |
73 | #endif |
74 | |
75 | |