]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Do not wrap expf and exp2f
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 12 Sep 2017 11:44:18 +0000 (12:44 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 29 Sep 2017 10:51:12 +0000 (11:51 +0100)
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.

2017-09-25  Szabolcs Nagy  <szabolcs.nagy@arm.com>
    H.J. Lu  <hongjiu.lu@intel.com>

* 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.

13 files changed:
sysdeps/i386/fpu/w_exp2f.c [new file with mode: 0644]
sysdeps/i386/fpu/w_expf.c [new file with mode: 0644]
sysdeps/i386/i686/fpu/multiarch/w_expf.c [new file with mode: 0644]
sysdeps/ieee754/flt-32/e_exp2f.c
sysdeps/ieee754/flt-32/e_expf.c
sysdeps/ieee754/flt-32/w_exp2f.c [new file with mode: 0644]
sysdeps/ieee754/flt-32/w_expf.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/w_exp2f.c [new file with mode: 0644]
sysdeps/m68k/m680x0/fpu/w_expf.c [new file with mode: 0644]
sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-ppc64.c
sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c [new file with mode: 0644]
sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c [new file with mode: 0644]
sysdeps/x86_64/fpu/w_expf.c [new file with mode: 0644]

diff --git a/sysdeps/i386/fpu/w_exp2f.c b/sysdeps/i386/fpu/w_exp2f.c
new file mode 100644 (file)
index 0000000..583065d
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_exp2f.c>
diff --git a/sysdeps/i386/fpu/w_expf.c b/sysdeps/i386/fpu/w_expf.c
new file mode 100644 (file)
index 0000000..b5fe164
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_expf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/w_expf.c b/sysdeps/i386/i686/fpu/multiarch/w_expf.c
new file mode 100644 (file)
index 0000000..b5fe164
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_expf.c>
index 72b7d8829ff1f67ad62393d03257331dde29ff67..31b660b07b07ca5d25489207c9f6e85b77137452 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <stdint.h>
+#include <shlib-compat.h>
 #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
index 12239e18623acf64d24c2e1822fc2f7bb1800c4e..74a383a02c00b3303088c44ccbbd4807662d50fc 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifdef __expf
+# undef libm_hidden_proto
+# define libm_hidden_proto(ignored)
+#endif
+
 #include <math.h>
 #include <stdint.h>
+#include <shlib-compat.h>
 #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 (file)
index 0000000..1cc8931
--- /dev/null
@@ -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 (file)
index 0000000..1cc8931
--- /dev/null
@@ -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 (file)
index 0000000..583065d
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_exp2f.c>
diff --git a/sysdeps/m68k/m680x0/fpu/w_expf.c b/sysdeps/m68k/m680x0/fpu/w_expf.c
new file mode 100644 (file)
index 0000000..b5fe164
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_expf.c>
index b236290ea2954d9dfffea2854f04b0118a102922..2cd9a5ec8b2b23957741762eccc4d9163a197894 100644 (file)
@@ -16,9 +16,6 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#undef strong_alias
-#define strong_alias(a, b)
-
-#define __ieee754_expf __ieee754_expf_ppc64
+#define __expf __ieee754_expf_ppc64
 
 #include <sysdeps/ieee754/flt-32/e_expf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/w_expf.c
new file mode 100644 (file)
index 0000000..b5fe164
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_expf.c>
diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c b/sysdeps/powerpc/powerpc64/power8/fpu/w_expf.c
new file mode 100644 (file)
index 0000000..b5fe164
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_expf.c>
diff --git a/sysdeps/x86_64/fpu/w_expf.c b/sysdeps/x86_64/fpu/w_expf.c
new file mode 100644 (file)
index 0000000..b5fe164
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/../math/w_expf.c>