| 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_FMADD_H |
| 9 | #define LIBSIMDPP_SIMDPP_DETAIL_EXPR_F_FMADD_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_fmadd.h> |
| 17 | |
| 18 | namespace simdpp { |
| 19 | namespace SIMDPP_ARCH_NAMESPACE { |
| 20 | namespace detail { |
| 21 | |
| 22 | template<class R, class E1, class E2, class E3> |
| 23 | struct expr_eval<R, expr_fmadd<E1, E2, E3>> { |
| 24 | static SIMDPP_INL R eval(const expr_fmadd<E1, E2, E3>& e) |
| 25 | { |
| 26 | return (R) insn::i_fmadd(e.a.eval(), e.b.eval(), e.c.eval()); |
| 27 | } |
| 28 | }; |
| 29 | |
| 30 | } // namespace detail |
| 31 | } // namespace SIMDPP_ARCH_NAMESPACE |
| 32 | } // namespace simdpp |
| 33 | |
| 34 | #endif |
| 35 | |
| 36 | |