1 | /* Copyright (C) 2013-2014 Povilas Kanapickas <povilas@radix.lt> |
2 | |
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 | |
8 | #ifndef LIBSIMDPP_SIMDPP_DETAIL_EXPR_F_ABS_H |
9 | #define LIBSIMDPP_SIMDPP_DETAIL_EXPR_F_ABS_H |
10 | |
11 | #ifndef LIBSIMDPP_SIMD_H |
12 | #error "This file must be included through simd.h" |
13 | #endif |
14 | |
15 | #include <simdpp/types.h> |
16 | #include <simdpp/detail/insn/f_abs.h> |
17 | |
18 | namespace simdpp { |
19 | namespace SIMDPP_ARCH_NAMESPACE { |
20 | namespace detail { |
21 | |
22 | template<class R, class E> |
23 | struct expr_eval<R, expr_fabs<E>> { |
24 | static SIMDPP_INL R eval(const expr_fabs<E>& e) |
25 | { |
26 | return (R) insn::i_fabs(e.a.eval()); |
27 | } |
28 | }; |
29 | |
30 | } // namespace detail |
31 | } // namespace SIMDPP_ARCH_NAMESPACE |
32 | } // namespace simdpp |
33 | |
34 | #endif |
35 | |
36 | |