math: remove exp10 wrappers

Remove the error handling wrapper from exp10.  This is very similar to
the changes done to exp and exp2, except that we also need to handle
pow10 and pow10l.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Wilco Dijkstra 2024-01-09 15:32:08 +00:00
parent 7c14d8a985
commit 08ddd26814
29 changed files with 71 additions and 8 deletions

View File

@ -635,4 +635,8 @@ libm {
# No SVID compatible error handling. # No SVID compatible error handling.
fmod; fmodf; fmod; fmodf;
} }
GLIBC_2.39 {
# No SVID compatible error handling.
exp10;
}
} }

View File

@ -25,9 +25,15 @@
#include <math-svid-compat.h> #include <math-svid-compat.h>
#include <libm-alias-double.h> #include <libm-alias-double.h>
#if LIBM_SVID_COMPAT #ifndef NO_COMPAT_NEEDED
# define NO_COMPAT_NEEDED 0
#endif
#if LIBM_SVID_COMPAT && (SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_39) \
|| defined NO_LONG_DOUBLE \
|| defined LONG_DOUBLE_COMPAT)
double double
__exp10 (double x) __exp10_compat (double x)
{ {
double z = __ieee754_exp10 (x); double z = __ieee754_exp10 (x);
if (__builtin_expect (!isfinite (z) || z == 0, 0) if (__builtin_expect (!isfinite (z) || z == 0, 0)
@ -37,14 +43,30 @@ __exp10 (double x)
return z; return z;
} }
libm_alias_double (__exp10, exp10) # if NO_COMPAT_NEEDED
# ifdef SHARED
libm_alias_double (__exp10_compat, exp10)
# endif
#else
# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_39)
compat_symbol (libm, __exp10_compat, exp10, GLIBC_2_1);
# endif
# ifdef NO_LONG_DOUBLE
weak_alias (__exp10_compat, exp10l)
# endif
# ifdef LONG_DOUBLE_COMPAT
LONG_DOUBLE_COMPAT_CHOOSE_libm_exp10l (
compat_symbol (libm, __exp10_compat, exp10l, FIRST_VERSION_libm_exp10l), );
# endif
# endif
# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27) # if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
strong_alias (__exp10, __pow10) strong_alias (__exp10_compat, __pow10)
compat_symbol (libm, __pow10, pow10, GLIBC_2_1); compat_symbol (libm, __pow10, pow10, GLIBC_2_1);
# endif # endif
# ifdef NO_LONG_DOUBLE # ifdef NO_LONG_DOUBLE
# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27) # if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
strong_alias (__exp10l, __pow10l) strong_alias (exp10l, __pow10l)
compat_symbol (libm, __pow10l, pow10l, GLIBC_2_1); compat_symbol (libm, __pow10l, pow10l, GLIBC_2_1);
# endif # endif
# endif # endif

View File

@ -0,0 +1,3 @@
/* i386 provides an optimized __ieee754_exp10. */
#define NO_COMPAT_NEEDED 1
#include <math/w_exp10_compat.c>

View File

@ -18,9 +18,9 @@
#include <math.h> #include <math.h>
#include <math-barriers.h> #include <math-barriers.h>
#include <math-narrow-eval.h> #include <math-narrow-eval.h>
#include <math_private.h> #include <math-svid-compat.h>
#include <float.h>
#include <libm-alias-finite.h> #include <libm-alias-finite.h>
#include <libm-alias-double.h>
#include "math_config.h" #include "math_config.h"
#define N (1 << EXP_TABLE_BITS) #define N (1 << EXP_TABLE_BITS)
@ -75,7 +75,7 @@ special_case (uint64_t sbits, double_t tmp, uint64_t ki)
/* Double-precision 10^x approximation. Largest observed error is ~0.513 ULP. */ /* Double-precision 10^x approximation. Largest observed error is ~0.513 ULP. */
double double
__ieee754_exp10 (double x) __exp10 (double x)
{ {
uint64_t ix = asuint64 (x); uint64_t ix = asuint64 (x);
uint32_t abstop = (ix >> 52) & 0x7ff; uint32_t abstop = (ix >> 52) & 0x7ff;
@ -144,4 +144,11 @@ __ieee754_exp10 (double x)
return s * y + s; return s * y + s;
} }
strong_alias (__exp10, __ieee754_exp10)
libm_alias_finite (__ieee754_exp10, __exp10) libm_alias_finite (__ieee754_exp10, __exp10)
#if LIBM_SVID_COMPAT
versioned_symbol (libm, __exp10, exp10, GLIBC_2_39);
libm_alias_double_other (__exp10, exp10)
#else
libm_alias_double (__exp10, exp10)
#endif

View File

@ -0,0 +1 @@
/* Not needed. */

View File

@ -0,0 +1,3 @@
/* m68k provides an optimized __ieee754_exp10. */
#define NO_COMPAT_NEEDED 1
#include <math/w_exp10_compat.c>

View File

@ -1148,3 +1148,4 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F

View File

@ -1205,6 +1205,7 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 __clog10l F GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F GLIBC_2.4 __fpclassifyl F

View File

@ -535,6 +535,7 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 _LIB_VERSION D 0x4 GLIBC_2.4 _LIB_VERSION D 0x4
GLIBC_2.4 __clog10 F GLIBC_2.4 __clog10 F
GLIBC_2.4 __clog10f F GLIBC_2.4 __clog10f F

View File

@ -535,6 +535,7 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 _LIB_VERSION D 0x4 GLIBC_2.4 _LIB_VERSION D 0x4
GLIBC_2.4 __clog10 F GLIBC_2.4 __clog10 F
GLIBC_2.4 __clog10f F GLIBC_2.4 __clog10f F

View File

@ -846,4 +846,5 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 exp2l F GLIBC_2.4 exp2l F

View File

@ -535,6 +535,7 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 _LIB_VERSION D 0x4 GLIBC_2.4 _LIB_VERSION D 0x4
GLIBC_2.4 __clog10 F GLIBC_2.4 __clog10 F
GLIBC_2.4 __clog10f F GLIBC_2.4 __clog10f F

View File

@ -847,3 +847,4 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F

View File

@ -847,3 +847,4 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F

View File

@ -846,4 +846,5 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 exp2l F GLIBC_2.4 exp2l F

View File

@ -1148,3 +1148,4 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F

View File

@ -847,3 +847,4 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F

View File

@ -892,6 +892,7 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 __clog10l F GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F GLIBC_2.4 __fpclassifyl F

View File

@ -891,6 +891,7 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 __clog10l F GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F GLIBC_2.4 __fpclassifyl F

View File

@ -885,6 +885,7 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 __clog10l F GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F GLIBC_2.4 __fpclassifyl F

View File

@ -1320,3 +1320,4 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F

View File

@ -1149,6 +1149,7 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 __clog10l F GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F GLIBC_2.4 __fpclassifyl F

View File

@ -1149,6 +1149,7 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 __clog10l F GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F GLIBC_2.4 __fpclassifyl F

View File

@ -846,4 +846,5 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 exp2l F GLIBC_2.4 exp2l F

View File

@ -846,4 +846,5 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 exp2l F GLIBC_2.4 exp2l F

View File

@ -1156,6 +1156,7 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F
GLIBC_2.4 __clog10l F GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F GLIBC_2.4 __finitel F
GLIBC_2.4 __fpclassifyl F GLIBC_2.4 __fpclassifyl F

View File

@ -1148,3 +1148,4 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F

View File

@ -1181,3 +1181,4 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F

View File

@ -1181,3 +1181,4 @@ GLIBC_2.35 hypot F
GLIBC_2.35 hypotf F GLIBC_2.35 hypotf F
GLIBC_2.38 fmod F GLIBC_2.38 fmod F
GLIBC_2.38 fmodf F GLIBC_2.38 fmodf F
GLIBC_2.39 exp10 F