diff --git a/include/xsimd/arch/xsimd_scalar.hpp b/include/xsimd/arch/xsimd_scalar.hpp index 9066da656..39bd607be 100644 --- a/include/xsimd/arch/xsimd_scalar.hpp +++ b/include/xsimd/arch/xsimd_scalar.hpp @@ -24,6 +24,10 @@ #include "xtl/xcomplex.hpp" #endif +#ifdef __APPLE__ +#include +#endif + namespace xsimd { template @@ -502,7 +506,7 @@ namespace xsimd return !(x0 == x1); } -#if defined(__APPLE__) +#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED > 1080) inline float exp10(const float& x) noexcept { return __exp10f(x); @@ -520,6 +524,15 @@ namespace xsimd { return ::exp10(x); } +#elif !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 5) + inline float exp10(const float& x) noexcept + { + return __builtin_exp10f(x); + } + inline double exp10(const double& x) noexcept + { + return __builtin_exp10(x); + } #elif defined(_WIN32) template ::value>::type> inline T exp10(const T& x) noexcept