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 <dj@redhat.com>
This commit is contained in:
Adhemerval Zanella 2025-08-25 13:38:32 -03:00
parent adecb3bec1
commit f40cdb65f5
4 changed files with 7 additions and 7 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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;