From 4379740aae4f17fd04b992d2024d934eb70a1c18 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Fri, 22 Mar 2024 12:47:51 +0100 Subject: [PATCH] emscripten; use `__builtin_roundeven{f,}` from version 3.1.43 onwards --- simde/hedley.h | 1 + simde/simde-math.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/simde/hedley.h b/simde/hedley.h index 41ac30221..f064f3f4c 100644 --- a/simde/hedley.h +++ b/simde/hedley.h @@ -184,6 +184,7 @@ # undef HEDLEY_EMSCRIPTEN_VERSION #endif #if defined(__EMSCRIPTEN__) +# include # define HEDLEY_EMSCRIPTEN_VERSION HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) #endif diff --git a/simde/simde-math.h b/simde/simde-math.h index 02de568dc..d18bf4f90 100644 --- a/simde/simde-math.h +++ b/simde/simde-math.h @@ -1266,7 +1266,7 @@ simde_math_fpclass(double v, const int imm8) { #if !defined(simde_math_roundeven) #if \ - (!defined(HEDLEY_EMSCRIPTEN_VERSION) && HEDLEY_HAS_BUILTIN(__builtin_roundeven)) || \ + ((!defined(HEDLEY_EMSCRIPTEN_VERSION) || HEDLEY_EMSCRIPTEN_VERSION_CHECK(3, 1, 43)) && HEDLEY_HAS_BUILTIN(__builtin_roundeven)) || \ HEDLEY_GCC_VERSION_CHECK(10,0,0) #define simde_math_roundeven(v) __builtin_roundeven(v) #elif defined(simde_math_round) && defined(simde_math_fabs) @@ -1286,7 +1286,7 @@ simde_math_fpclass(double v, const int imm8) { #if !defined(simde_math_roundevenf) #if \ - (!defined(HEDLEY_EMSCRIPTEN_VERSION) && HEDLEY_HAS_BUILTIN(__builtin_roundevenf)) || \ + ((!defined(HEDLEY_EMSCRIPTEN_VERSION) || HEDLEY_EMSCRIPTEN_VERSION_CHECK(3, 1, 43)) && HEDLEY_HAS_BUILTIN(__builtin_roundevenf)) || \ HEDLEY_GCC_VERSION_CHECK(10,0,0) #define simde_math_roundevenf(v) __builtin_roundevenf(v) #elif defined(simde_math_roundf) && defined(simde_math_fabsf)