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