From ea814db27ae450f9ce1b233dfeeea608d485adde Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Wed, 21 Dec 2016 10:20:08 -0200 Subject: Move w_lgamma_r to libm-compat-calls-auto This patch adds the suffix "_compat" to lgamma_r wrappers and make some adjustments to #includes and Makefiles. This is a step towards deprecation of wrappers that use _LIB_VERSION / matherr / __kernel_standard functionality. Tested for powerpc64le, s390, and x86_64. * math/Makefile (libm-calls): Move w_lgammaF_r... (libm-compat-calls-auto): Here. * math/w_lgamma_r.c: Add suffix "_compat" to filename. * math/w_lgammaf_r.c: Likewise. * math/w_lgammal_r.c: Likewise. * sysdeps/ia64/fpu/w_lgammal_r.c: Likewise. * sysdeps/ia64/fpu/w_lgammaf_r.c: Likewise. * sysdeps/ia64/fpu/w_lgamma_r.c: Likewise. * math/w_lgamma_r_compat.c: New file, copied from above. * math/w_lgammaf_r_compat.c: Likewise. * math/w_lgammal_r_compat.c: Likewise. * sysdeps/ia64/fpu/w_lgamma_r_compat.c: Likewise. * sysdeps/ia64/fpu/w_lgammaf_r_compat.c: Likewise. * sysdeps/ia64/fpu/w_lgammal_r_compat.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_lgamma_r.c: Add suffix "_compat" to filename. * sysdeps/ieee754/ldbl-opt/w_lgammal_r.c: Likewise. * sysdeps/ieee754/ldbl-opt/w_lgamma_r_compat.c: New file copied from above and adjusted for the new filenames. * sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c: Likewise. --- ChangeLog | 27 +++++++++++++++++++ math/Makefile | 5 ++-- math/w_lgamma_r.c | 38 --------------------------- math/w_lgamma_r_compat.c | 38 +++++++++++++++++++++++++++ math/w_lgammaf_r.c | 37 -------------------------- math/w_lgammaf_r_compat.c | 37 ++++++++++++++++++++++++++ math/w_lgammal_r.c | 38 --------------------------- math/w_lgammal_r_compat.c | 38 +++++++++++++++++++++++++++ sysdeps/ia64/fpu/w_lgamma_r.c | 1 - sysdeps/ia64/fpu/w_lgamma_r_compat.c | 1 + sysdeps/ia64/fpu/w_lgammaf_r.c | 1 - sysdeps/ia64/fpu/w_lgammaf_r_compat.c | 1 + sysdeps/ia64/fpu/w_lgammal_r.c | 1 - sysdeps/ia64/fpu/w_lgammal_r_compat.c | 1 + sysdeps/ieee754/ldbl-opt/w_lgamma_r.c | 5 ---- sysdeps/ieee754/ldbl-opt/w_lgamma_r_compat.c | 5 ++++ sysdeps/ieee754/ldbl-opt/w_lgammal_r.c | 5 ---- sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c | 5 ++++ 18 files changed, 156 insertions(+), 128 deletions(-) delete mode 100644 math/w_lgamma_r.c create mode 100644 math/w_lgamma_r_compat.c delete mode 100644 math/w_lgammaf_r.c create mode 100644 math/w_lgammaf_r_compat.c delete mode 100644 math/w_lgammal_r.c create mode 100644 math/w_lgammal_r_compat.c delete mode 100644 sysdeps/ia64/fpu/w_lgamma_r.c create mode 100644 sysdeps/ia64/fpu/w_lgamma_r_compat.c delete mode 100644 sysdeps/ia64/fpu/w_lgammaf_r.c create mode 100644 sysdeps/ia64/fpu/w_lgammaf_r_compat.c delete mode 100644 sysdeps/ia64/fpu/w_lgammal_r.c create mode 100644 sysdeps/ia64/fpu/w_lgammal_r_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_lgamma_r.c create mode 100644 sysdeps/ieee754/ldbl-opt/w_lgamma_r_compat.c delete mode 100644 sysdeps/ieee754/ldbl-opt/w_lgammal_r.c create mode 100644 sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c diff --git a/ChangeLog b/ChangeLog index e2fe0d752d..eb92a66a9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2017-02-08 Gabriel F. T. Gomes + + * math/Makefile (libm-calls): Move w_lgammaF_r... + (libm-compat-calls-auto): Here. + + * math/w_lgamma_r.c: Add suffix "_compat" to filename. + * math/w_lgammaf_r.c: Likewise. + * math/w_lgammal_r.c: Likewise. + * sysdeps/ia64/fpu/w_lgammal_r.c: Likewise. + * sysdeps/ia64/fpu/w_lgammaf_r.c: Likewise. + * sysdeps/ia64/fpu/w_lgamma_r.c: Likewise. + + * math/w_lgamma_r_compat.c: New file, copied from above. + * math/w_lgammaf_r_compat.c: Likewise. + * math/w_lgammal_r_compat.c: Likewise. + * sysdeps/ia64/fpu/w_lgamma_r_compat.c: Likewise. + * sysdeps/ia64/fpu/w_lgammaf_r_compat.c: Likewise. + * sysdeps/ia64/fpu/w_lgammal_r_compat.c: Likewise. + + * sysdeps/ieee754/ldbl-opt/w_lgamma_r.c: Add suffix "_compat" + to filename. + * sysdeps/ieee754/ldbl-opt/w_lgammal_r.c: Likewise. + + * sysdeps/ieee754/ldbl-opt/w_lgamma_r_compat.c: New file + copied from above and adjusted for the new filenames. + * sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c: Likewise. + 2017-02-08 Yury Norov * sysdeps/unix/sysv/linux/aarch64/sysdep.h: use PTR_REG() for offset diff --git a/math/Makefile b/math/Makefile index 9edea26c0e..7a456da7a2 100644 --- a/math/Makefile +++ b/math/Makefile @@ -67,7 +67,7 @@ libm-calls = \ s_nextafterF s_nexttowardF s_rintF s_scalblnF \ s_significandF s_sinF s_tanF s_tanhF \ w_expF \ - w_lgammaF w_lgammaF_r \ + w_lgammaF \ s_fpclassifyF s_truncF \ s_remquoF e_log2F e_exp2F s_roundF s_nearbyintF s_sincosF \ s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F \ @@ -83,7 +83,8 @@ libm-compat-calls-auto = \ w_fmodF_compat w_hypotF_compat w_j0F_compat w_j1F_compat \ w_jnF_compat w_log2F_compat w_log10F_compat w_logF_compat \ w_powF_compat w_remainderF_compat w_scalbF_compat \ - w_sinhF_compat w_sqrtF_compat w_tgammaF_compat + w_sinhF_compat w_sqrtF_compat w_tgammaF_compat \ + w_lgammaF_r_compat libm-compat-calls-ldouble-yes = w_lgamma_compatl k_standardl libm-compat-calls = w_lgamma_compatf w_lgamma_compat k_standard k_standardf \ diff --git a/math/w_lgamma_r.c b/math/w_lgamma_r.c deleted file mode 100644 index 6578b2c76c..0000000000 --- a/math/w_lgamma_r.c +++ /dev/null @@ -1,38 +0,0 @@ -/* @(#)wr_lgamma.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper double lgamma_r(double x, int *signgamp) - */ - -#include -#include - - -double -__lgamma_r(double x, int *signgamp) -{ - double y = __ieee754_lgamma_r(x,signgamp); - if(__builtin_expect(!isfinite(y), 0) - && isfinite(x) && _LIB_VERSION != _IEEE_) - return __kernel_standard(x, x, - __floor(x)==x&&x<=0.0 - ? 15 /* lgamma pole */ - : 14); /* lgamma overflow */ - - return y; -} -weak_alias (__lgamma_r, lgamma_r) -#ifdef NO_LONG_DOUBLE -strong_alias (__lgamma_r, __lgammal_r) -weak_alias (__lgamma_r, lgammal_r) -#endif diff --git a/math/w_lgamma_r_compat.c b/math/w_lgamma_r_compat.c new file mode 100644 index 0000000000..6578b2c76c --- /dev/null +++ b/math/w_lgamma_r_compat.c @@ -0,0 +1,38 @@ +/* @(#)wr_lgamma.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper double lgamma_r(double x, int *signgamp) + */ + +#include +#include + + +double +__lgamma_r(double x, int *signgamp) +{ + double y = __ieee754_lgamma_r(x,signgamp); + if(__builtin_expect(!isfinite(y), 0) + && isfinite(x) && _LIB_VERSION != _IEEE_) + return __kernel_standard(x, x, + __floor(x)==x&&x<=0.0 + ? 15 /* lgamma pole */ + : 14); /* lgamma overflow */ + + return y; +} +weak_alias (__lgamma_r, lgamma_r) +#ifdef NO_LONG_DOUBLE +strong_alias (__lgamma_r, __lgammal_r) +weak_alias (__lgamma_r, lgammal_r) +#endif diff --git a/math/w_lgammaf_r.c b/math/w_lgammaf_r.c deleted file mode 100644 index d7d2cb8bc1..0000000000 --- a/math/w_lgammaf_r.c +++ /dev/null @@ -1,37 +0,0 @@ -/* w_lgammaf_r.c -- float version of w_lgamma_r.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper float lgammaf_r(float x, int *signgamp) - */ - -#include -#include - - -float -__lgammaf_r(float x, int *signgamp) -{ - float y = __ieee754_lgammaf_r(x,signgamp); - if(__builtin_expect(!isfinite(y), 0) - && isfinite(x) && _LIB_VERSION != _IEEE_) - return __kernel_standard_f(x, x, - __floorf(x)==x&&x<=0.0f - ? 115 /* lgamma pole */ - : 114); /* lgamma overflow */ - - return y; -} -weak_alias (__lgammaf_r, lgammaf_r) diff --git a/math/w_lgammaf_r_compat.c b/math/w_lgammaf_r_compat.c new file mode 100644 index 0000000000..d7d2cb8bc1 --- /dev/null +++ b/math/w_lgammaf_r_compat.c @@ -0,0 +1,37 @@ +/* w_lgammaf_r.c -- float version of w_lgamma_r.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper float lgammaf_r(float x, int *signgamp) + */ + +#include +#include + + +float +__lgammaf_r(float x, int *signgamp) +{ + float y = __ieee754_lgammaf_r(x,signgamp); + if(__builtin_expect(!isfinite(y), 0) + && isfinite(x) && _LIB_VERSION != _IEEE_) + return __kernel_standard_f(x, x, + __floorf(x)==x&&x<=0.0f + ? 115 /* lgamma pole */ + : 114); /* lgamma overflow */ + + return y; +} +weak_alias (__lgammaf_r, lgammaf_r) diff --git a/math/w_lgammal_r.c b/math/w_lgammal_r.c deleted file mode 100644 index 7caeb1264f..0000000000 --- a/math/w_lgammal_r.c +++ /dev/null @@ -1,38 +0,0 @@ -/* w_lgammal_r.c -- long double version of w_lgamma_r.c. - * Conversion to long double by Ulrich Drepper, - * Cygnus Support, drepper@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* - * wrapper long double lgammal_r(long double x, int *signgamp) - */ - -#include -#include - - -long double -__lgammal_r(long double x, int *signgamp) -{ - long double y = __ieee754_lgammal_r(x,signgamp); - if(__builtin_expect(!isfinite(y), 0) - && isfinite(x) && _LIB_VERSION != _IEEE_) - return __kernel_standard(x, x, - __floorl(x)==x&&x<=0.0 - ? 215 /* lgamma pole */ - : 214); /* lgamma overflow */ - - return y; -} -weak_alias (__lgammal_r, lgammal_r) diff --git a/math/w_lgammal_r_compat.c b/math/w_lgammal_r_compat.c new file mode 100644 index 0000000000..7caeb1264f --- /dev/null +++ b/math/w_lgammal_r_compat.c @@ -0,0 +1,38 @@ +/* w_lgammal_r.c -- long double version of w_lgamma_r.c. + * Conversion to long double by Ulrich Drepper, + * Cygnus Support, drepper@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * wrapper long double lgammal_r(long double x, int *signgamp) + */ + +#include +#include + + +long double +__lgammal_r(long double x, int *signgamp) +{ + long double y = __ieee754_lgammal_r(x,signgamp); + if(__builtin_expect(!isfinite(y), 0) + && isfinite(x) && _LIB_VERSION != _IEEE_) + return __kernel_standard(x, x, + __floorl(x)==x&&x<=0.0 + ? 215 /* lgamma pole */ + : 214); /* lgamma overflow */ + + return y; +} +weak_alias (__lgammal_r, lgammal_r) diff --git a/sysdeps/ia64/fpu/w_lgamma_r.c b/sysdeps/ia64/fpu/w_lgamma_r.c deleted file mode 100644 index 41254ae60a..0000000000 --- a/sysdeps/ia64/fpu/w_lgamma_r.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/ia64/fpu/w_lgamma_r_compat.c b/sysdeps/ia64/fpu/w_lgamma_r_compat.c new file mode 100644 index 0000000000..41254ae60a --- /dev/null +++ b/sysdeps/ia64/fpu/w_lgamma_r_compat.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ia64/fpu/w_lgammaf_r.c b/sysdeps/ia64/fpu/w_lgammaf_r.c deleted file mode 100644 index 41254ae60a..0000000000 --- a/sysdeps/ia64/fpu/w_lgammaf_r.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/ia64/fpu/w_lgammaf_r_compat.c b/sysdeps/ia64/fpu/w_lgammaf_r_compat.c new file mode 100644 index 0000000000..41254ae60a --- /dev/null +++ b/sysdeps/ia64/fpu/w_lgammaf_r_compat.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ia64/fpu/w_lgammal_r.c b/sysdeps/ia64/fpu/w_lgammal_r.c deleted file mode 100644 index 41254ae60a..0000000000 --- a/sysdeps/ia64/fpu/w_lgammal_r.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/ia64/fpu/w_lgammal_r_compat.c b/sysdeps/ia64/fpu/w_lgammal_r_compat.c new file mode 100644 index 0000000000..41254ae60a --- /dev/null +++ b/sysdeps/ia64/fpu/w_lgammal_r_compat.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c b/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c deleted file mode 100644 index eeab6a6b47..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_lgamma_r.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#include -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __lgamma_r, lgammal_r, GLIBC_2_0); -#endif diff --git a/sysdeps/ieee754/ldbl-opt/w_lgamma_r_compat.c b/sysdeps/ieee754/ldbl-opt/w_lgamma_r_compat.c new file mode 100644 index 0000000000..673954cd1a --- /dev/null +++ b/sysdeps/ieee754/ldbl-opt/w_lgamma_r_compat.c @@ -0,0 +1,5 @@ +#include +#include +#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) +compat_symbol (libm, __lgamma_r, lgammal_r, GLIBC_2_0); +#endif diff --git a/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c b/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c deleted file mode 100644 index 25459758d7..0000000000 --- a/sysdeps/ieee754/ldbl-opt/w_lgammal_r.c +++ /dev/null @@ -1,5 +0,0 @@ -#include -#undef weak_alias -#define weak_alias(n,a) -#include -long_double_symbol (libm, __lgammal_r, lgammal_r); diff --git a/sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c b/sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c new file mode 100644 index 0000000000..6fdf2bba87 --- /dev/null +++ b/sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c @@ -0,0 +1,5 @@ +#include +#undef weak_alias +#define weak_alias(n,a) +#include +long_double_symbol (libm, __lgammal_r, lgammal_r); -- cgit v1.2.3-70-g09d2