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