From: Adhemerval Zanella Date: Mon, 25 Aug 2025 16:38:32 +0000 (-0300) Subject: math: Use internal fesetround alias on fma X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f40cdb65f53cb557b9be28580d98068935414dae;p=thirdparty%2Fglibc.git math: Use internal fesetround alias on fma To avoid linknamespace issues on old standards. It is required if the fallback fma implementation is used if/when it is also used internally for other implementation. Reviewed-by: DJ Delorie --- diff --git a/sysdeps/ieee754/ldbl-128/s_fma.c b/sysdeps/ieee754/ldbl-128/s_fma.c index a5466b67c5..01ca556260 100644 --- a/sysdeps/ieee754/ldbl-128/s_fma.c +++ b/sysdeps/ieee754/ldbl-128/s_fma.c @@ -51,7 +51,7 @@ __fma (double x, double y, double z) union ieee854_long_double u; __feholdexcept (&env); - fesetround (FE_TOWARDZERO); + __fesetround (FE_TOWARDZERO); /* Perform addition with round to odd. */ u.d = temp + (long double) z; if ((u.ieee.mantissa3 & 1) == 0 && u.ieee.exponent != 0x7fff) diff --git a/sysdeps/ieee754/ldbl-128/s_fmal.c b/sysdeps/ieee754/ldbl-128/s_fmal.c index f52a21306d..17ad90ca31 100644 --- a/sysdeps/ieee754/ldbl-128/s_fmal.c +++ b/sysdeps/ieee754/ldbl-128/s_fmal.c @@ -195,7 +195,7 @@ __fmal (_Float128 x, _Float128 y, _Float128 z) fenv_t env; __feholdexcept (&env); - fesetround (FE_TONEAREST); + __fesetround (FE_TONEAREST); /* Multiplication m1 + m2 = x * y using Dekker's algorithm. */ #define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1) @@ -229,7 +229,7 @@ __fmal (_Float128 x, _Float128 y, _Float128 z) return z + m1; } - fesetround (FE_TOWARDZERO); + __fesetround (FE_TOWARDZERO); /* Perform m2 + a2 addition with round to odd. */ u.d = a2 + m2; diff --git a/sysdeps/ieee754/ldbl-96/s_fma.c b/sysdeps/ieee754/ldbl-96/s_fma.c index 9723c5a797..a9abf8f1de 100644 --- a/sysdeps/ieee754/ldbl-96/s_fma.c +++ b/sysdeps/ieee754/ldbl-96/s_fma.c @@ -52,7 +52,7 @@ __fma (double x, double y, double z) fenv_t env; __feholdexcept (&env); - fesetround (FE_TONEAREST); + __fesetround (FE_TONEAREST); /* Multiplication m1 + m2 = x * y using Dekker's algorithm. */ #define C ((1ULL << (LDBL_MANT_DIG + 1) / 2) + 1) @@ -86,7 +86,7 @@ __fma (double x, double y, double z) return z + m1; } - fesetround (FE_TOWARDZERO); + __fesetround (FE_TOWARDZERO); /* Perform m2 + a2 addition with round to odd. */ a2 = a2 + m2; diff --git a/sysdeps/ieee754/ldbl-96/s_fmal.c b/sysdeps/ieee754/ldbl-96/s_fmal.c index c923bc9fff..be5528d96b 100644 --- a/sysdeps/ieee754/ldbl-96/s_fmal.c +++ b/sysdeps/ieee754/ldbl-96/s_fmal.c @@ -185,7 +185,7 @@ __fmal (long double x, long double y, long double z) fenv_t env; __feholdexcept (&env); - fesetround (FE_TONEAREST); + __fesetround (FE_TONEAREST); /* Multiplication m1 + m2 = x * y using Dekker's algorithm. */ #define C ((1LL << (LDBL_MANT_DIG + 1) / 2) + 1) @@ -219,7 +219,7 @@ __fmal (long double x, long double y, long double z) return z + m1; } - fesetround (FE_TOWARDZERO); + __fesetround (FE_TOWARDZERO); /* Perform m2 + a2 addition with round to odd. */ u.d = a2 + m2;