From f7a0b063e7fc81d0eff1e8b2b169876bdfb4cc44 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Tue, 12 Sep 2017 12:44:18 +0100 Subject: Do not wrap expf and exp2f The new generic expf and exp2f code don't need wrappers any more, they set errno inline, so only use the wrappers on targets that need it. (If the wrapper is needed, then the top level wrapper code is included, otherwise empty w_exp*f.c is used to suppress the wrapper.) A powerpc64 expf implementation includes the expf c code directly which needed some changes. * sysdeps/ieee754/flt-32/e_exp2f.c (__exp2f): Define without wrapper. * sysdeps/ieee754/flt-32/e_expf.c (__expf): Likewise * sysdeps/ieee754/flt-32/w_exp2f.c: New file. * sysdeps/ieee754/flt-32/w_expf.c: New file. * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c: Update for the new expf code. * sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c: New file. * sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c: New file. * sysdeps/m68k/m680x0/fpu/w_exp2f.c: New file. * sysdeps/m68k/m680x0/fpu/w_expf.c: New file. * sysdeps/i386/fpu/w_exp2f.c: New file. * sysdeps/i386/fpu/w_expf.c: New file. * sysdeps/i386/i686/fpu/multiarch/w_expf.c: New file. * sysdeps/x86_64/fpu/w_expf.c: New file. --- ChangeLog | 18 ++++++++++++++++++ sysdeps/i386/fpu/w_exp2f.c | 1 + sysdeps/i386/fpu/w_expf.c | 1 + sysdeps/i386/i686/fpu/multiarch/w_expf.c | 1 + sysdeps/ieee754/flt-32/e_exp2f.c | 9 +++++++-- sysdeps/ieee754/flt-32/e_expf.c | 16 ++++++++++++++-- sysdeps/ieee754/flt-32/w_exp2f.c | 1 + sysdeps/ieee754/flt-32/w_expf.c | 1 + sysdeps/m68k/m680x0/fpu/w_exp2f.c | 1 + sysdeps/m68k/m680x0/fpu/w_expf.c | 1 + sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c | 5 +---- sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c | 1 + sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c | 1 + sysdeps/x86_64/fpu/w_expf.c | 1 + 14 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 sysdeps/i386/fpu/w_exp2f.c create mode 100644 sysdeps/i386/fpu/w_expf.c create mode 100644 sysdeps/i386/i686/fpu/multiarch/w_expf.c create mode 100644 sysdeps/ieee754/flt-32/w_exp2f.c create mode 100644 sysdeps/ieee754/flt-32/w_expf.c create mode 100644 sysdeps/m68k/m680x0/fpu/w_exp2f.c create mode 100644 sysdeps/m68k/m680x0/fpu/w_expf.c create mode 100644 sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c create mode 100644 sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c create mode 100644 sysdeps/x86_64/fpu/w_expf.c diff --git a/ChangeLog b/ChangeLog index 94e9972a13..25587d670e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2017-10-02 Szabolcs Nagy + H.J. Lu + + * sysdeps/ieee754/flt-32/e_exp2f.c (__exp2f): Define without wrapper. + * sysdeps/ieee754/flt-32/e_expf.c (__expf): Likewise + * sysdeps/ieee754/flt-32/w_exp2f.c: New file. + * sysdeps/ieee754/flt-32/w_expf.c: New file. + * sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c: Update for + the new expf code. + * sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c: New file. + * sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c: New file. + * sysdeps/m68k/m680x0/fpu/w_exp2f.c: New file. + * sysdeps/m68k/m680x0/fpu/w_expf.c: New file. + * sysdeps/i386/fpu/w_exp2f.c: New file. + * sysdeps/i386/fpu/w_expf.c: New file. + * sysdeps/i386/i686/fpu/multiarch/w_expf.c: New file. + * sysdeps/x86_64/fpu/w_expf.c: New file. + 2017-10-02 Szabolcs Nagy * math/Versions (logf): New libm symbol at GLIBC_2.27. diff --git a/sysdeps/i386/fpu/w_exp2f.c b/sysdeps/i386/fpu/w_exp2f.c new file mode 100644 index 0000000000..583065d12a --- /dev/null +++ b/sysdeps/i386/fpu/w_exp2f.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/i386/fpu/w_expf.c b/sysdeps/i386/fpu/w_expf.c new file mode 100644 index 0000000000..b5fe164520 --- /dev/null +++ b/sysdeps/i386/fpu/w_expf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/i386/i686/fpu/multiarch/w_expf.c b/sysdeps/i386/i686/fpu/multiarch/w_expf.c new file mode 100644 index 0000000000..b5fe164520 --- /dev/null +++ b/sysdeps/i386/i686/fpu/multiarch/w_expf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/ieee754/flt-32/e_exp2f.c b/sysdeps/ieee754/flt-32/e_exp2f.c index 72b7d8829f..31b660b07b 100644 --- a/sysdeps/ieee754/flt-32/e_exp2f.c +++ b/sysdeps/ieee754/flt-32/e_exp2f.c @@ -18,6 +18,7 @@ #include #include +#include #include "math_config.h" /* @@ -42,7 +43,7 @@ top12 (float x) } float -__ieee754_exp2f (float x) +__exp2f (float x) { uint32_t abstop; uint64_t ki, t; @@ -85,4 +86,8 @@ __ieee754_exp2f (float x) y = y * s; return (float) y; } -strong_alias (__ieee754_exp2f, __exp2f_finite) +#ifndef __exp2f +strong_alias (__exp2f, __ieee754_exp2f) +strong_alias (__exp2f, __exp2f_finite) +versioned_symbol (libm, __exp2f, exp2f, GLIBC_2_27); +#endif diff --git a/sysdeps/ieee754/flt-32/e_expf.c b/sysdeps/ieee754/flt-32/e_expf.c index 12239e1862..74a383a02c 100644 --- a/sysdeps/ieee754/flt-32/e_expf.c +++ b/sysdeps/ieee754/flt-32/e_expf.c @@ -16,8 +16,14 @@ License along with the GNU C Library; if not, see . */ +#ifdef __expf +# undef libm_hidden_proto +# define libm_hidden_proto(ignored) +#endif + #include #include +#include #include "math_config.h" /* @@ -42,7 +48,7 @@ top12 (float x) } float -__ieee754_expf (float x) +__expf (float x) { uint32_t abstop; uint64_t ki, t; @@ -99,4 +105,10 @@ __ieee754_expf (float x) y = y * s; return (float) y; } -strong_alias (__ieee754_expf, __expf_finite) + +#ifndef __expf +hidden_def (__expf) +strong_alias (__expf, __ieee754_expf) +strong_alias (__expf, __expf_finite) +versioned_symbol (libm, __expf, expf, GLIBC_2_27); +#endif diff --git a/sysdeps/ieee754/flt-32/w_exp2f.c b/sysdeps/ieee754/flt-32/w_exp2f.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/ieee754/flt-32/w_exp2f.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/ieee754/flt-32/w_expf.c b/sysdeps/ieee754/flt-32/w_expf.c new file mode 100644 index 0000000000..1cc8931700 --- /dev/null +++ b/sysdeps/ieee754/flt-32/w_expf.c @@ -0,0 +1 @@ +/* Not needed. */ diff --git a/sysdeps/m68k/m680x0/fpu/w_exp2f.c b/sysdeps/m68k/m680x0/fpu/w_exp2f.c new file mode 100644 index 0000000000..583065d12a --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/w_exp2f.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/m68k/m680x0/fpu/w_expf.c b/sysdeps/m68k/m680x0/fpu/w_expf.c new file mode 100644 index 0000000000..b5fe164520 --- /dev/null +++ b/sysdeps/m68k/m680x0/fpu/w_expf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c index b236290ea2..2cd9a5ec8b 100644 --- a/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c @@ -16,9 +16,6 @@ License along with the GNU C Library; if not, see . */ -#undef strong_alias -#define strong_alias(a, b) - -#define __ieee754_expf __ieee754_expf_ppc64 +#define __expf __ieee754_expf_ppc64 #include diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c new file mode 100644 index 0000000000..b5fe164520 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c b/sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c new file mode 100644 index 0000000000..b5fe164520 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/x86_64/fpu/w_expf.c b/sysdeps/x86_64/fpu/w_expf.c new file mode 100644 index 0000000000..b5fe164520 --- /dev/null +++ b/sysdeps/x86_64/fpu/w_expf.c @@ -0,0 +1 @@ +#include -- cgit v1.2.3