From 220622dde5704c95a100c2792a280f18f3deba73 Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Tue, 16 Jul 2019 12:17:22 -0300 Subject: Add libm_alias_finite for _finite symbols This patch adds a new macro, libm_alias_finite, to define all _finite symbol. It sets all _finite symbol as compat symbol based on its first version (obtained from the definition at built generated first-versions.h). The f128_finite symbols were introduced in GLIBC 2.26 and so need special treatment in code that is shared between long double and float128. It is done by adding a list, similar to internal symbol redifinition, on sysdeps/ieee754/float128/float128_private.h. Alpha also needs some tricky changes to ensure we still emit 2 compat symbols for sqrt(f). Passes buildmanyglibc. Co-authored-by: Adhemerval Zanella Reviewed-by: Siddhesh Poyarekar --- sysdeps/ieee754/ldbl-128/e_acoshl.c | 3 ++- sysdeps/ieee754/ldbl-128/e_acosl.c | 3 ++- sysdeps/ieee754/ldbl-128/e_asinl.c | 3 ++- sysdeps/ieee754/ldbl-128/e_atan2l.c | 3 ++- sysdeps/ieee754/ldbl-128/e_atanhl.c | 3 ++- sysdeps/ieee754/ldbl-128/e_coshl.c | 3 ++- sysdeps/ieee754/ldbl-128/e_exp10l.c | 3 ++- sysdeps/ieee754/ldbl-128/e_expl.c | 3 ++- sysdeps/ieee754/ldbl-128/e_fmodl.c | 3 ++- sysdeps/ieee754/ldbl-128/e_gammal_r.c | 3 ++- sysdeps/ieee754/ldbl-128/e_hypotl.c | 3 ++- sysdeps/ieee754/ldbl-128/e_j0l.c | 5 +++-- sysdeps/ieee754/ldbl-128/e_j1l.c | 5 +++-- sysdeps/ieee754/ldbl-128/e_jnl.c | 5 +++-- sysdeps/ieee754/ldbl-128/e_lgammal_r.c | 3 ++- sysdeps/ieee754/ldbl-128/e_log10l.c | 3 ++- sysdeps/ieee754/ldbl-128/e_log2l.c | 3 ++- sysdeps/ieee754/ldbl-128/e_logl.c | 3 ++- sysdeps/ieee754/ldbl-128/e_powl.c | 3 ++- sysdeps/ieee754/ldbl-128/e_remainderl.c | 3 ++- sysdeps/ieee754/ldbl-128/e_sinhl.c | 3 ++- 21 files changed, 45 insertions(+), 24 deletions(-) (limited to 'sysdeps/ieee754/ldbl-128') diff --git a/sysdeps/ieee754/ldbl-128/e_acoshl.c b/sysdeps/ieee754/ldbl-128/e_acoshl.c index c292759ac6..c3cb73a2a4 100644 --- a/sysdeps/ieee754/ldbl-128/e_acoshl.c +++ b/sysdeps/ieee754/ldbl-128/e_acoshl.c @@ -29,6 +29,7 @@ #include #include +#include static const _Float128 one = 1.0, @@ -58,4 +59,4 @@ __ieee754_acoshl(_Float128 x) return __log1pl(t+sqrtl(2*t+t*t)); } } -strong_alias (__ieee754_acoshl, __acoshl_finite) +libm_alias_finite (__ieee754_acoshl, __acoshl) diff --git a/sysdeps/ieee754/ldbl-128/e_acosl.c b/sysdeps/ieee754/ldbl-128/e_acosl.c index f698d0aa5c..6a6e5412e5 100644 --- a/sysdeps/ieee754/ldbl-128/e_acosl.c +++ b/sysdeps/ieee754/ldbl-128/e_acosl.c @@ -56,6 +56,7 @@ #include #include +#include static const _Float128 one = 1, @@ -316,4 +317,4 @@ __ieee754_acosl (_Float128 x) return 2.0 * w; } } -strong_alias (__ieee754_acosl, __acosl_finite) +libm_alias_finite (__ieee754_acosl, __acosl) diff --git a/sysdeps/ieee754/ldbl-128/e_asinl.c b/sysdeps/ieee754/ldbl-128/e_asinl.c index aa240f1ff2..4825e0c15d 100644 --- a/sysdeps/ieee754/ldbl-128/e_asinl.c +++ b/sysdeps/ieee754/ldbl-128/e_asinl.c @@ -64,6 +64,7 @@ #include #include #include +#include static const _Float128 one = 1, @@ -257,4 +258,4 @@ __ieee754_asinl (_Float128 x) else return -t; } -strong_alias (__ieee754_asinl, __asinl_finite) +libm_alias_finite (__ieee754_asinl, __asinl) diff --git a/sysdeps/ieee754/ldbl-128/e_atan2l.c b/sysdeps/ieee754/ldbl-128/e_atan2l.c index 8b4afa4bd5..142060de48 100644 --- a/sysdeps/ieee754/ldbl-128/e_atan2l.c +++ b/sysdeps/ieee754/ldbl-128/e_atan2l.c @@ -42,6 +42,7 @@ #include #include +#include static const _Float128 tiny = L(1.0e-4900), @@ -119,4 +120,4 @@ __ieee754_atan2l(_Float128 y, _Float128 x) return (z-pi_lo)-pi;/* atan(-,-) */ } } -strong_alias (__ieee754_atan2l, __atan2l_finite) +libm_alias_finite (__ieee754_atan2l, __atan2l) diff --git a/sysdeps/ieee754/ldbl-128/e_atanhl.c b/sysdeps/ieee754/ldbl-128/e_atanhl.c index 13b7683e17..68a52201d2 100644 --- a/sysdeps/ieee754/ldbl-128/e_atanhl.c +++ b/sysdeps/ieee754/ldbl-128/e_atanhl.c @@ -36,6 +36,7 @@ #include #include #include +#include static const _Float128 one = 1, huge = L(1e4900); @@ -72,4 +73,4 @@ __ieee754_atanhl(_Float128 x) t = 0.5*__log1pl((u.value+u.value)/(one-u.value)); if(jx & 0x80000000) return -t; else return t; } -strong_alias (__ieee754_atanhl, __atanhl_finite) +libm_alias_finite (__ieee754_atanhl, __atanhl) diff --git a/sysdeps/ieee754/ldbl-128/e_coshl.c b/sysdeps/ieee754/ldbl-128/e_coshl.c index 2b8c1abfc2..dc9d376359 100644 --- a/sysdeps/ieee754/ldbl-128/e_coshl.c +++ b/sysdeps/ieee754/ldbl-128/e_coshl.c @@ -53,6 +53,7 @@ #include #include +#include static const _Float128 one = 1.0, half = 0.5, huge = L(1.0e4900), ovf_thresh = L(1.1357216553474703894801348310092223067821E4); @@ -107,4 +108,4 @@ __ieee754_coshl (_Float128 x) /* |x| > overflowthresold, cosh(x) overflow */ return huge * huge; } -strong_alias (__ieee754_coshl, __coshl_finite) +libm_alias_finite (__ieee754_coshl, __coshl) diff --git a/sysdeps/ieee754/ldbl-128/e_exp10l.c b/sysdeps/ieee754/ldbl-128/e_exp10l.c index 7356a3a6d1..ea7ed0df40 100644 --- a/sysdeps/ieee754/ldbl-128/e_exp10l.c +++ b/sysdeps/ieee754/ldbl-128/e_exp10l.c @@ -18,6 +18,7 @@ #include #include #include +#include static const _Float128 log10_high = L(0x2.4d763776aaa2bp0); static const _Float128 log10_low = L(0x5.ba95b58ae0b4c28a38a3fb3e7698p-60); @@ -46,4 +47,4 @@ __ieee754_exp10l (_Float128 arg) exp_low = arg_high * log10_low + arg_low * M_LN10l; return __ieee754_expl (exp_high) * __ieee754_expl (exp_low); } -strong_alias (__ieee754_exp10l, __exp10l_finite) +libm_alias_finite (__ieee754_exp10l, __exp10l) diff --git a/sysdeps/ieee754/ldbl-128/e_expl.c b/sysdeps/ieee754/ldbl-128/e_expl.c index f41ab2059e..37c1538c08 100644 --- a/sysdeps/ieee754/ldbl-128/e_expl.c +++ b/sysdeps/ieee754/ldbl-128/e_expl.c @@ -69,6 +69,7 @@ #include #include #include "t_expl.h" +#include static const _Float128 C[] = { /* Smallest integer x for which e^x overflows. */ @@ -253,4 +254,4 @@ __ieee754_expl (_Float128 x) /* Return x, if x is a NaN or Inf; or overflow, otherwise. */ return TWO16383*x; } -strong_alias (__ieee754_expl, __expl_finite) +libm_alias_finite (__ieee754_expl, __expl) diff --git a/sysdeps/ieee754/ldbl-128/e_fmodl.c b/sysdeps/ieee754/ldbl-128/e_fmodl.c index 73465126b4..c927859cdf 100644 --- a/sysdeps/ieee754/ldbl-128/e_fmodl.c +++ b/sysdeps/ieee754/ldbl-128/e_fmodl.c @@ -20,6 +20,7 @@ #include #include +#include static const _Float128 one = 1.0, Zero[] = {0.0, -0.0,}; @@ -128,4 +129,4 @@ __ieee754_fmodl (_Float128 x, _Float128 y) } return x; /* exact output */ } -strong_alias (__ieee754_fmodl, __fmodl_finite) +libm_alias_finite (__ieee754_fmodl, __fmodl) diff --git a/sysdeps/ieee754/ldbl-128/e_gammal_r.c b/sysdeps/ieee754/ldbl-128/e_gammal_r.c index f393217f43..a41dacf28a 100644 --- a/sysdeps/ieee754/ldbl-128/e_gammal_r.c +++ b/sysdeps/ieee754/ldbl-128/e_gammal_r.c @@ -23,6 +23,7 @@ #include #include #include +#include /* Coefficients B_2k / 2k(2k-1) of x^-(2k-1) inside exp in Stirling's approximation to gamma function. */ @@ -217,4 +218,4 @@ __ieee754_gammal_r (_Float128 x, int *signgamp) else return ret; } -strong_alias (__ieee754_gammal_r, __gammal_r_finite) +libm_alias_finite (__ieee754_gammal_r, __gammal_r) diff --git a/sysdeps/ieee754/ldbl-128/e_hypotl.c b/sysdeps/ieee754/ldbl-128/e_hypotl.c index 7bafd4ae29..cc3cc4a01c 100644 --- a/sysdeps/ieee754/ldbl-128/e_hypotl.c +++ b/sysdeps/ieee754/ldbl-128/e_hypotl.c @@ -48,6 +48,7 @@ #include #include #include +#include _Float128 __ieee754_hypotl(_Float128 x, _Float128 y) @@ -138,4 +139,4 @@ __ieee754_hypotl(_Float128 x, _Float128 y) return w; } else return w; } -strong_alias (__ieee754_hypotl, __hypotl_finite) +libm_alias_finite (__ieee754_hypotl, __hypotl) diff --git a/sysdeps/ieee754/ldbl-128/e_j0l.c b/sysdeps/ieee754/ldbl-128/e_j0l.c index 631d67b92c..c424acc0bf 100644 --- a/sysdeps/ieee754/ldbl-128/e_j0l.c +++ b/sysdeps/ieee754/ldbl-128/e_j0l.c @@ -94,6 +94,7 @@ #include #include #include +#include /* 1 / sqrt(pi) */ static const _Float128 ONEOSQPI = L(5.6418958354775628694807945156077258584405E-1); @@ -789,7 +790,7 @@ __ieee754_j0l (_Float128 x) z = ONEOSQPI * (p * cc - q * ss) / sqrtl (xx); return z; } -strong_alias (__ieee754_j0l, __j0l_finite) +libm_alias_finite (__ieee754_j0l, __j0l) /* Y0(x) = 2/pi * log(x) * J0(x) + R(x^2) @@ -934,4 +935,4 @@ _Float128 z = ONEOSQPI * (p * ss + q * cc) / sqrtl (x); return z; } -strong_alias (__ieee754_y0l, __y0l_finite) +libm_alias_finite (__ieee754_y0l, __y0l) diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c index 174f35df07..54c457681a 100644 --- a/sysdeps/ieee754/ldbl-128/e_j1l.c +++ b/sysdeps/ieee754/ldbl-128/e_j1l.c @@ -101,6 +101,7 @@ #include #include #include +#include /* 1 / sqrt(pi) */ static const _Float128 ONEOSQPI = L(5.6418958354775628694807945156077258584405E-1); @@ -810,7 +811,7 @@ __ieee754_j1l (_Float128 x) z = -z; return z; } -strong_alias (__ieee754_j1l, __j1l_finite) +libm_alias_finite (__ieee754_j1l, __j1l) /* Y1(x) = 2/pi * (log(x) * J1(x) - 1/x) + x R(x^2) @@ -960,4 +961,4 @@ __ieee754_y1l (_Float128 x) z = ONEOSQPI * (p * ss + q * cc) / sqrtl (xx); return z; } -strong_alias (__ieee754_y1l, __y1l_finite) +libm_alias_finite (__ieee754_y1l, __y1l) diff --git a/sysdeps/ieee754/ldbl-128/e_jnl.c b/sysdeps/ieee754/ldbl-128/e_jnl.c index 9066e934f1..2abd32adfe 100644 --- a/sysdeps/ieee754/ldbl-128/e_jnl.c +++ b/sysdeps/ieee754/ldbl-128/e_jnl.c @@ -62,6 +62,7 @@ #include #include #include +#include static const _Float128 invsqrtpi = L(5.6418958354775628694807945156077258584405E-1), @@ -308,7 +309,7 @@ __ieee754_jnl (int n, _Float128 x) math_check_force_underflow (ret); return ret; } -strong_alias (__ieee754_jnl, __jnl_finite) +libm_alias_finite (__ieee754_jnl, __jnl) _Float128 __ieee754_ynl (int n, _Float128 x) @@ -422,4 +423,4 @@ __ieee754_ynl (int n, _Float128 x) ret = copysignl (LDBL_MAX, ret) * LDBL_MAX; return ret; } -strong_alias (__ieee754_ynl, __ynl_finite) +libm_alias_finite (__ieee754_ynl, __ynl) diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c index f7359ce62e..0476df8db3 100644 --- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c +++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c @@ -71,6 +71,7 @@ #include #include #include +#include static const _Float128 PIL = L(3.1415926535897932384626433832795028841972E0); static const _Float128 MAXLGM = L(1.0485738685148938358098967157129705071571E4928); @@ -1039,4 +1040,4 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp) q += neval (p, RASY, NRASY) / x; return (q); } -strong_alias (__ieee754_lgammal_r, __lgammal_r_finite) +libm_alias_finite (__ieee754_lgammal_r, __lgammal_r) diff --git a/sysdeps/ieee754/ldbl-128/e_log10l.c b/sysdeps/ieee754/ldbl-128/e_log10l.c index 7123c6f69a..9d1728af33 100644 --- a/sysdeps/ieee754/ldbl-128/e_log10l.c +++ b/sysdeps/ieee754/ldbl-128/e_log10l.c @@ -62,6 +62,7 @@ #include #include +#include /* Coefficients for ln(1+x) = x - x**2/2 + x**3 P(x)/Q(x) * 1/sqrt(2) <= x < sqrt(2) @@ -256,4 +257,4 @@ done: z += e * L102A; return (z); } -strong_alias (__ieee754_log10l, __log10l_finite) +libm_alias_finite (__ieee754_log10l, __log10l) diff --git a/sysdeps/ieee754/ldbl-128/e_log2l.c b/sysdeps/ieee754/ldbl-128/e_log2l.c index b82cd80bbc..b81b98ced8 100644 --- a/sysdeps/ieee754/ldbl-128/e_log2l.c +++ b/sysdeps/ieee754/ldbl-128/e_log2l.c @@ -61,6 +61,7 @@ #include #include +#include /* Coefficients for ln(1+x) = x - x**2/2 + x**3 P(x)/Q(x) * 1/sqrt(2) <= x < sqrt(2) @@ -249,4 +250,4 @@ done: z += e; return (z); } -strong_alias (__ieee754_log2l, __log2l_finite) +libm_alias_finite (__ieee754_log2l, __log2l) diff --git a/sysdeps/ieee754/ldbl-128/e_logl.c b/sysdeps/ieee754/ldbl-128/e_logl.c index be1ebe28b9..f6476e6534 100644 --- a/sysdeps/ieee754/ldbl-128/e_logl.c +++ b/sysdeps/ieee754/ldbl-128/e_logl.c @@ -60,6 +60,7 @@ #include #include +#include /* log(1+x) = x - .5 x^2 + x^3 l(x) -.0078125 <= x <= +.0078125 @@ -279,4 +280,4 @@ __ieee754_logl(_Float128 x) y += e * ln2a; return y; } -strong_alias (__ieee754_logl, __logl_finite) +libm_alias_finite (__ieee754_logl, __logl) diff --git a/sysdeps/ieee754/ldbl-128/e_powl.c b/sysdeps/ieee754/ldbl-128/e_powl.c index 967a730500..4e20616705 100644 --- a/sysdeps/ieee754/ldbl-128/e_powl.c +++ b/sysdeps/ieee754/ldbl-128/e_powl.c @@ -67,6 +67,7 @@ #include #include #include +#include static const _Float128 bp[] = { 1, @@ -449,4 +450,4 @@ __ieee754_powl (_Float128 x, _Float128 y) } return sgn * z; } -strong_alias (__ieee754_powl, __powl_finite) +libm_alias_finite (__ieee754_powl, __powl) diff --git a/sysdeps/ieee754/ldbl-128/e_remainderl.c b/sysdeps/ieee754/ldbl-128/e_remainderl.c index 09b8640b78..ade586a2d0 100644 --- a/sysdeps/ieee754/ldbl-128/e_remainderl.c +++ b/sysdeps/ieee754/ldbl-128/e_remainderl.c @@ -23,6 +23,7 @@ #include #include +#include static const _Float128 zero = 0; @@ -68,4 +69,4 @@ __ieee754_remainderl(_Float128 x, _Float128 p) SET_LDOUBLE_MSW64(x,hx^sx); return x; } -strong_alias (__ieee754_remainderl, __remainderl_finite) +libm_alias_finite (__ieee754_remainderl, __remainderl) diff --git a/sysdeps/ieee754/ldbl-128/e_sinhl.c b/sysdeps/ieee754/ldbl-128/e_sinhl.c index 9bbafa8c7a..976fcead3a 100644 --- a/sysdeps/ieee754/ldbl-128/e_sinhl.c +++ b/sysdeps/ieee754/ldbl-128/e_sinhl.c @@ -57,6 +57,7 @@ #include #include #include +#include static const _Float128 one = 1.0, shuge = L(1.0e4931), ovf_thresh = L(1.1357216553474703894801348310092223067821E4); @@ -115,4 +116,4 @@ __ieee754_sinhl (_Float128 x) /* |x| > overflowthreshold, sinhl(x) overflow */ return x * shuge; } -strong_alias (__ieee754_sinhl, __sinhl_finite) +libm_alias_finite (__ieee754_sinhl, __sinhl) -- cgit 1.4.1