math: Add feclearexcept internal alias

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:26 -03:00
parent 1fdb73fb3c
commit 2eb8836de7
20 changed files with 44 additions and 12 deletions

View File

@ -33,6 +33,7 @@ libm_hidden_proto (feupdateenv)
libm_hidden_proto (__feupdateenv)
libm_hidden_proto (fetestexcept)
libm_hidden_proto (feclearexcept)
libm_hidden_proto (__feclearexcept)
/* Rounding mode context. This allows functions to set/restore rounding mode
only when the desired rounding mode is different from the current rounding

View File

@ -25,6 +25,7 @@ __feclearexcept (int excepts)
/* This always fails unless nothing needs to be done. */
return (excepts != 0);
}
libm_hidden_def (__feclearexcept)
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feclearexcept, __old_feclearexcept)
compat_symbol (libm, __old_feclearexcept, feclearexcept, GLIBC_2_1);

View File

@ -20,7 +20,7 @@
#include <fpu_control.h>
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
fpu_fpsr_t fpsr;
fpu_fpsr_t fpsr_new;
@ -35,4 +35,6 @@ feclearexcept (int excepts)
return 0;
}
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (__feclearexcept)
libm_hidden_def (feclearexcept)

View File

@ -35,6 +35,7 @@ __feclearexcept (int excepts)
/* Success. */
return 0;
}
libm_hidden_def (__feclearexcept)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)

View File

@ -20,7 +20,7 @@
#include <fpu_control.h>
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
unsigned int fpsr;
@ -33,4 +33,6 @@ feclearexcept (int excepts)
return 0;
}
libm_hidden_def (__feclearexcept)
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (feclearexcept)

View File

@ -22,7 +22,7 @@
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
fpu_control_t fpscr, new_fpscr;
@ -40,4 +40,6 @@ feclearexcept (int excepts)
return 0;
}
libm_hidden_def (__feclearexcept)
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (feclearexcept)

View File

@ -21,7 +21,7 @@
#include <fpu_control.h>
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
int fpsr;
@ -39,4 +39,6 @@ feclearexcept (int excepts)
return 0;
}
libm_hidden_def (__feclearexcept)
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (feclearexcept)

View File

@ -19,7 +19,7 @@
#include <fenv.h>
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
union { unsigned long long l; unsigned int sw[2]; } s;
@ -32,4 +32,6 @@ feclearexcept (int excepts)
/* Success. */
return 0;
}
libm_hidden_def (__feclearexcept)
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (feclearexcept)

View File

@ -56,6 +56,7 @@ __feclearexcept (int excepts)
/* Success. */
return 0;
}
libm_hidden_def (__feclearexcept)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)

View File

@ -21,7 +21,7 @@
#include <fpu_control.h>
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
int cw;
@ -43,4 +43,6 @@ feclearexcept (int excepts)
/* Success. */
return 0;
}
libm_hidden_def (__feclearexcept)
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (feclearexcept)

View File

@ -38,6 +38,7 @@ __feclearexcept (int excepts)
/* Success. */
return 0;
}
libm_hidden_def (__feclearexcept)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)

View File

@ -21,7 +21,7 @@
#include <fpu_control.h>
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
int cw;
@ -43,4 +43,6 @@ feclearexcept (int excepts)
/* Success. */
return 0;
}
libm_hidden_def (__feclearexcept)
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (feclearexcept)

View File

@ -21,7 +21,7 @@
#include <fpu_control.h>
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
fpu_control_t cw;
fpu_control_t cw_new;
@ -41,4 +41,6 @@ feclearexcept (int excepts)
/* Success. */
return 0;
}
libm_hidden_def (__feclearexcept)
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (feclearexcept)

View File

@ -38,6 +38,7 @@ __feclearexcept (int excepts)
/* Success. */
return 0;
}
libm_hidden_def (__feclearexcept)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)

View File

@ -26,6 +26,7 @@ __feclearexcept (int x)
SIM_SET_GLOBAL (__sim_exceptions_global, __sim_exceptions_thread);
return 0;
}
libm_hidden_def (__feclearexcept)
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)

View File

@ -20,9 +20,11 @@
#include <fpu_control.h>
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
asm volatile ("csrc fflags, %0" : : "r" (excepts));
return 0;
}
libm_hidden_def (__feclearexcept)
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (feclearexcept)

View File

@ -20,7 +20,7 @@
#include <fpu_control.h>
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
fexcept_t temp;
@ -42,4 +42,6 @@ feclearexcept (int excepts)
/* Success. */
return 0;
}
libm_hidden_def (__feclearexcept)
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (feclearexcept)

View File

@ -20,7 +20,7 @@
#include <fpu_control.h>
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
fpu_control_t cw;
@ -38,4 +38,6 @@ feclearexcept (int excepts)
return 0;
}
libm_hidden_def (__feclearexcept)
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (feclearexcept)

View File

@ -34,6 +34,7 @@ __feclearexcept (int excepts)
/* Success. */
return 0;
}
libm_hidden_def (__feclearexcept)
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feclearexcept, __old_feclearexcept)

View File

@ -19,7 +19,7 @@
#include <fenv.h>
int
feclearexcept (int excepts)
__feclearexcept (int excepts)
{
fenv_t temp;
unsigned int mxcsr;
@ -49,4 +49,6 @@ feclearexcept (int excepts)
/* Success. */
return 0;
}
libm_hidden_def (__feclearexcept)
weak_alias (__feclearexcept, feclearexcept)
libm_hidden_def (feclearexcept)