@@ -17,40 +17,32 @@ namespace unsafe {
17
17
18
18
namespace detail {
19
19
20
- #if defined(BOOST_HAS_FLOAT128)
21
20
template <class T >
22
- auto fma_impl (T x, T y, T z) noexcept -> typename ::std::enable_if<::std::is_same<T, ::boost::float128_type>::value, T>::type
21
+ inline auto fma_impl (T x, T y, T z) noexcept -> T
23
22
{
24
- return ::fmaq (x);
23
+ // Default to the written-out operations.
24
+
25
+ return (x * y) + z;
25
26
}
26
- #endif
27
27
28
28
#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER)
29
- template <class T >
30
- auto fma_impl (T x, T y, T z) noexcept -> typename ::std::enable_if<::std::is_same<T, float>::value, T>::type
29
+ template <>
30
+ inline auto fma_impl< float >( float x, float y, float z) noexcept -> float
31
31
{
32
32
return __builtin_fmaf (x, y, z);
33
33
}
34
34
35
- template <class T >
36
- auto fma_impl (T x, T y, T z) noexcept -> typename ::std::enable_if<::std::is_same<T, double>::value, T>::type
35
+ template <>
36
+ inline auto fma_impl< double >( double x, double y, double z) noexcept -> double
37
37
{
38
38
return __builtin_fma (x, y, z);
39
39
}
40
40
41
- template <class T >
42
- auto fma_impl (T x, T y, T z) noexcept -> typename ::std::enable_if<::std::is_same<T, long double>::value, T>::type
41
+ template <>
42
+ inline auto fma_impl< long double >( long double x, long double y, long double z) noexcept -> long double
43
43
{
44
44
return __builtin_fmal (x, y, z);
45
45
}
46
- #else
47
- template <class T >
48
- auto fma_impl (T x, T y, T z) noexcept -> typename ::std::enable_if<::std::is_floating_point<T>::value, T>::type
49
- {
50
- // Default to the written-out operations.
51
-
52
- return (x * y) + z;
53
- }
54
46
#endif
55
47
56
48
} // namespace detail
0 commit comments