This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/x86/math created. glibc-2.26-584-g26ffb87
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 14 Oct 2017 20:35:05 -0000
- Subject: GNU C Library master sources branch hjl/x86/math created. glibc-2.26-584-g26ffb87
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, hjl/x86/math has been created
at 26ffb87d1d679eecebe86d7929126370ee168868 (commit)
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=26ffb87d1d679eecebe86d7929126370ee168868
commit 26ffb87d1d679eecebe86d7929126370ee168868
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Sep 29 19:39:47 2017 -0700
i386: Replace assembly versions of e_powf with generic e_powf.c
This patch replaces i386 assembly versions of e_powf with generic
e_powf.c.
* sysdeps/i386/fpu/e_powf.S: Removed.
* sysdeps/i386/fpu/e_powf_log2_data.c: Likewise.
* sysdeps/i386/fpu/w_powf.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_powf.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_powf-sse2.
(CFLAGS-e_powf-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_powf.c: Likewise.
diff --git a/sysdeps/i386/fpu/e_powf.S b/sysdeps/i386/fpu/e_powf.S
deleted file mode 100644
index 467ef23..0000000
--- a/sysdeps/i386/fpu/e_powf.S
+++ /dev/null
@@ -1,392 +0,0 @@
-/* ix87 specific implementation of pow function.
- Copyright (C) 1996-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include <i386-math-asm.h>
-
- .section .rodata.cst8,"aM",@progbits,8
-
- .p2align 3
- .type one,@object
-one: .double 1.0
- ASM_SIZE_DIRECTIVE(one)
- .type limit,@object
-limit: .double 0.29
- ASM_SIZE_DIRECTIVE(limit)
- .type p31,@object
-p31: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x41
- ASM_SIZE_DIRECTIVE(p31)
-
- .section .rodata.cst16,"aM",@progbits,16
-
- .p2align 3
- .type infinity,@object
-inf_zero:
-infinity:
- .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f
- ASM_SIZE_DIRECTIVE(infinity)
- .type zero,@object
-zero: .double 0.0
- ASM_SIZE_DIRECTIVE(zero)
- .type minf_mzero,@object
-minf_mzero:
-minfinity:
- .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff
-mzero:
- .byte 0, 0, 0, 0, 0, 0, 0, 0x80
- ASM_SIZE_DIRECTIVE(minf_mzero)
-DEFINE_FLT_MIN
-
-#ifdef PIC
-# define MO(op) op##@GOTOFF(%ecx)
-# define MOX(op,x,f) op##@GOTOFF(%ecx,x,f)
-#else
-# define MO(op) op
-# define MOX(op,x,f) op(,x,f)
-#endif
-
- .text
-ENTRY(__ieee754_powf)
- flds 8(%esp) // y
- fxam
-
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
-
- fnstsw
- movb %ah, %dl
- andb $0x45, %ah
- cmpb $0x40, %ah // is y == 0 ?
- je 11f
-
- cmpb $0x05, %ah // is y == ±inf ?
- je 12f
-
- cmpb $0x01, %ah // is y == NaN ?
- je 30f
-
- flds 4(%esp) // x : y
-
- subl $4, %esp
- cfi_adjust_cfa_offset (4)
-
- fxam
- fnstsw
- movb %ah, %dh
- andb $0x45, %ah
- cmpb $0x40, %ah
- je 20f // x is ±0
-
- cmpb $0x05, %ah
- je 15f // x is ±inf
-
- cmpb $0x01, %ah
- je 33f // x is NaN
-
- fxch // y : x
-
- /* fistpl raises invalid exception for |y| >= 1L<<31. */
- fld %st // y : y : x
- fabs // |y| : y : x
- fcompl MO(p31) // y : x
- fnstsw
- sahf
- jnc 2f
-
- /* First see whether `y' is a natural number. In this case we
- can use a more precise algorithm. */
- fld %st // y : y : x
- fistpl (%esp) // y : x
- fildl (%esp) // int(y) : y : x
- fucomp %st(1) // y : x
- fnstsw
- sahf
- jne 3f
-
- /* OK, we have an integer value for y. */
- popl %edx
- cfi_adjust_cfa_offset (-4)
- orl $0, %edx
- fstp %st(0) // x
- jns 4f // y >= 0, jump
- fdivrl MO(one) // 1/x (now referred to as x)
- negl %edx
-4: fldl MO(one) // 1 : x
- fxch
-
- /* If y is even, take the absolute value of x. Otherwise,
- ensure all intermediate values that might overflow have the
- sign of x. */
- testb $1, %dl
- jnz 6f
- fabs
-
-6: shrl $1, %edx
- jnc 5f
- fxch
- fabs
- fmul %st(1) // x : ST*x
- fxch
-5: fld %st // x : x : ST*x
- fabs // |x| : x : ST*x
- fmulp // |x|*x : ST*x
- testl %edx, %edx
- jnz 6b
- fstp %st(0) // ST*x
- FLT_NARROW_EVAL_UFLOW_NONNAN
- ret
-
- /* y is ±NAN */
-30: flds 4(%esp) // x : y
- fldl MO(one) // 1.0 : x : y
- fucomp %st(1) // x : y
- fnstsw
- sahf
- je 31f
- fxch // y : x
-31: fstp %st(1)
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
-2: /* y is a large integer (so even). */
- fxch // x : y
- fabs // |x| : y
- fxch // y : x
- .align ALIGNARG(4)
-3: /* y is a real number. */
- fxch // x : y
- fldl MO(one) // 1.0 : x : y
- fldl MO(limit) // 0.29 : 1.0 : x : y
- fld %st(2) // x : 0.29 : 1.0 : x : y
- fsub %st(2) // x-1 : 0.29 : 1.0 : x : y
- fabs // |x-1| : 0.29 : 1.0 : x : y
- fucompp // 1.0 : x : y
- fnstsw
- fxch // x : 1.0 : y
- sahf
- ja 7f
- fsub %st(1) // x-1 : 1.0 : y
- fyl2xp1 // log2(x) : y
- jmp 8f
-
-7: fyl2x // log2(x) : y
-8: fmul %st(1) // y*log2(x) : y
- fst %st(1) // y*log2(x) : y*log2(x)
- frndint // int(y*log2(x)) : y*log2(x)
- fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x))
- fxch // fract(y*log2(x)) : int(y*log2(x))
- f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x))
- faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x))
- fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x))
-32: addl $4, %esp
- cfi_adjust_cfa_offset (-4)
- fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x))
- FLT_NARROW_EVAL_UFLOW_NONNAN
- ret
-
- /* x is NaN. */
- cfi_adjust_cfa_offset (4)
-33: addl $4, %esp
- cfi_adjust_cfa_offset (-4)
- fstp %st(1)
- ret
-
- // pow(x,±0) = 1
- .align ALIGNARG(4)
-11: fstp %st(0) // pop y
- fldl MO(one)
- ret
-
- // y == ±inf
- .align ALIGNARG(4)
-12: fstp %st(0) // pop y
- fldl MO(one) // 1
- flds 4(%esp) // x : 1
- fabs // abs(x) : 1
- fucompp // < 1, == 1, or > 1
- fnstsw
- andb $0x45, %ah
- cmpb $0x45, %ah
- je 13f // jump if x is NaN
-
- cmpb $0x40, %ah
- je 14f // jump if |x| == 1
-
- shlb $1, %ah
- xorb %ah, %dl
- andl $2, %edx
- fldl MOX(inf_zero, %edx, 4)
- ret
-
- .align ALIGNARG(4)
-14: fldl MO(one)
- ret
-
- .align ALIGNARG(4)
-13: flds 4(%esp) // load x == NaN
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
- // x is ±inf
-15: fstp %st(0) // y
- testb $2, %dh
- jz 16f // jump if x == +inf
-
- // fistpl raises invalid exception for |y| >= 1L<<31, so test
- // that (in which case y is certainly even) before testing
- // whether y is odd.
- fld %st // y : y
- fabs // |y| : y
- fcompl MO(p31) // y
- fnstsw
- sahf
- jnc 16f
-
- // We must find out whether y is an odd integer.
- fld %st // y : y
- fistpl (%esp) // y
- fildl (%esp) // int(y) : y
- fucompp // <empty>
- fnstsw
- sahf
- jne 17f
-
- // OK, the value is an integer.
- popl %edx
- cfi_adjust_cfa_offset (-4)
- testb $1, %dl
- jz 18f // jump if not odd
- // It's an odd integer.
- shrl $31, %edx
- fldl MOX(minf_mzero, %edx, 8)
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
-16: fcompl MO(zero)
- addl $4, %esp
- cfi_adjust_cfa_offset (-4)
- fnstsw
- shrl $5, %eax
- andl $8, %eax
- fldl MOX(inf_zero, %eax, 1)
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
-17: shll $30, %edx // sign bit for y in right position
- addl $4, %esp
- cfi_adjust_cfa_offset (-4)
-18: shrl $31, %edx
- fldl MOX(inf_zero, %edx, 8)
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
- // x is ±0
-20: fstp %st(0) // y
- testb $2, %dl
- jz 21f // y > 0
-
- // x is ±0 and y is < 0. We must find out whether y is an odd integer.
- testb $2, %dh
- jz 25f
-
- // fistpl raises invalid exception for |y| >= 1L<<31, so test
- // that (in which case y is certainly even) before testing
- // whether y is odd.
- fld %st // y : y
- fabs // |y| : y
- fcompl MO(p31) // y
- fnstsw
- sahf
- jnc 25f
-
- fld %st // y : y
- fistpl (%esp) // y
- fildl (%esp) // int(y) : y
- fucompp // <empty>
- fnstsw
- sahf
- jne 26f
-
- // OK, the value is an integer.
- popl %edx
- cfi_adjust_cfa_offset (-4)
- testb $1, %dl
- jz 27f // jump if not odd
- // It's an odd integer.
- // Raise divide-by-zero exception and get minus infinity value.
- fldl MO(one)
- fdivl MO(zero)
- fchs
- ret
-
- cfi_adjust_cfa_offset (4)
-25: fstp %st(0)
-26: addl $4, %esp
- cfi_adjust_cfa_offset (-4)
-27: // Raise divide-by-zero exception and get infinity value.
- fldl MO(one)
- fdivl MO(zero)
- ret
-
- cfi_adjust_cfa_offset (4)
- .align ALIGNARG(4)
- // x is ±0 and y is > 0. We must find out whether y is an odd integer.
-21: testb $2, %dh
- jz 22f
-
- // fistpl raises invalid exception for |y| >= 1L<<31, so test
- // that (in which case y is certainly even) before testing
- // whether y is odd.
- fcoml MO(p31) // y
- fnstsw
- sahf
- jnc 22f
-
- fld %st // y : y
- fistpl (%esp) // y
- fildl (%esp) // int(y) : y
- fucompp // <empty>
- fnstsw
- sahf
- jne 23f
-
- // OK, the value is an integer.
- popl %edx
- cfi_adjust_cfa_offset (-4)
- testb $1, %dl
- jz 24f // jump if not odd
- // It's an odd integer.
- fldl MO(mzero)
- ret
-
- cfi_adjust_cfa_offset (4)
-22: fstp %st(0)
-23: addl $4, %esp // Don't use pop.
- cfi_adjust_cfa_offset (-4)
-24: fldl MO(zero)
- ret
-
-END(__ieee754_powf)
-strong_alias (__ieee754_powf, __powf_finite)
diff --git a/sysdeps/i386/fpu/e_powf_log2_data.c b/sysdeps/i386/fpu/e_powf_log2_data.c
deleted file mode 100644
index 1cc8931..0000000
--- a/sysdeps/i386/fpu/e_powf_log2_data.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
index 5318f61..83b3b86 100644
--- a/sysdeps/i386/fpu/libm-test-ulps
+++ b/sysdeps/i386/fpu/libm-test-ulps
@@ -2370,24 +2370,30 @@ ldouble: 1
Function: "pow_downward":
double: 1
+float: 1
float128: 2
idouble: 1
+ifloat: 1
ifloat128: 2
ildouble: 4
ldouble: 4
Function: "pow_towardzero":
double: 1
+float: 1
float128: 2
idouble: 1
+ifloat: 1
ifloat128: 2
ildouble: 4
ldouble: 4
Function: "pow_upward":
double: 1
+float: 1
float128: 2
idouble: 1
+ifloat: 1
ifloat128: 2
ildouble: 4
ldouble: 4
diff --git a/sysdeps/i386/fpu/w_powf.c b/sysdeps/i386/fpu/w_powf.c
deleted file mode 100644
index d133216..0000000
--- a/sysdeps/i386/fpu/w_powf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/../math/w_powf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/Makefile b/sysdeps/i386/i686/fpu/multiarch/Makefile
index eee3b8b..c0fa976 100644
--- a/sysdeps/i386/i686/fpu/multiarch/Makefile
+++ b/sysdeps/i386/i686/fpu/multiarch/Makefile
@@ -1,9 +1,10 @@
ifeq ($(subdir),math)
libm-sysdep_routines += e_exp2f-sse2 e_expf-sse2 e_logf-sse2 e_log2f-sse2 \
- s_sinf-sse2 s_cosf-sse2 s_sincosf-sse2
+ e_powf-sse2 s_sinf-sse2 s_cosf-sse2 s_sincosf-sse2
CFLAGS-e_exp2f-sse2.c = -msse2 -mfpmath=sse
CFLAGS-e_expf-sse2.c = -msse2 -mfpmath=sse
CFLAGS-e_log2f-sse2.c = -msse2 -mfpmath=sse
CFLAGS-e_logf-sse2.c = -msse2 -mfpmath=sse
+CFLAGS-e_powf-sse2.c = -msse2 -mfpmath=sse
endif
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c b/sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c
new file mode 100644
index 0000000..c56f6ee
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c
@@ -0,0 +1,3 @@
+#define __powf __powf_sse2
+
+#include <sysdeps/ieee754/flt-32/e_powf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_powf.c b/sysdeps/i386/i686/fpu/multiarch/e_powf.c
new file mode 100644
index 0000000..4dc4c87
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_powf.c
@@ -0,0 +1,43 @@
+/* Multiple versions of powf.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define powf __redirect_powf
+#define __DECL_SIMD___redirect_powf
+#include <math.h>
+#undef powf
+
+#define SYMBOL_NAME powf
+#include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_powf, __powf, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (__powf_ia32, __GI___powf, __redirect_powf)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __powf, powf, GLIBC_2_27);
+#else
+weak_alias (__powf, powf)
+#endif
+
+strong_alias (__powf, __ieee754_powf)
+strong_alias (__powf, __powf_finite)
+
+#define __powf __powf_ia32
+#include <sysdeps/ieee754/flt-32/e_powf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
index b5d74df..26d90ec 100644
--- a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
+++ b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
@@ -2370,24 +2370,30 @@ ldouble: 1
Function: "pow_downward":
double: 1
+float: 1
float128: 2
idouble: 1
+ifloat: 1
ifloat128: 2
ildouble: 4
ldouble: 4
Function: "pow_towardzero":
double: 1
+float: 1
float128: 2
idouble: 1
+ifloat: 1
ifloat128: 2
ildouble: 4
ldouble: 4
Function: "pow_upward":
double: 1
+float: 1
float128: 2
idouble: 1
+ifloat: 1
ifloat128: 2
ildouble: 4
ldouble: 4
@@ -2577,30 +2583,30 @@ ldouble: 5
Function: "tgamma_downward":
double: 3
-float: 4
+float: 5
float128: 5
idouble: 3
-ifloat: 4
+ifloat: 5
ifloat128: 5
ildouble: 5
ldouble: 5
Function: "tgamma_towardzero":
double: 4
-float: 4
+float: 5
float128: 5
idouble: 4
-ifloat: 4
+ifloat: 5
ifloat128: 5
ildouble: 5
ldouble: 5
Function: "tgamma_upward":
double: 4
-float: 4
+float: 6
float128: 4
idouble: 4
-ifloat: 4
+ifloat: 6
ifloat128: 4
ildouble: 5
ldouble: 5
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e8b1449170c71e6bd9997698a34e4b9cc4627c4f
commit e8b1449170c71e6bd9997698a34e4b9cc4627c4f
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Sep 29 18:55:47 2017 -0700
i386: Replace assembly versions of e_log2f with generic e_log2f.c
This patch replaces i386 assembly versions of e_log2f with generic
e_log2f.c.
* sysdeps/i386/fpu/e_log2f.S: Removed.
* sysdeps/i386/fpu/e_log2f_data.c: Likewise.
* sysdeps/i386/fpu/w_log2f.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_log2f.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_log2f-sse2.
(CFLAGS-e_log2f-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_log2f-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_log2f.c: Likewise.
diff --git a/sysdeps/i386/fpu/e_log2f.S b/sysdeps/i386/fpu/e_log2f.S
deleted file mode 100644
index 344eeb4..0000000
--- a/sysdeps/i386/fpu/e_log2f.S
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Adapted for use as log2 by Ulrich Drepper <drepper@cygnus.com>.
- * Public domain.
- *
- * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
- */
-
-#include <machine/asm.h>
-
- .section .rodata.cst8,"aM",@progbits,8
-
- .p2align 3
- .type one,@object
-one: .double 1.0
- ASM_SIZE_DIRECTIVE(one)
- /* It is not important that this constant is precise. It is only
- a value which is known to be on the safe side for using the
- fyl2xp1 instruction. */
- .type limit,@object
-limit: .double 0.29
- ASM_SIZE_DIRECTIVE(limit)
-
-
-#ifdef PIC
-# define MO(op) op##@GOTOFF(%edx)
-#else
-# define MO(op) op
-#endif
-
- .text
-ENTRY(__ieee754_log2f)
-#ifdef PIC
- LOAD_PIC_REG (dx)
-#endif
- fldl MO(one)
- flds 4(%esp) // x : 1
- fxam
- fnstsw
- fld %st // x : x : 1
- sahf
- jc 3f // in case x is NaN or ±Inf
-4: fsub %st(2), %st // x-1 : x : 1
- fld %st // x-1 : x-1 : x : 1
- fabs // |x-1| : x-1 : x : 1
- fcompl MO(limit) // x-1 : x : 1
- fnstsw // x-1 : x : 1
- andb $0x45, %ah
- jz 2f
- fxam
- fnstsw
- andb $0x45, %ah
- cmpb $0x40, %ah
- jne 5f
- fabs // log2(1) is +0 in all rounding modes.
-5: fstp %st(1) // x-1 : 1
- fyl2xp1 // log(x)
- ret
-
-2: fstp %st(0) // x : 1
- fyl2x // log(x)
- ret
-
-3: jp 4b // in case x is ±Inf
- fstp %st(1)
- fstp %st(1)
- ret
-END (__ieee754_log2f)
-strong_alias (__ieee754_log2f, __log2f_finite)
diff --git a/sysdeps/i386/fpu/e_log2f_data.c b/sysdeps/i386/fpu/e_log2f_data.c
deleted file mode 100644
index 1cc8931..0000000
--- a/sysdeps/i386/fpu/e_log2f_data.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
index 698d1b3..5318f61 100644
--- a/sysdeps/i386/fpu/libm-test-ulps
+++ b/sysdeps/i386/fpu/libm-test-ulps
@@ -2300,8 +2300,10 @@ ldouble: 3
Function: "log2":
double: 1
+float: 1
float128: 2
idouble: 1
+ifloat: 1
ifloat128: 2
ildouble: 1
ldouble: 1
diff --git a/sysdeps/i386/fpu/w_log2f.c b/sysdeps/i386/fpu/w_log2f.c
deleted file mode 100644
index 3f5c71c..0000000
--- a/sysdeps/i386/fpu/w_log2f.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/../math/w_log2f.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/Makefile b/sysdeps/i386/i686/fpu/multiarch/Makefile
index ee4c3f3..eee3b8b 100644
--- a/sysdeps/i386/i686/fpu/multiarch/Makefile
+++ b/sysdeps/i386/i686/fpu/multiarch/Makefile
@@ -1,8 +1,9 @@
ifeq ($(subdir),math)
-libm-sysdep_routines += e_exp2f-sse2 e_expf-sse2 e_logf-sse2 \
+libm-sysdep_routines += e_exp2f-sse2 e_expf-sse2 e_logf-sse2 e_log2f-sse2 \
s_sinf-sse2 s_cosf-sse2 s_sincosf-sse2
CFLAGS-e_exp2f-sse2.c = -msse2 -mfpmath=sse
CFLAGS-e_expf-sse2.c = -msse2 -mfpmath=sse
+CFLAGS-e_log2f-sse2.c = -msse2 -mfpmath=sse
CFLAGS-e_logf-sse2.c = -msse2 -mfpmath=sse
endif
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_log2f-sse2.c b/sysdeps/i386/i686/fpu/multiarch/e_log2f-sse2.c
new file mode 100644
index 0000000..a9ed25e
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_log2f-sse2.c
@@ -0,0 +1,3 @@
+#define __log2f __log2f_sse2
+
+#include <sysdeps/ieee754/flt-32/e_log2f.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_log2f.c b/sysdeps/i386/i686/fpu/multiarch/e_log2f.c
new file mode 100644
index 0000000..2c47949
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_log2f.c
@@ -0,0 +1,40 @@
+/* Multiple versions of log2f.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+extern float __redirect_log2f (float);
+
+#define SYMBOL_NAME log2f
+#include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_log2f, __log2f, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (__log2f_ia32, __GI___log2f, __redirect_log2f)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __log2f, log2f, GLIBC_2_27);
+#else
+weak_alias (__log2f, log2f)
+#endif
+
+strong_alias (__log2f, __ieee754_log2f)
+strong_alias (__log2f, __log2f_finite)
+
+#define __log2f __log2f_ia32
+#include <sysdeps/ieee754/flt-32/e_log2f.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
index c86294b..b5d74df 100644
--- a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
+++ b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
@@ -2300,8 +2300,10 @@ ldouble: 3
Function: "log2":
double: 1
+float: 1
float128: 2
idouble: 1
+ifloat: 1
ifloat128: 2
ildouble: 1
ldouble: 1
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4d8f52d808b67dbcb0a5625d60b7b217bd86b75a
commit 4d8f52d808b67dbcb0a5625d60b7b217bd86b75a
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Sep 29 16:53:00 2017 -0700
x86-64: Add powf with FMA
* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_powf-fma.
(CFLAGS-e_powf-fma.c): New.
* sysdeps/x86_64/fpu/multiarch/e_powf-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/e_powf.c: Likewise.
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 5338a6b..c78624b 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -37,12 +37,14 @@ CFLAGS-slowpow-fma.c = -mfma -mavx2
CFLAGS-s_sin-fma.c = -mfma -mavx2
CFLAGS-s_tan-fma.c = -mfma -mavx2
-libm-sysdep_routines += e_exp2f-fma e_expf-fma e_log2f-fma e_logf-fma
+libm-sysdep_routines += e_exp2f-fma e_expf-fma e_log2f-fma e_logf-fma \
+ e_powf-fma
CFLAGS-e_exp2f-fma.c = -mfma -mavx2
CFLAGS-e_expf-fma.c = -mfma -mavx2
CFLAGS-e_log2f-fma.c = -mfma -mavx2
CFLAGS-e_logf-fma.c = -mfma -mavx2
+CFLAGS-e_powf-fma.c = -mfma -mavx2
libm-sysdep_routines += e_exp-fma4 e_log-fma4 e_pow-fma4 s_atan-fma4 \
e_asin-fma4 e_atan2-fma4 s_sin-fma4 s_tan-fma4 \
diff --git a/sysdeps/x86_64/fpu/multiarch/e_powf-fma.c b/sysdeps/x86_64/fpu/multiarch/e_powf-fma.c
new file mode 100644
index 0000000..fdf5dcc
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_powf-fma.c
@@ -0,0 +1,3 @@
+#define __powf __powf_fma
+
+#include <sysdeps/ieee754/flt-32/e_powf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_powf.c b/sysdeps/x86_64/fpu/multiarch/e_powf.c
new file mode 100644
index 0000000..c110dba
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_powf.c
@@ -0,0 +1,43 @@
+/* Multiple versions of powf.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define powf __redirect_powf
+#define __DECL_SIMD___redirect_powf
+#include <math.h>
+#undef powf
+
+#define SYMBOL_NAME powf
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_powf, __powf, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (__powf, __GI___powf, __redirect_powf)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __powf, powf, GLIBC_2_27);
+#else
+weak_alias (__powf, powf)
+#endif
+
+strong_alias (__powf, __ieee754_powf)
+strong_alias (__powf, __powf_finite)
+
+#define __powf __powf_sse2
+#include <sysdeps/ieee754/flt-32/e_powf.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e23f4f246635945b46c21b19e51f02dd7b586d9e
commit e23f4f246635945b46c21b19e51f02dd7b586d9e
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Sep 29 16:50:06 2017 -0700
x86-64: Add log2f with FMA
* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_log2f-fma.
(CFLAGS-e_log2f-fma.c): New.
* sysdeps/x86_64/fpu/multiarch/e_log2f-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/e_log2f.c: Likewise.
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 97d886a..5338a6b 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -37,10 +37,11 @@ CFLAGS-slowpow-fma.c = -mfma -mavx2
CFLAGS-s_sin-fma.c = -mfma -mavx2
CFLAGS-s_tan-fma.c = -mfma -mavx2
-libm-sysdep_routines += e_exp2f-fma e_expf-fma e_logf-fma
+libm-sysdep_routines += e_exp2f-fma e_expf-fma e_log2f-fma e_logf-fma
CFLAGS-e_exp2f-fma.c = -mfma -mavx2
CFLAGS-e_expf-fma.c = -mfma -mavx2
+CFLAGS-e_log2f-fma.c = -mfma -mavx2
CFLAGS-e_logf-fma.c = -mfma -mavx2
libm-sysdep_routines += e_exp-fma4 e_log-fma4 e_pow-fma4 s_atan-fma4 \
diff --git a/sysdeps/x86_64/fpu/multiarch/e_log2f-fma.c b/sysdeps/x86_64/fpu/multiarch/e_log2f-fma.c
new file mode 100644
index 0000000..8a76b83
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_log2f-fma.c
@@ -0,0 +1,3 @@
+#define __log2f __log2f_fma
+
+#include <sysdeps/ieee754/flt-32/e_log2f.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_log2f.c b/sysdeps/x86_64/fpu/multiarch/e_log2f.c
new file mode 100644
index 0000000..be12c45
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_log2f.c
@@ -0,0 +1,40 @@
+/* Multiple versions of log2f.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+extern float __redirect_log2f (float);
+
+#define SYMBOL_NAME log2f
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_log2f, __log2f, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (__log2f, __GI___log2f, __redirect_log2f)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __log2f, log2f, GLIBC_2_27);
+#else
+weak_alias (__log2f, log2f)
+#endif
+
+strong_alias (__log2f, __ieee754_log2f)
+strong_alias (__log2f, __log2f_finite)
+
+#define __log2f __log2f_sse2
+#include <sysdeps/ieee754/flt-32/e_log2f.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b0fc061f5647db16a6d3920d0d0480c54cd1ffa8
commit b0fc061f5647db16a6d3920d0d0480c54cd1ffa8
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Sep 29 16:46:31 2017 -0700
x86-64: Add logf with FMA
* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_logf-fma.
(CFLAGS-e_logf-fma.c): New.
* sysdeps/x86_64/fpu/multiarch/e_logf-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/e_logf.c: Likewise.
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 71a3b33..97d886a 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -37,10 +37,11 @@ CFLAGS-slowpow-fma.c = -mfma -mavx2
CFLAGS-s_sin-fma.c = -mfma -mavx2
CFLAGS-s_tan-fma.c = -mfma -mavx2
-libm-sysdep_routines += e_exp2f-fma e_expf-fma
+libm-sysdep_routines += e_exp2f-fma e_expf-fma e_logf-fma
CFLAGS-e_exp2f-fma.c = -mfma -mavx2
CFLAGS-e_expf-fma.c = -mfma -mavx2
+CFLAGS-e_logf-fma.c = -mfma -mavx2
libm-sysdep_routines += e_exp-fma4 e_log-fma4 e_pow-fma4 s_atan-fma4 \
e_asin-fma4 e_atan2-fma4 s_sin-fma4 s_tan-fma4 \
diff --git a/sysdeps/x86_64/fpu/multiarch/e_logf-fma.c b/sysdeps/x86_64/fpu/multiarch/e_logf-fma.c
new file mode 100644
index 0000000..a47fd81
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_logf-fma.c
@@ -0,0 +1,3 @@
+#define __logf __logf_fma
+
+#include <sysdeps/ieee754/flt-32/e_logf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_logf.c b/sysdeps/x86_64/fpu/multiarch/e_logf.c
new file mode 100644
index 0000000..6b29473
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_logf.c
@@ -0,0 +1,40 @@
+/* Multiple versions of logf.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+extern float __redirect_logf (float);
+
+#define SYMBOL_NAME logf
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_logf, __logf, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (__logf, __GI___logf, __redirect_logf)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __logf, logf, GLIBC_2_27);
+#else
+weak_alias (__logf, logf)
+#endif
+
+strong_alias (__logf, __ieee754_logf)
+strong_alias (__logf, __logf_finite)
+
+#define __logf __logf_sse2
+#include <sysdeps/ieee754/flt-32/e_logf.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=368dc6e718c1948639f13cbf27ad67042b85378f
commit 368dc6e718c1948639f13cbf27ad67042b85378f
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Sep 29 16:36:37 2017 -0700
i386: Replace assembly versions of e_logf with generic e_logf.c
This patch replaces i386 assembly versions of e_logf with generic
e_logf.c.
* sysdeps/i386/fpu/e_logf.S: Removed.
* sysdeps/i386/fpu/e_logf_data.c: Likewise.
* sysdeps/i386/fpu/w_logf.c: Likewise.
* sysdeps/i386/i686/fpu/e_logf.S: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_logf.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_logf-sse2.
(CFLAGS-e_logf-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_logf-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_logf.c: Likewise.
diff --git a/sysdeps/i386/fpu/e_logf.S b/sysdeps/i386/fpu/e_logf.S
deleted file mode 100644
index de967a3..0000000
--- a/sysdeps/i386/fpu/e_logf.S
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- * Adapted for float by Ulrich Drepper <drepper@cygnus.com>.
- *
- * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>.
- */
-
-#include <machine/asm.h>
-
- .section .rodata.cst8,"aM",@progbits,8
-
- .p2align 3
- .type one,@object
-one: .double 1.0
- ASM_SIZE_DIRECTIVE(one)
- /* It is not important that this constant is precise. It is only
- a value which is known to be on the safe side for using the
- fyl2xp1 instruction. */
- .type limit,@object
-limit: .double 0.29
- ASM_SIZE_DIRECTIVE(limit)
-
-
-#ifdef PIC
-# define MO(op) op##@GOTOFF(%edx)
-#else
-# define MO(op) op
-#endif
-
- .text
-ENTRY(__ieee754_logf)
- fldln2 // log(2)
- flds 4(%esp) // x : log(2)
- fxam
- fnstsw
-#ifdef PIC
- LOAD_PIC_REG (dx)
-#endif
- fld %st // x : x : log(2)
- sahf
- jc 3f // in case x is NaN or +-Inf
-4: fsubl MO(one) // x-1 : x : log(2)
- fld %st // x-1 : x-1 : x : log(2)
- fabs // |x-1| : x-1 : x : log(2)
- fcompl MO(limit) // x-1 : x : log(2)
- fnstsw // x-1 : x : log(2)
- andb $0x45, %ah
- jz 2f
- fxam
- fnstsw
- andb $0x45, %ah
- cmpb $0x40, %ah
- jne 5f
- fabs // log(1) is +0 in all rounding modes.
-5: fstp %st(1) // x-1 : log(2)
- fyl2xp1 // log(x)
- ret
-
-2: fstp %st(0) // x : log(2)
- fyl2x // log(x)
- ret
-
-3: jp 4b // in case x is +-Inf
- fstp %st(1)
- fstp %st(1)
- ret
-END (__ieee754_logf)
-
-ENTRY(__logf_finite)
- fldln2 // log(2)
- flds 4(%esp) // x : log(2)
-#ifdef PIC
- LOAD_PIC_REG (dx)
-#endif
- fld %st // x : x : log(2)
- fsubl MO(one) // x-1 : x : log(2)
- fld %st // x-1 : x-1 : x : log(2)
- fabs // |x-1| : x-1 : x : log(2)
- fcompl MO(limit) // x-1 : x : log(2)
- fnstsw // x-1 : x : log(2)
- andb $0x45, %ah
- jz 2b
- fxam
- fnstsw
- andb $0x45, %ah
- cmpb $0x40, %ah
- jne 6f
- fabs // log(1) is +0 in all rounding modes.
-6: fstp %st(1) // x-1 : log(2)
- fyl2xp1 // log(x)
- ret
-END(__logf_finite)
diff --git a/sysdeps/i386/fpu/e_logf_data.c b/sysdeps/i386/fpu/e_logf_data.c
deleted file mode 100644
index 1cc8931..0000000
--- a/sysdeps/i386/fpu/e_logf_data.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
index 5a319f1..698d1b3 100644
--- a/sysdeps/i386/fpu/libm-test-ulps
+++ b/sysdeps/i386/fpu/libm-test-ulps
@@ -2000,17 +2000,17 @@ ldouble: 4
Function: "gamma_downward":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
+ifloat: 5
ildouble: 7
ldouble: 7
Function: "gamma_towardzero":
double: 4
-float: 2
+float: 3
idouble: 4
-ifloat: 2
+ifloat: 3
ildouble: 7
ldouble: 7
@@ -2186,20 +2186,20 @@ ldouble: 4
Function: "lgamma_downward":
double: 4
-float: 4
+float: 5
float128: 8
idouble: 4
-ifloat: 4
+ifloat: 5
ifloat128: 8
ildouble: 7
ldouble: 7
Function: "lgamma_towardzero":
double: 4
-float: 2
+float: 3
float128: 5
idouble: 4
-ifloat: 2
+ifloat: 3
ifloat128: 5
ildouble: 7
ldouble: 7
@@ -2641,10 +2641,10 @@ ldouble: 5
Function: "y0_towardzero":
double: 2
-float: 2
+float: 3
float128: 3
idouble: 2
-ifloat: 2
+ifloat: 3
ifloat128: 3
ildouble: 5
ldouble: 5
diff --git a/sysdeps/i386/fpu/w_logf.c b/sysdeps/i386/fpu/w_logf.c
deleted file mode 100644
index ea48d13..0000000
--- a/sysdeps/i386/fpu/w_logf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/../math/w_logf.c>
diff --git a/sysdeps/i386/i686/fpu/e_logf.S b/sysdeps/i386/i686/fpu/e_logf.S
deleted file mode 100644
index 6fd39d5..0000000
--- a/sysdeps/i386/i686/fpu/e_logf.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- * Adapted for float by Ulrich Drepper <drepper@cygnus.com>.
- *
- * Adapted for i686 instructions.
- */
-
-#include <machine/asm.h>
-
-
- .text
-ENTRY(__ieee754_logf)
- fldln2 // log(2)
- flds 4(%esp) // x : log(2)
- fucomi %st
- jp 3f
- fyl2x // log(x)
- ret
-
-3: fstp %st(1)
- ret
-END (__ieee754_logf)
-
-ENTRY(__logf_finite)
- fldln2 // log(2)
- flds 4(%esp) // x : log(2)
- fyl2x // log(x)
- ret
-END(__logf_finite)
diff --git a/sysdeps/i386/i686/fpu/multiarch/Makefile b/sysdeps/i386/i686/fpu/multiarch/Makefile
index 2723f57..ee4c3f3 100644
--- a/sysdeps/i386/i686/fpu/multiarch/Makefile
+++ b/sysdeps/i386/i686/fpu/multiarch/Makefile
@@ -1,7 +1,8 @@
ifeq ($(subdir),math)
-libm-sysdep_routines += e_exp2f-sse2 e_expf-sse2 s_sinf-sse2 s_cosf-sse2 \
- s_sincosf-sse2
+libm-sysdep_routines += e_exp2f-sse2 e_expf-sse2 e_logf-sse2 \
+ s_sinf-sse2 s_cosf-sse2 s_sincosf-sse2
CFLAGS-e_exp2f-sse2.c = -msse2 -mfpmath=sse
CFLAGS-e_expf-sse2.c = -msse2 -mfpmath=sse
+CFLAGS-e_logf-sse2.c = -msse2 -mfpmath=sse
endif
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_logf-sse2.c b/sysdeps/i386/i686/fpu/multiarch/e_logf-sse2.c
new file mode 100644
index 0000000..11621fc
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_logf-sse2.c
@@ -0,0 +1,3 @@
+#define __logf __logf_sse2
+
+#include <sysdeps/ieee754/flt-32/e_logf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_logf.c b/sysdeps/i386/i686/fpu/multiarch/e_logf.c
new file mode 100644
index 0000000..1414d17
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_logf.c
@@ -0,0 +1,40 @@
+/* Multiple versions of logf.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+extern float __redirect_logf (float);
+
+#define SYMBOL_NAME logf
+#include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_logf, __logf, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (__logf_ia32, __GI___logf, __redirect_logf)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __logf, logf, GLIBC_2_27);
+#else
+weak_alias (__logf, logf)
+#endif
+
+strong_alias (__logf, __ieee754_logf)
+strong_alias (__logf, __logf_finite)
+
+#define __logf __logf_ia32
+#include <sysdeps/ieee754/flt-32/e_logf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
index 2d056a9..c86294b 100644
--- a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
+++ b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
@@ -2000,9 +2000,9 @@ ldouble: 4
Function: "gamma_downward":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
+ifloat: 5
ildouble: 7
ldouble: 7
@@ -2186,10 +2186,10 @@ ldouble: 4
Function: "lgamma_downward":
double: 4
-float: 4
+float: 5
float128: 8
idouble: 4
-ifloat: 4
+ifloat: 5
ifloat128: 8
ildouble: 7
ldouble: 7
@@ -2625,10 +2625,10 @@ ldouble: 5
Function: "y0_towardzero":
double: 2
-float: 2
+float: 3
float128: 3
idouble: 2
-ifloat: 2
+ifloat: 3
ifloat128: 3
ildouble: 5
ldouble: 5
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bd50819a820dcd1f26542693cb7f19f73d4f61bb
commit bd50819a820dcd1f26542693cb7f19f73d4f61bb
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Sep 25 16:21:05 2017 -0700
i386: Replace assembly versions of e_exp2f with generic e_exp2f.c
This patch replaces i386 assembly versions of e_exp2f with generic
e_exp2f.c.
* sysdeps/i386/fpu/e_exp2f.S: Removed.
* sysdeps/i386/fpu/w_exp2f.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_exp2f.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_exp2f-sse2.
(CFLAGS-e_exp2f-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_exp2f-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_exp2f.c: Likewise.
diff --git a/sysdeps/i386/fpu/e_exp2f.S b/sysdeps/i386/fpu/e_exp2f.S
deleted file mode 100644
index 30623cd..0000000
--- a/sysdeps/i386/fpu/e_exp2f.S
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Adapted for exp2 by Ulrich Drepper <drepper@cygnus.com>.
- * Public domain.
- */
-
-#include <machine/asm.h>
-#include <i386-math-asm.h>
-
-DEFINE_FLT_MIN
-
-#ifdef PIC
-# define MO(op) op##@GOTOFF(%ecx)
-#else
-# define MO(op) op
-#endif
-
- .text
-ENTRY(__ieee754_exp2f)
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
- flds 4(%esp)
-/* I added the following ugly construct because exp(+-Inf) resulted
- in NaN. The ugliness results from the bright minds at Intel.
- For the i686 the code can be written better.
- -- drepper@cygnus.com. */
- fxam /* Is NaN or +-Inf? */
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 1f /* Is +-Inf, jump. */
- fld %st
- frndint /* int(x) */
- fsubr %st,%st(1) /* fract(x) */
- fxch
- f2xm1 /* 2^(fract(x)) - 1 */
- fld1
- faddp /* 2^(fract(x)) */
- fscale /* e^x */
- fstp %st(1)
- FLT_NARROW_EVAL_UFLOW_NONNEG_NAN
- ret
-
-1: testl $0x200, %eax /* Test sign. */
- jz 2f /* If positive, jump. */
- fstp %st
- fldz /* Set result to 0. */
-2: ret
-END (__ieee754_exp2f)
-strong_alias (__ieee754_exp2f, __exp2f_finite)
diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
index 60a721c..5a319f1 100644
--- a/sysdeps/i386/fpu/libm-test-ulps
+++ b/sysdeps/i386/fpu/libm-test-ulps
@@ -1921,7 +1921,9 @@ ildouble: 1
ldouble: 1
Function: "exp2_upward":
+float: 1
float128: 2
+ifloat: 1
ifloat128: 2
ildouble: 1
ldouble: 1
diff --git a/sysdeps/i386/fpu/w_exp2f.c b/sysdeps/i386/fpu/w_exp2f.c
deleted file mode 100644
index 583065d..0000000
--- a/sysdeps/i386/fpu/w_exp2f.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/../math/w_exp2f.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/Makefile b/sysdeps/i386/i686/fpu/multiarch/Makefile
index c5e8cfd..2723f57 100644
--- a/sysdeps/i386/i686/fpu/multiarch/Makefile
+++ b/sysdeps/i386/i686/fpu/multiarch/Makefile
@@ -1,6 +1,7 @@
ifeq ($(subdir),math)
-libm-sysdep_routines += e_expf-sse2 s_sinf-sse2 s_cosf-sse2 \
+libm-sysdep_routines += e_exp2f-sse2 e_expf-sse2 s_sinf-sse2 s_cosf-sse2 \
s_sincosf-sse2
+CFLAGS-e_exp2f-sse2.c = -msse2 -mfpmath=sse
CFLAGS-e_expf-sse2.c = -msse2 -mfpmath=sse
endif
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_exp2f-sse2.c b/sysdeps/i386/i686/fpu/multiarch/e_exp2f-sse2.c
new file mode 100644
index 0000000..dc3138d
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_exp2f-sse2.c
@@ -0,0 +1,3 @@
+#define __exp2f __exp2f_sse2
+
+#include <sysdeps/ieee754/flt-32/e_exp2f.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_exp2f.c b/sysdeps/i386/i686/fpu/multiarch/e_exp2f.c
new file mode 100644
index 0000000..0a5727f
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_exp2f.c
@@ -0,0 +1,37 @@
+/* Multiple versions of exp2f.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+extern float __redirect_exp2f (float);
+
+#define SYMBOL_NAME exp2f
+#include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_exp2f, __exp2f, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+# include <shlib-compat.h>
+versioned_symbol (libm, __exp2f, exp2f, GLIBC_2_27);
+#else
+weak_alias (__exp2f, exp2f)
+#endif
+
+strong_alias (__exp2f, __ieee754_exp2f)
+strong_alias (__exp2f, __exp2f_finite)
+
+#define __exp2f __exp2f_ia32
+#include <sysdeps/ieee754/flt-32/e_exp2f.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
index 5ff641f..2d056a9 100644
--- a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
+++ b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
@@ -1921,7 +1921,9 @@ ildouble: 1
ldouble: 1
Function: "exp2_upward":
+float: 1
float128: 2
+ifloat: 1
ifloat128: 2
ildouble: 1
ldouble: 1
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7ce4fe4773264dfd1ceddc5c0cf7e0935ca622af
commit 7ce4fe4773264dfd1ceddc5c0cf7e0935ca622af
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Sep 25 15:56:19 2017 -0700
x86-64: Add exp2f with FMA
* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_exp2f-fma.
(CFLAGS-e_exp2f-fma.c): New.
* sysdeps/x86_64/fpu/multiarch/e_exp2f-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/e_exp2f.c: Likewise.
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 92e91d7..71a3b33 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -37,8 +37,9 @@ CFLAGS-slowpow-fma.c = -mfma -mavx2
CFLAGS-s_sin-fma.c = -mfma -mavx2
CFLAGS-s_tan-fma.c = -mfma -mavx2
-libm-sysdep_routines += e_expf-fma
+libm-sysdep_routines += e_exp2f-fma e_expf-fma
+CFLAGS-e_exp2f-fma.c = -mfma -mavx2
CFLAGS-e_expf-fma.c = -mfma -mavx2
libm-sysdep_routines += e_exp-fma4 e_log-fma4 e_pow-fma4 s_atan-fma4 \
diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp2f-fma.c b/sysdeps/x86_64/fpu/multiarch/e_exp2f-fma.c
new file mode 100644
index 0000000..c915a50
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_exp2f-fma.c
@@ -0,0 +1,3 @@
+#define __exp2f __exp2f_fma
+
+#include <sysdeps/ieee754/flt-32/e_exp2f.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp2f.c b/sysdeps/x86_64/fpu/multiarch/e_exp2f.c
new file mode 100644
index 0000000..13cfcf9
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_exp2f.c
@@ -0,0 +1,37 @@
+/* Multiple versions of exp2f.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+extern float __redirect_exp2f (float);
+
+#define SYMBOL_NAME exp2f
+#include "ifunc-fma.h"
+
+libc_ifunc_redirected (__redirect_exp2f, __exp2f, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+# include <shlib-compat.h>
+versioned_symbol (libm, __exp2f, exp2f, GLIBC_2_27);
+#else
+weak_alias (__exp2f, exp2f)
+#endif
+
+strong_alias (__exp2f, __ieee754_exp2f)
+strong_alias (__exp2f, __exp2f_finite)
+
+#define __exp2f __exp2f_sse2
+#include <sysdeps/ieee754/flt-32/e_exp2f.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6dd68130b4370072ec83467e1e81e56693b4ffdb
commit 6dd68130b4370072ec83467e1e81e56693b4ffdb
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sun Sep 24 16:01:10 2017 -0700
i386: Replace assembly versions of e_expf with generic e_expf.c
This patch replaces i386 assembly versions of e_expf with generic
e_expf.c.
* sysdeps/i386/fpu/e_exp2f_data.c: Removed.
* sysdeps/i386/fpu/e_expf.S: Likewise.
* sysdeps/i386/fpu/math_errf.c: Likewise.
* sysdeps/i386/fpu/w_expf.c: Likewise.
* sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S: Likewise.
* sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S: Likewise.
* sysdeps/i386/i686/fpu/multiarch/w_expf.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_expf.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Remove e_expf-ia32.
(CFLAGS-e_expf-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_expf.c: Rewritten.
diff --git a/sysdeps/i386/fpu/e_exp2f_data.c b/sysdeps/i386/fpu/e_exp2f_data.c
deleted file mode 100644
index 1cc8931..0000000
--- a/sysdeps/i386/fpu/e_exp2f_data.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/sysdeps/i386/fpu/e_expf.S b/sysdeps/i386/fpu/e_expf.S
deleted file mode 100644
index 65cb4ec..0000000
--- a/sysdeps/i386/fpu/e_expf.S
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- * Adapted for float type by Ulrich Drepper <drepper@cygnus.com>.
- */
-
-#include <machine/asm.h>
-#include <i386-math-asm.h>
-
-DEFINE_FLT_MIN
-
-#ifdef PIC
-# define MO(op) op##@GOTOFF(%ecx)
-#else
-# define MO(op) op
-#endif
-
- .text
-/* e^x = 2^(x * log2(e)) */
-ENTRY(__ieee754_expf)
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
- flds 4(%esp)
-/* I added the following ugly construct because exp(+-Inf) resulted
- in NaN. The ugliness results from the bright minds at Intel.
- For the i686 the code can be written better.
- -- drepper@cygnus.com. */
- fxam /* Is NaN or +-Inf? */
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 1f /* Is +-Inf, jump. */
- fldl2e
- fmulp /* x * log2(e) */
- fld %st
- frndint /* int(x * log2(e)) */
- fsubr %st,%st(1) /* fract(x * log2(e)) */
- fxch
- f2xm1 /* 2^(fract(x * log2(e))) - 1 */
- fld1
- faddp /* 2^(fract(x * log2(e))) */
- fscale /* e^x */
- fstp %st(1)
- FLT_NARROW_EVAL_UFLOW_NONNEG_NAN
- ret
-
-1: testl $0x200, %eax /* Test sign. */
- jz 2f /* If positive, jump. */
- fstp %st
- fldz /* Set result to 0. */
-2: ret
-END (__ieee754_expf)
-
-
-ENTRY(__expf_finite)
-#ifdef PIC
- LOAD_PIC_REG (cx)
-#endif
- fldl2e
- fmuls 4(%esp) /* x * log2(e) */
- fld %st
- frndint /* int(x * log2(e)) */
- fsubr %st,%st(1) /* fract(x * log2(e)) */
- fxch
- f2xm1 /* 2^(fract(x * log2(e))) - 1 */
- fld1
- faddp /* 2^(fract(x * log2(e))) */
- fscale /* e^x */
- fstp %st(1)
- FLT_NARROW_EVAL_UFLOW_NONNEG
- ret
-END(__expf_finite)
diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
index 68017a5..60a721c 100644
--- a/sysdeps/i386/fpu/libm-test-ulps
+++ b/sysdeps/i386/fpu/libm-test-ulps
@@ -1928,19 +1928,25 @@ ldouble: 1
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 2
ldouble: 2
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
diff --git a/sysdeps/i386/fpu/math_errf.c b/sysdeps/i386/fpu/math_errf.c
deleted file mode 100644
index 1cc8931..0000000
--- a/sysdeps/i386/fpu/math_errf.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Not needed. */
diff --git a/sysdeps/i386/fpu/w_expf.c b/sysdeps/i386/fpu/w_expf.c
deleted file mode 100644
index b5fe164..0000000
--- a/sysdeps/i386/fpu/w_expf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/../math/w_expf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/Makefile b/sysdeps/i386/i686/fpu/multiarch/Makefile
index 7d90892..c5e8cfd 100644
--- a/sysdeps/i386/i686/fpu/multiarch/Makefile
+++ b/sysdeps/i386/i686/fpu/multiarch/Makefile
@@ -1,4 +1,6 @@
ifeq ($(subdir),math)
-libm-sysdep_routines += e_expf-sse2 e_expf-ia32 s_sinf-sse2 s_cosf-sse2 \
+libm-sysdep_routines += e_expf-sse2 s_sinf-sse2 s_cosf-sse2 \
s_sincosf-sse2
+
+CFLAGS-e_expf-sse2.c = -msse2 -mfpmath=sse
endif
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S b/sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S
deleted file mode 100644
index b486b4d..0000000
--- a/sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- Copyright (C) 2012-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#define __ieee754_expf __ieee754_expf_ia32
-#define __expf_finite __expf_finite_ia32
-
-#include <sysdeps/i386/fpu/e_expf.S>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S b/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S
deleted file mode 100644
index e6bb6fa..0000000
--- a/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S
+++ /dev/null
@@ -1,325 +0,0 @@
-/* SSE2 version of __ieee754_expf and __expf_finite
- Copyright (C) 2012-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-
-#include <sysdep.h>
-
-/* Short algorithm description:
- *
- * Let K = 64 (table size).
- * e^x = 2^(x/log(2)) = 2^n * T[j] * (1 + P(y))
- * where
- * x = m*log(2)/K + y, y in [0.0..log(2)/K]
- * m = n*K + j, m,n,j - signed integer, j in [0..K-1]
- * values of 2^(j/K) are tabulated as T[j].
- *
- * P(y) is a minimax polynomial approximation of expf(x)-1
- * on small interval [0.0..log(2)/K].
- *
- * P(y) = P3*y*y*y*y + P2*y*y*y + P1*y*y + P0*y, calculated as
- * z = y*y; P(y) = (P3*z + P1)*z + (P2*z + P0)*y
- *
- * Special cases:
- * __ieee754_expf_sse2(NaN) = NaN
- * __ieee754_expf_sse2(+INF) = +INF
- * __ieee754_expf_sse2(-INF) = 0
- * __ieee754_expf_sse2(x) = 1 for subnormals
- * for finite argument, only __ieee754_expf_sse2(0)=1 is exact
- * __ieee754_expf_sse2(x) overflows if x>700
- * __ieee754_expf_sse2(x) underflows if x<-700
- *
- * Note:
- * For |x|<700, __ieee754_expf_sse2 computes result in double precision,
- * with accuracy a bit more than needed for expf, and does not round it
- * to single precision.
- */
-
-
-#ifdef PIC
-# define MO1(symbol) L(symbol)##@GOTOFF(%edx)
-# define MO2(symbol,reg2,_scale) L(symbol)##@GOTOFF(%edx,reg2,_scale)
-#else
-# define MO1(symbol) L(symbol)
-# define MO2(symbol,reg2,_scale) L(symbol)(,reg2,_scale)
-#endif
-
- .text
-ENTRY(__ieee754_expf_sse2)
- /* Input: single precision x on stack at address 4(%esp) */
-
-#ifdef PIC
- LOAD_PIC_REG(dx)
-#endif
-
- cvtss2sd 4(%esp), %xmm1 /* Convert x to double precision */
- mov 4(%esp), %ecx /* Copy x */
- movsd MO1(DP_KLN2), %xmm2 /* DP K/log(2) */
- movsd MO1(DP_P2), %xmm3 /* DP P2 */
- movl %ecx, %eax /* x */
- mulsd %xmm1, %xmm2 /* DP x*K/log(2) */
- andl $0x7fffffff, %ecx /* |x| */
- cmpl $0x442f0000, %ecx /* |x|<700 ? */
- movsd MO1(DP_P3), %xmm4 /* DP P3 */
- addsd MO1(DP_RS), %xmm2 /* DP x*K/log(2)+RS */
- jae L(special_paths)
-
- /* Here if |x|<700 */
- cmpl $0x31800000, %ecx /* |x|<2^(-28) ? */
- jb L(small_arg)
-
- /* Main path: here if 2^(-28)<=|x|<700 */
- cvtsd2ss %xmm2, %xmm2 /* SP x*K/log(2)+RS */
- movd %xmm2, %eax /* bits of n*K+j with trash */
- subss MO1(SP_RS), %xmm2 /* SP t=round(x*K/log(2)) */
- movl %eax, %ecx /* n*K+j with trash */
- cvtss2sd %xmm2, %xmm2 /* DP t */
- andl $0x3f, %eax /* bits of j */
- mulsd MO1(DP_NLN2K), %xmm2 /* DP -t*log(2)/K */
- andl $0xffffffc0, %ecx /* bits of n */
-#ifdef __AVX__
- vaddsd %xmm1, %xmm2, %xmm0 /* DP y=x-t*log(2)/K */
- vmulsd %xmm0, %xmm0, %xmm2 /* DP z=y*y */
-#else
- addsd %xmm1, %xmm2 /* DP y=x-t*log(2)/K */
- movaps %xmm2, %xmm0 /* DP y */
- mulsd %xmm2, %xmm2 /* DP z=y*y */
-#endif
- mulsd %xmm2, %xmm4 /* DP P3*z */
- addl $0xffc0, %ecx /* bits of n + DP exponent bias */
- mulsd %xmm2, %xmm3 /* DP P2*z */
- shrl $2, %ecx /* High 2 bytes of DP 2^n */
- pxor %xmm1, %xmm1 /* clear %xmm1 */
- addsd MO1(DP_P1), %xmm4 /* DP P3*z+P1 */
- addsd MO1(DP_P0), %xmm3 /* DP P2*z+P0 */
- pinsrw $3, %ecx, %xmm1 /* DP 2^n */
- mulsd %xmm2, %xmm4 /* DP (P3*z+P1)*z */
- mulsd %xmm3, %xmm0 /* DP (P2*z+P0)*y */
- addsd %xmm4, %xmm0 /* DP P(y) */
- mulsd MO2(DP_T,%eax,8), %xmm0 /* DP P(y)*T[j] */
- addsd MO2(DP_T,%eax,8), %xmm0 /* DP T[j]*(P(y)+1) */
- mulsd %xmm1, %xmm0 /* DP result=2^n*(T[j]*(P(y)+1)) */
- cvtsd2ss %xmm0, %xmm1
-
- lea -4(%esp), %esp /* Borrow 4 bytes of stack frame */
- movss %xmm1, 0(%esp) /* Move result from sse... */
- flds 0(%esp) /* ...to FPU. */
- lea 4(%esp), %esp /* Return back 4 bytes of stack frame */
- ret
-
- .p2align 4
-L(small_arg):
- /* Here if 0<=|x|<2^(-28) */
- movss 4(%esp), %xmm0 /* load x */
- addss MO1(SP_ONE), %xmm0 /* 1.0 + x */
- /* Return 1.0 with inexact raised, except for x==0 */
- jmp L(epilogue)
-
- .p2align 4
-L(special_paths):
- /* Here if x is NaN, or Inf, or finite |x|>=700 */
- movss 4(%esp), %xmm0 /* load x */
-
- cmpl $0x7f800000, %ecx /* |x| is finite ? */
- jae L(arg_inf_or_nan)
-
- /* Here if finite |x|>=700 */
- testl $0x80000000, %eax /* sign of x nonzero ? */
- je L(res_overflow)
-
- /* Here if finite x<=-700 */
- movss MO1(SP_SMALL), %xmm0 /* load small value 2^(-100) */
- mulss %xmm0, %xmm0 /* Return underflowed result (zero or subnormal) */
- jmp L(epilogue)
-
- .p2align 4
-L(res_overflow):
- /* Here if finite x>=700 */
- movss MO1(SP_LARGE), %xmm0 /* load large value 2^100 */
- mulss %xmm0, %xmm0 /* Return overflowed result (Inf or max normal) */
- jmp L(epilogue)
-
- .p2align 4
-L(arg_inf_or_nan):
- /* Here if |x| is Inf or NAN */
- jne L(arg_nan) /* |x| is Inf ? */
-
- /* Here if |x| is Inf */
- shrl $31, %eax /* Get sign bit of x */
- movss MO2(SP_INF_0,%eax,4), %xmm0/* return zero or Inf, depending on sign of x */
- jmp L(epilogue)
-
- .p2align 4
-L(arg_nan):
- /* Here if |x| is NaN */
- addss %xmm0, %xmm0 /* Return x+x (raise invalid) */
-
- .p2align 4
-L(epilogue):
- lea -4(%esp), %esp /* Borrow 4 bytes of stack frame */
- movss %xmm0, 0(%esp) /* Move result from sse... */
- flds 0(%esp) /* ...to FPU. */
- lea 4(%esp), %esp /* Return back 4 bytes of stack frame */
- ret
-END(__ieee754_expf_sse2)
-
- .section .rodata, "a"
- .p2align 3
-L(DP_T): /* table of double precision values 2^(j/K) for j=[0..K-1] */
- .long 0x00000000, 0x3ff00000
- .long 0x3e778061, 0x3ff02c9a
- .long 0xd3158574, 0x3ff059b0
- .long 0x18759bc8, 0x3ff08745
- .long 0x6cf9890f, 0x3ff0b558
- .long 0x32d3d1a2, 0x3ff0e3ec
- .long 0xd0125b51, 0x3ff11301
- .long 0xaea92de0, 0x3ff1429a
- .long 0x3c7d517b, 0x3ff172b8
- .long 0xeb6fcb75, 0x3ff1a35b
- .long 0x3168b9aa, 0x3ff1d487
- .long 0x88628cd6, 0x3ff2063b
- .long 0x6e756238, 0x3ff2387a
- .long 0x65e27cdd, 0x3ff26b45
- .long 0xf51fdee1, 0x3ff29e9d
- .long 0xa6e4030b, 0x3ff2d285
- .long 0x0a31b715, 0x3ff306fe
- .long 0xb26416ff, 0x3ff33c08
- .long 0x373aa9cb, 0x3ff371a7
- .long 0x34e59ff7, 0x3ff3a7db
- .long 0x4c123422, 0x3ff3dea6
- .long 0x21f72e2a, 0x3ff4160a
- .long 0x6061892d, 0x3ff44e08
- .long 0xb5c13cd0, 0x3ff486a2
- .long 0xd5362a27, 0x3ff4bfda
- .long 0x769d2ca7, 0x3ff4f9b2
- .long 0x569d4f82, 0x3ff5342b
- .long 0x36b527da, 0x3ff56f47
- .long 0xdd485429, 0x3ff5ab07
- .long 0x15ad2148, 0x3ff5e76f
- .long 0xb03a5585, 0x3ff6247e
- .long 0x82552225, 0x3ff66238
- .long 0x667f3bcd, 0x3ff6a09e
- .long 0x3c651a2f, 0x3ff6dfb2
- .long 0xe8ec5f74, 0x3ff71f75
- .long 0x564267c9, 0x3ff75feb
- .long 0x73eb0187, 0x3ff7a114
- .long 0x36cf4e62, 0x3ff7e2f3
- .long 0x994cce13, 0x3ff82589
- .long 0x9b4492ed, 0x3ff868d9
- .long 0x422aa0db, 0x3ff8ace5
- .long 0x99157736, 0x3ff8f1ae
- .long 0xb0cdc5e5, 0x3ff93737
- .long 0x9fde4e50, 0x3ff97d82
- .long 0x82a3f090, 0x3ff9c491
- .long 0x7b5de565, 0x3ffa0c66
- .long 0xb23e255d, 0x3ffa5503
- .long 0x5579fdbf, 0x3ffa9e6b
- .long 0x995ad3ad, 0x3ffae89f
- .long 0xb84f15fb, 0x3ffb33a2
- .long 0xf2fb5e47, 0x3ffb7f76
- .long 0x904bc1d2, 0x3ffbcc1e
- .long 0xdd85529c, 0x3ffc199b
- .long 0x2e57d14b, 0x3ffc67f1
- .long 0xdcef9069, 0x3ffcb720
- .long 0x4a07897c, 0x3ffd072d
- .long 0xdcfba487, 0x3ffd5818
- .long 0x03db3285, 0x3ffda9e6
- .long 0x337b9b5f, 0x3ffdfc97
- .long 0xe78b3ff6, 0x3ffe502e
- .long 0xa2a490da, 0x3ffea4af
- .long 0xee615a27, 0x3ffefa1b
- .long 0x5b6e4540, 0x3fff5076
- .long 0x819e90d8, 0x3fffa7c1
- .type L(DP_T), @object
- ASM_SIZE_DIRECTIVE(L(DP_T))
-
- .section .rodata.cst8,"aM",@progbits,8
- .p2align 3
-L(DP_KLN2): /* double precision K/log(2) */
- .long 0x652b82fe, 0x40571547
- .type L(DP_KLN2), @object
- ASM_SIZE_DIRECTIVE(L(DP_KLN2))
-
- .p2align 3
-L(DP_NLN2K): /* double precision -log(2)/K */
- .long 0xfefa39ef, 0xbf862e42
- .type L(DP_NLN2K), @object
- ASM_SIZE_DIRECTIVE(L(DP_NLN2K))
-
- .p2align 3
-L(DP_RS): /* double precision 2^23+2^22 */
- .long 0x00000000, 0x41680000
- .type L(DP_RS), @object
- ASM_SIZE_DIRECTIVE(L(DP_RS))
-
- .p2align 3
-L(DP_P3): /* double precision polynomial coefficient P3 */
- .long 0xeb78fa85, 0x3fa56420
- .type L(DP_P3), @object
- ASM_SIZE_DIRECTIVE(L(DP_P3))
-
- .p2align 3
-L(DP_P1): /* double precision polynomial coefficient P1 */
- .long 0x008d6118, 0x3fe00000
- .type L(DP_P1), @object
- ASM_SIZE_DIRECTIVE(L(DP_P1))
-
- .p2align 3
-L(DP_P2): /* double precision polynomial coefficient P2 */
- .long 0xda752d4f, 0x3fc55550
- .type L(DP_P2), @object
- ASM_SIZE_DIRECTIVE(L(DP_P2))
-
- .p2align 3
-L(DP_P0): /* double precision polynomial coefficient P0 */
- .long 0xffffe7c6, 0x3fefffff
- .type L(DP_P0), @object
- ASM_SIZE_DIRECTIVE(L(DP_P0))
-
- .p2align 2
-L(SP_INF_0):
- .long 0x7f800000 /* single precision Inf */
- .long 0 /* single precision zero */
- .type L(SP_INF_0), @object
- ASM_SIZE_DIRECTIVE(L(SP_INF_0))
-
- .section .rodata.cst4,"aM",@progbits,4
- .p2align 2
-L(SP_RS): /* single precision 2^23+2^22 */
- .long 0x4b400000
- .type L(SP_RS), @object
- ASM_SIZE_DIRECTIVE(L(SP_RS))
-
- .p2align 2
-L(SP_SMALL): /* single precision small value 2^(-100) */
- .long 0x0d800000
- .type L(SP_SMALL), @object
- ASM_SIZE_DIRECTIVE(L(SP_SMALL))
-
- .p2align 2
-L(SP_LARGE): /* single precision large value 2^100 */
- .long 0x71800000
- .type L(SP_LARGE), @object
- ASM_SIZE_DIRECTIVE(L(SP_LARGE))
-
- .p2align 2
-L(SP_ONE): /* single precision 1.0 */
- .long 0x3f800000
- .type L(SP_ONE), @object
- ASM_SIZE_DIRECTIVE(L(SP_ONE))
-
-strong_alias (__ieee754_expf_sse2, __expf_finite_sse2)
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.c b/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.c
new file mode 100644
index 0000000..7c758e6
--- /dev/null
+++ b/sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.c
@@ -0,0 +1,3 @@
+#define __expf __expf_sse2
+
+#include <sysdeps/ieee754/flt-32/e_expf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/e_expf.c b/sysdeps/i386/i686/fpu/multiarch/e_expf.c
index 388cf98..bd4240e 100644
--- a/sysdeps/i386/i686/fpu/multiarch/e_expf.c
+++ b/sysdeps/i386/i686/fpu/multiarch/e_expf.c
@@ -1,4 +1,4 @@
-/* Multiple versions of expf
+/* Multiple versions of expf.
Copyright (C) 2012-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,22 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <init-arch.h>
+extern float __redirect_expf (float);
-extern double __ieee754_expf_sse2 (double);
-extern double __ieee754_expf_ia32 (double);
+#define SYMBOL_NAME expf
+#include "ifunc-sse2.h"
-double __ieee754_expf (double);
-libm_ifunc (__ieee754_expf,
- HAS_CPU_FEATURE (SSE2)
- ? __ieee754_expf_sse2
- : __ieee754_expf_ia32);
+libc_ifunc_redirected (__redirect_expf, __expf, IFUNC_SELECTOR ());
-extern double __expf_finite_sse2 (double);
-extern double __expf_finite_ia32 (double);
+#ifdef SHARED
+__hidden_ver1 (__expf_ia32, __GI___expf, __redirect_expf)
+ __attribute__ ((visibility ("hidden")));
-double __expf_finite (double);
-libm_ifunc (__expf_finite,
- HAS_CPU_FEATURE (SSE2)
- ? __expf_finite_sse2
- : __expf_finite_ia32);
+# include <shlib-compat.h>
+versioned_symbol (libm, __expf, expf, GLIBC_2_27);
+#else
+weak_alias (__expf, expf)
+#endif
+
+strong_alias (__expf, __ieee754_expf)
+strong_alias (__expf, __expf_finite)
+
+#define __expf __expf_ia32
+#include <sysdeps/ieee754/flt-32/e_expf.c>
diff --git a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
index d81c28b..5ff641f 100644
--- a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
+++ b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
@@ -1928,13 +1928,17 @@ ldouble: 1
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 2
ldouble: 2
diff --git a/sysdeps/i386/i686/fpu/multiarch/w_expf.c b/sysdeps/i386/i686/fpu/multiarch/w_expf.c
deleted file mode 100644
index b5fe164..0000000
--- a/sysdeps/i386/i686/fpu/multiarch/w_expf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/../math/w_expf.c>
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=28a8cb063d9777cbd4809716c6fdbfa57b96f235
commit 28a8cb063d9777cbd4809716c6fdbfa57b96f235
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Sep 23 15:48:26 2017 -0700
x86-64: Replace assembly versions of e_expf with generic e_expf.c
This patch replaces x86-64 assembly versions of e_expf with generic
e_expf.c.
* sysdeps/x86_64/fpu/e_expf.S: Removed.
* sysdeps/x86_64/fpu/multiarch/e_expf-fma.S: Likewise.
* sysdeps/x86_64/fpu/w_expf.c: Likewise.
* sysdeps/x86_64/fpu/libm-test-ulps: Updated for generic
e_expf.c.
* sysdeps/x86_64/fpu/multiarch/Makefile (CFLAGS-e_expf-fma.c):
New.
* sysdeps/x86_64/fpu/multiarch/e_expf-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/e_expf.c (__redirect_ieee754_expf):
Renamed to ...
(__redirect_expf): This.
(SYMBOL_NAME): Changed to expf.
(__ieee754_expf): Renamed to ...
(__expf): This.
(__GI___expf): This.
(__ieee754_expf): Add strong_alias.
(__expf_finite): Likewise.
(__expf): New.
Include <sysdeps/ieee754/flt-32/e_expf.c>.
diff --git a/sysdeps/x86_64/fpu/e_expf.S b/sysdeps/x86_64/fpu/e_expf.S
deleted file mode 100644
index c3bf312..0000000
--- a/sysdeps/x86_64/fpu/e_expf.S
+++ /dev/null
@@ -1,339 +0,0 @@
-/* Optimized __ieee754_expf function.
- Copyright (C) 2012-2017 Free Software Foundation, Inc.
- Contributed by Intel Corporation.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-
-/* Short algorithm description:
- *
- * Let K = 64 (table size).
- * e^x = 2^(x/log(2)) = 2^n * T[j] * (1 + P(y))
- * where
- * x = m*log(2)/K + y, y in [0.0..log(2)/K]
- * m = n*K + j, m,n,j - signed integer, j in [0..K-1]
- * values of 2^(j/K) are tabulated as T[j].
- *
- * P(y) is a minimax polynomial approximation of expf(x)-1
- * on small interval [0.0..log(2)/K].
- *
- * P(y) = P3*y*y*y*y + P2*y*y*y + P1*y*y + P0*y, calculated as
- * z = y*y; P(y) = (P3*z + P1)*z + (P2*z + P0)*y
- *
- * Special cases:
- * expf(NaN) = NaN
- * expf(+INF) = +INF
- * expf(-INF) = 0
- * expf(x) = 1 for subnormals
- * for finite argument, only expf(0)=1 is exact
- * expf(x) overflows if x>88.7228317260742190
- * expf(x) underflows if x<-103.972076416015620
- */
-
- .text
-ENTRY(__ieee754_expf)
- /* Input: single precision x in %xmm0 */
- cvtss2sd %xmm0, %xmm1 /* Convert x to double precision */
- movd %xmm0, %ecx /* Copy x */
- movsd L(DP_KLN2)(%rip), %xmm2 /* DP K/log(2) */
- movsd L(DP_P2)(%rip), %xmm3 /* DP P2 */
- movl %ecx, %eax /* x */
- mulsd %xmm1, %xmm2 /* DP x*K/log(2) */
- andl $0x7fffffff, %ecx /* |x| */
- lea L(DP_T)(%rip), %rsi /* address of table T[j] */
- cmpl $0x42ad496b, %ecx /* |x|<125*log(2) ? */
- movsd L(DP_P3)(%rip), %xmm4 /* DP P3 */
- addsd L(DP_RS)(%rip), %xmm2 /* DP x*K/log(2)+RS */
- jae L(special_paths)
-
- /* Here if |x|<125*log(2) */
- cmpl $0x31800000, %ecx /* |x|<2^(-28) ? */
- jb L(small_arg)
-
- /* Main path: here if 2^(-28)<=|x|<125*log(2) */
- cvtsd2ss %xmm2, %xmm2 /* SP x*K/log(2)+RS */
- movd %xmm2, %eax /* bits of n*K+j with trash */
- subss L(SP_RS)(%rip), %xmm2 /* SP t=round(x*K/log(2)) */
- movl %eax, %edx /* n*K+j with trash */
- cvtss2sd %xmm2, %xmm2 /* DP t */
- andl $0x3f, %eax /* bits of j */
- mulsd L(DP_NLN2K)(%rip), %xmm2/* DP -t*log(2)/K */
- andl $0xffffffc0, %edx /* bits of n */
-#ifdef __AVX__
- vaddsd %xmm1, %xmm2, %xmm0 /* DP y=x-t*log(2)/K */
- vmulsd %xmm0, %xmm0, %xmm2 /* DP z=y*y */
-#else
- addsd %xmm1, %xmm2 /* DP y=x-t*log(2)/K */
- movaps %xmm2, %xmm0 /* DP y */
- mulsd %xmm2, %xmm2 /* DP z=y*y */
-#endif
- mulsd %xmm2, %xmm4 /* DP P3*z */
- addl $0x1fc0, %edx /* bits of n + SP exponent bias */
- mulsd %xmm2, %xmm3 /* DP P2*z */
- shll $17, %edx /* SP 2^n */
- addsd L(DP_P1)(%rip), %xmm4 /* DP P3*z+P1 */
- addsd L(DP_P0)(%rip), %xmm3 /* DP P2*z+P0 */
- movd %edx, %xmm1 /* SP 2^n */
- mulsd %xmm2, %xmm4 /* DP (P3*z+P1)*z */
- mulsd %xmm3, %xmm0 /* DP (P2*z+P0)*y */
- addsd %xmm4, %xmm0 /* DP P(y) */
- mulsd (%rsi,%rax,8), %xmm0 /* DP P(y)*T[j] */
- addsd (%rsi,%rax,8), %xmm0 /* DP T[j]*(P(y)+1) */
- cvtsd2ss %xmm0, %xmm0 /* SP T[j]*(P(y)+1) */
- mulss %xmm1, %xmm0 /* SP result=2^n*(T[j]*(P(y)+1)) */
- ret
-
- .p2align 4
-L(small_arg):
- /* Here if 0<=|x|<2^(-28) */
- addss L(SP_ONE)(%rip), %xmm0 /* 1.0 + x */
- /* Return 1.0 with inexact raised, except for x==0 */
- ret
-
- .p2align 4
-L(special_paths):
- /* Here if 125*log(2)<=|x| */
- shrl $31, %eax /* Get sign bit of x, and depending on it: */
- lea L(SP_RANGE)(%rip), %rdx /* load over/underflow bound */
- cmpl (%rdx,%rax,4), %ecx /* |x|<under/overflow bound ? */
- jbe L(near_under_or_overflow)
-
- /* Here if |x|>under/overflow bound */
- cmpl $0x7f800000, %ecx /* |x| is finite ? */
- jae L(arg_inf_or_nan)
-
- /* Here if |x|>under/overflow bound, and x is finite */
- testq %rax, %rax /* sign of x nonzero ? */
- je L(res_overflow)
-
- /* Here if -inf<x<underflow bound (x<0) */
- movss L(SP_SMALL)(%rip), %xmm0/* load small value 2^(-100) */
- mulss %xmm0, %xmm0 /* Return underflowed result (zero or subnormal) */
- ret
-
- .p2align 4
-L(res_overflow):
- /* Here if overflow bound<x<inf (x>0) */
- movss L(SP_LARGE)(%rip), %xmm0/* load large value 2^100 */
- mulss %xmm0, %xmm0 /* Return overflowed result (Inf or max normal) */
- ret
-
- .p2align 4
-L(arg_inf_or_nan):
- /* Here if |x| is Inf or NAN */
- jne L(arg_nan) /* |x| is Inf ? */
-
- /* Here if |x| is Inf */
- lea L(SP_INF_0)(%rip), %rdx /* depending on sign of x: */
- movss (%rdx,%rax,4), %xmm0 /* return zero or Inf */
- ret
-
- .p2align 4
-L(arg_nan):
- /* Here if |x| is NaN */
- addss %xmm0, %xmm0 /* Return x+x (raise invalid) */
- ret
-
- .p2align 4
-L(near_under_or_overflow):
- /* Here if 125*log(2)<=|x|<under/overflow bound */
- cvtsd2ss %xmm2, %xmm2 /* SP x*K/log(2)+RS */
- movd %xmm2, %eax /* bits of n*K+j with trash */
- subss L(SP_RS)(%rip), %xmm2 /* SP t=round(x*K/log(2)) */
- movl %eax, %edx /* n*K+j with trash */
- cvtss2sd %xmm2, %xmm2 /* DP t */
- andl $0x3f, %eax /* bits of j */
- mulsd L(DP_NLN2K)(%rip), %xmm2/* DP -t*log(2)/K */
- andl $0xffffffc0, %edx /* bits of n */
-#ifdef __AVX__
- vaddsd %xmm1, %xmm2, %xmm0 /* DP y=x-t*log(2)/K */
- vmulsd %xmm0, %xmm0, %xmm2 /* DP z=y*y */
-#else
- addsd %xmm1, %xmm2 /* DP y=x-t*log(2)/K */
- movaps %xmm2, %xmm0 /* DP y */
- mulsd %xmm2, %xmm2 /* DP z=y*y */
-#endif
- mulsd %xmm2, %xmm4 /* DP P3*z */
- addl $0xffc0, %edx /* bits of n + DP exponent bias */
- mulsd %xmm2, %xmm3 /* DP P2*z */
- shlq $46, %rdx /* DP 2^n */
- addsd L(DP_P1)(%rip), %xmm4 /* DP P3*z+P1 */
- addsd L(DP_P0)(%rip), %xmm3 /* DP P2*z+P0 */
- movd %rdx, %xmm1 /* DP 2^n */
- mulsd %xmm2, %xmm4 /* DP (P3*z+P1)*z */
- mulsd %xmm3, %xmm0 /* DP (P2*z+P0)*y */
- addsd %xmm4, %xmm0 /* DP P(y) */
- mulsd (%rsi,%rax,8), %xmm0 /* DP P(y)*T[j] */
- addsd (%rsi,%rax,8), %xmm0 /* DP T[j]*(P(y)+1) */
- mulsd %xmm1, %xmm0 /* DP result=2^n*(T[j]*(P(y)+1)) */
- cvtsd2ss %xmm0, %xmm0 /* convert result to single precision */
- ret
-END(__ieee754_expf)
-
- .section .rodata, "a"
- .p2align 3
-L(DP_T): /* table of double precision values 2^(j/K) for j=[0..K-1] */
- .long 0x00000000, 0x3ff00000
- .long 0x3e778061, 0x3ff02c9a
- .long 0xd3158574, 0x3ff059b0
- .long 0x18759bc8, 0x3ff08745
- .long 0x6cf9890f, 0x3ff0b558
- .long 0x32d3d1a2, 0x3ff0e3ec
- .long 0xd0125b51, 0x3ff11301
- .long 0xaea92de0, 0x3ff1429a
- .long 0x3c7d517b, 0x3ff172b8
- .long 0xeb6fcb75, 0x3ff1a35b
- .long 0x3168b9aa, 0x3ff1d487
- .long 0x88628cd6, 0x3ff2063b
- .long 0x6e756238, 0x3ff2387a
- .long 0x65e27cdd, 0x3ff26b45
- .long 0xf51fdee1, 0x3ff29e9d
- .long 0xa6e4030b, 0x3ff2d285
- .long 0x0a31b715, 0x3ff306fe
- .long 0xb26416ff, 0x3ff33c08
- .long 0x373aa9cb, 0x3ff371a7
- .long 0x34e59ff7, 0x3ff3a7db
- .long 0x4c123422, 0x3ff3dea6
- .long 0x21f72e2a, 0x3ff4160a
- .long 0x6061892d, 0x3ff44e08
- .long 0xb5c13cd0, 0x3ff486a2
- .long 0xd5362a27, 0x3ff4bfda
- .long 0x769d2ca7, 0x3ff4f9b2
- .long 0x569d4f82, 0x3ff5342b
- .long 0x36b527da, 0x3ff56f47
- .long 0xdd485429, 0x3ff5ab07
- .long 0x15ad2148, 0x3ff5e76f
- .long 0xb03a5585, 0x3ff6247e
- .long 0x82552225, 0x3ff66238
- .long 0x667f3bcd, 0x3ff6a09e
- .long 0x3c651a2f, 0x3ff6dfb2
- .long 0xe8ec5f74, 0x3ff71f75
- .long 0x564267c9, 0x3ff75feb
- .long 0x73eb0187, 0x3ff7a114
- .long 0x36cf4e62, 0x3ff7e2f3
- .long 0x994cce13, 0x3ff82589
- .long 0x9b4492ed, 0x3ff868d9
- .long 0x422aa0db, 0x3ff8ace5
- .long 0x99157736, 0x3ff8f1ae
- .long 0xb0cdc5e5, 0x3ff93737
- .long 0x9fde4e50, 0x3ff97d82
- .long 0x82a3f090, 0x3ff9c491
- .long 0x7b5de565, 0x3ffa0c66
- .long 0xb23e255d, 0x3ffa5503
- .long 0x5579fdbf, 0x3ffa9e6b
- .long 0x995ad3ad, 0x3ffae89f
- .long 0xb84f15fb, 0x3ffb33a2
- .long 0xf2fb5e47, 0x3ffb7f76
- .long 0x904bc1d2, 0x3ffbcc1e
- .long 0xdd85529c, 0x3ffc199b
- .long 0x2e57d14b, 0x3ffc67f1
- .long 0xdcef9069, 0x3ffcb720
- .long 0x4a07897c, 0x3ffd072d
- .long 0xdcfba487, 0x3ffd5818
- .long 0x03db3285, 0x3ffda9e6
- .long 0x337b9b5f, 0x3ffdfc97
- .long 0xe78b3ff6, 0x3ffe502e
- .long 0xa2a490da, 0x3ffea4af
- .long 0xee615a27, 0x3ffefa1b
- .long 0x5b6e4540, 0x3fff5076
- .long 0x819e90d8, 0x3fffa7c1
- .type L(DP_T), @object
- ASM_SIZE_DIRECTIVE(L(DP_T))
-
- .section .rodata.cst8,"aM",@progbits,8
- .p2align 3
-L(DP_KLN2): /* double precision K/log(2) */
- .long 0x652b82fe, 0x40571547
- .type L(DP_KLN2), @object
- ASM_SIZE_DIRECTIVE(L(DP_KLN2))
-
- .p2align 3
-L(DP_NLN2K): /* double precision -log(2)/K */
- .long 0xfefa39ef, 0xbf862e42
- .type L(DP_NLN2K), @object
- ASM_SIZE_DIRECTIVE(L(DP_NLN2K))
-
- .p2align 3
-L(DP_RS): /* double precision 2^23+2^22 */
- .long 0x00000000, 0x41680000
- .type L(DP_RS), @object
- ASM_SIZE_DIRECTIVE(L(DP_RS))
-
- .p2align 3
-L(DP_P3): /* double precision polynomial coefficient P3 */
- .long 0xeb78fa85, 0x3fa56420
- .type L(DP_P3), @object
- ASM_SIZE_DIRECTIVE(L(DP_P3))
-
- .p2align 3
-L(DP_P1): /* double precision polynomial coefficient P1 */
- .long 0x008d6118, 0x3fe00000
- .type L(DP_P1), @object
- ASM_SIZE_DIRECTIVE(L(DP_P1))
-
- .p2align 3
-L(DP_P2): /* double precision polynomial coefficient P2 */
- .long 0xda752d4f, 0x3fc55550
- .type L(DP_P2), @object
- ASM_SIZE_DIRECTIVE(L(DP_P2))
-
- .p2align 3
-L(DP_P0): /* double precision polynomial coefficient P0 */
- .long 0xffffe7c6, 0x3fefffff
- .type L(DP_P0), @object
- ASM_SIZE_DIRECTIVE(L(DP_P0))
-
- .p2align 3
-L(SP_RANGE): /* single precision overflow/underflow bounds */
- .long 0x42b17217 /* if x>this bound, then result overflows */
- .long 0x42cff1b4 /* if x<this bound, then result underflows */
- .type L(SP_RANGE), @object
- ASM_SIZE_DIRECTIVE(L(SP_RANGE))
-
- .p2align 3
-L(SP_INF_0):
- .long 0x7f800000 /* single precision Inf */
- .long 0 /* single precision zero */
- .type L(SP_INF_0), @object
- ASM_SIZE_DIRECTIVE(L(SP_INF_0))
-
- .section .rodata.cst4,"aM",@progbits,4
- .p2align 2
-L(SP_RS): /* single precision 2^23+2^22 */
- .long 0x4b400000
- .type L(SP_RS), @object
- ASM_SIZE_DIRECTIVE(L(SP_RS))
-
- .p2align 2
-L(SP_SMALL): /* single precision small value 2^(-100) */
- .long 0x0d800000
- .type L(SP_SMALL), @object
- ASM_SIZE_DIRECTIVE(L(SP_SMALL))
-
- .p2align 2
-L(SP_LARGE): /* single precision large value 2^100 */
- .long 0x71800000
- .type L(SP_LARGE), @object
- ASM_SIZE_DIRECTIVE(L(SP_LARGE))
-
- .p2align 2
-L(SP_ONE): /* single precision 1.0 */
- .long 0x3f800000
- .type L(SP_ONE), @object
- ASM_SIZE_DIRECTIVE(L(SP_ONE))
-
-strong_alias (__ieee754_expf, __expf_finite)
diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps
index 5156adb..85552bd 100644
--- a/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/sysdeps/x86_64/fpu/libm-test-ulps
@@ -1987,13 +1987,17 @@ ldouble: 1
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 2
ldouble: 2
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index d660552..92e91d7 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -37,9 +37,10 @@ CFLAGS-slowpow-fma.c = -mfma -mavx2
CFLAGS-s_sin-fma.c = -mfma -mavx2
CFLAGS-s_tan-fma.c = -mfma -mavx2
-# e_expf-fma.S implements both FMA and SSE2 versions of e_expf.
libm-sysdep_routines += e_expf-fma
+CFLAGS-e_expf-fma.c = -mfma -mavx2
+
libm-sysdep_routines += e_exp-fma4 e_log-fma4 e_pow-fma4 s_atan-fma4 \
e_asin-fma4 e_atan2-fma4 s_sin-fma4 s_tan-fma4 \
mplog-fma4 mpa-fma4 slowexp-fma4 slowpow-fma4 \
diff --git a/sysdeps/x86_64/fpu/multiarch/e_expf-fma.S b/sysdeps/x86_64/fpu/multiarch/e_expf-fma.S
deleted file mode 100644
index 43140de..0000000
--- a/sysdeps/x86_64/fpu/multiarch/e_expf-fma.S
+++ /dev/null
@@ -1,182 +0,0 @@
-/* FMA/AVX2 version of IEEE 754 expf.
- Copyright (C) 2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-
-/* Short algorithm description:
-
- Let K = 64 (table size).
- e^x = 2^(x/log(2)) = 2^n * T[j] * (1 + P(y))
- where
- x = m*log(2)/K + y, y in [0.0..log(2)/K]
- m = n*K + j, m,n,j - signed integer, j in [0..K-1]
- values of 2^(j/K) are tabulated as T[j].
-
- P(y) is a minimax polynomial approximation of expf(x)-1
- on small interval [0.0..log(2)/K].
-
- P(y) = P3*y*y*y*y + P2*y*y*y + P1*y*y + P0*y, calculated as
- z = y*y; P(y) = (P3*z + P1)*z + (P2*z + P0)*y
-
- Special cases:
- expf(NaN) = NaN
- expf(+INF) = +INF
- expf(-INF) = 0
- expf(x) = 1 for subnormals
- for finite argument, only expf(0)=1 is exact
- expf(x) overflows if x>88.7228317260742190
- expf(x) underflows if x<-103.972076416015620
- */
-
- .section .text.fma,"ax",@progbits
-ENTRY(__ieee754_expf_fma)
- /* Input: single precision x in %xmm0 */
- vcvtss2sd %xmm0, %xmm0, %xmm1 /* Convert x to double precision */
- vmovd %xmm0, %ecx /* Copy x */
- vmovsd L(DP_KLN2)(%rip), %xmm2 /* DP K/log(2) */
- vfmadd213sd L(DP_RD)(%rip), %xmm1, %xmm2 /* DP x*K/log(2)+RD */
- vmovsd L(DP_P2)(%rip), %xmm3 /* DP P2 */
- movl %ecx, %eax /* x */
- andl $0x7fffffff, %ecx /* |x| */
- lea L(DP_T)(%rip), %rsi /* address of table T[j] */
- vmovsd L(DP_P3)(%rip), %xmm4 /* DP P3 */
-
- cmpl $0x42ad496b, %ecx /* |x|<125*log(2) ? */
- jae L(special_paths_fma)
-
- /* Here if |x|<125*log(2) */
- cmpl $0x31800000, %ecx /* |x|<2^(-28) ? */
- jb L(small_arg_fma)
-
- /* Main path: here if 2^(-28)<=|x|<125*log(2) */
- /* %xmm2 = SP x*K/log(2)+RS */
- vmovd %xmm2, %eax
- vsubsd L(DP_RD)(%rip), %xmm2, %xmm2 /* DP t=round(x*K/log(2)) */
- movl %eax, %edx /* n*K+j with trash */
- andl $0x3f, %eax /* bits of j */
- vmovsd (%rsi,%rax,8), %xmm5 /* T[j] */
- andl $0xffffffc0, %edx /* bits of n */
-
- vfmadd132sd L(DP_NLN2K)(%rip), %xmm1, %xmm2 /* DP y=x-t*log(2)/K */
- vmulsd %xmm2, %xmm2, %xmm6 /* DP z=y*y */
-
-
- vfmadd213sd L(DP_P1)(%rip), %xmm6, %xmm4 /* DP P3*z + P1 */
- vfmadd213sd L(DP_P0)(%rip), %xmm6, %xmm3 /* DP P2*z+P0 */
-
- addl $0x1fc0, %edx /* bits of n + SP exponent bias */
- shll $17, %edx /* SP 2^n */
- vmovd %edx, %xmm1 /* SP 2^n */
-
- vmulsd %xmm6, %xmm4, %xmm4 /* DP (P3*z+P1)*z */
-
- vfmadd213sd %xmm4, %xmm3, %xmm2 /* DP P(Y) (P2*z+P0)*y */
- vfmadd213sd %xmm5, %xmm5, %xmm2 /* DP T[j]*(P(y)+1) */
- vcvtsd2ss %xmm2, %xmm2, %xmm0 /* SP T[j]*(P(y)+1) */
- vmulss %xmm1, %xmm0, %xmm0 /* SP result=2^n*(T[j]*(P(y)+1)) */
- ret
-
- .p2align 4
-L(small_arg_fma):
- /* Here if 0<=|x|<2^(-28) */
- vaddss L(SP_ONE)(%rip), %xmm0, %xmm0 /* 1.0 + x */
- /* Return 1.0 with inexact raised, except for x==0 */
- ret
-
- .p2align 4
-L(special_paths_fma):
- /* Here if 125*log(2)<=|x| */
- shrl $31, %eax /* Get sign bit of x, and depending on it: */
- lea L(SP_RANGE)(%rip), %rdx /* load over/underflow bound */
- cmpl (%rdx,%rax,4), %ecx /* |x|<under/overflow bound ? */
- jbe L(near_under_or_overflow_fma)
-
- /* Here if |x|>under/overflow bound */
- cmpl $0x7f800000, %ecx /* |x| is finite ? */
- jae L(arg_inf_or_nan_fma)
-
- /* Here if |x|>under/overflow bound, and x is finite */
- testl %eax, %eax /* sign of x nonzero ? */
- je L(res_overflow_fma)
-
- /* Here if -inf<x<underflow bound (x<0) */
- vmovss L(SP_SMALL)(%rip), %xmm0/* load small value 2^(-100) */
- vmulss %xmm0, %xmm0, %xmm0 /* Return underflowed result (zero or subnormal) */
- ret
-
- .p2align 4
-L(res_overflow_fma):
- /* Here if overflow bound<x<inf (x>0) */
- vmovss L(SP_LARGE)(%rip), %xmm0/* load large value 2^100 */
- vmulss %xmm0, %xmm0, %xmm0 /* Return overflowed result (Inf or max normal) */
- ret
-
- .p2align 4
-L(arg_inf_or_nan_fma):
- /* Here if |x| is Inf or NAN */
- jne L(arg_nan_fma) /* |x| is Inf ? */
-
- /* Here if |x| is Inf */
- lea L(SP_INF_0)(%rip), %rdx /* depending on sign of x: */
- vmovss (%rdx,%rax,4), %xmm0 /* return zero or Inf */
- ret
-
- .p2align 4
-L(arg_nan_fma):
- /* Here if |x| is NaN */
- vaddss %xmm0, %xmm0, %xmm0 /* Return x+x (raise invalid) */
- ret
-
- .p2align 4
-L(near_under_or_overflow_fma):
- /* Here if 125*log(2)<=|x|<under/overflow bound */
- vmovd %xmm2, %eax /* bits of n*K+j with trash */
- vsubsd L(DP_RD)(%rip), %xmm2, %xmm2 /* DP t=round(x*K/log(2)) */
- movl %eax, %edx /* n*K+j with trash */
- andl $0x3f, %eax /* bits of j */
- vmulsd L(DP_NLN2K)(%rip),%xmm2, %xmm2/* DP -t*log(2)/K */
- andl $0xffffffc0, %edx /* bits of n */
- vaddsd %xmm1, %xmm2, %xmm0 /* DP y=x-t*log(2)/K */
- vmulsd %xmm0, %xmm0, %xmm2 /* DP z=y*y */
- addl $0xffc0, %edx /* bits of n + DP exponent bias */
- vfmadd213sd L(DP_P0)(%rip), %xmm2, %xmm3/* DP P2*z+P0 */
- shlq $46, %rdx /* DP 2^n */
- vfmadd213sd L(DP_P1)(%rip), %xmm2, %xmm4/* DP P3*z+P1 */
- vmovq %rdx, %xmm1 /* DP 2^n */
- vmulsd %xmm2, %xmm4, %xmm4 /* DP (P3*z+P1)*z */
- vfmadd213sd %xmm4, %xmm3, %xmm0 /* DP (P2*z+P0)*y */
- vmovsd (%rsi,%rax,8), %xmm2
- vfmadd213sd %xmm2, %xmm2, %xmm0 /* DP T[j]*(P(y)+1) */
- vmulsd %xmm1, %xmm0, %xmm0 /* DP result=2^n*(T[j]*(P(y)+1)) */
- vcvtsd2ss %xmm0, %xmm0, %xmm0 /* convert result to single precision */
- ret
-END(__ieee754_expf_fma)
-
- .section .rodata.cst8,"aM",@progbits,8
- .p2align 3
-L(DP_RD): /* double precision 2^52+2^51 */
- .long 0x00000000, 0x43380000
- .type L(DP_RD), @object
- ASM_SIZE_DIRECTIVE(L(DP_RD))
-
-#define __ieee754_expf __ieee754_expf_sse2
-
-#undef strong_alias
-#define strong_alias(ignored1, ignored2)
-
-#include <sysdeps/x86_64/fpu/e_expf.S>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_expf-fma.c b/sysdeps/x86_64/fpu/multiarch/e_expf-fma.c
new file mode 100644
index 0000000..4e01cd6
--- /dev/null
+++ b/sysdeps/x86_64/fpu/multiarch/e_expf-fma.c
@@ -0,0 +1,3 @@
+#define __expf __expf_fma
+
+#include <sysdeps/ieee754/flt-32/e_expf.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/e_expf.c b/sysdeps/x86_64/fpu/multiarch/e_expf.c
index 0962098..18451a0 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_expf.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_expf.c
@@ -1,4 +1,4 @@
-/* Multiple versions of IEEE 754 expf.
+/* Multiple versions of expf.
Copyright (C) 2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,11 +16,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-extern float __redirect_ieee754_expf (float);
+extern float __redirect_expf (float);
-#define SYMBOL_NAME ieee754_expf
+#define SYMBOL_NAME expf
#include "ifunc-fma.h"
-libc_ifunc_redirected (__redirect_ieee754_expf, __ieee754_expf,
- IFUNC_SELECTOR ());
-strong_alias (__ieee754_expf, __expf_finite)
+libc_ifunc_redirected (__redirect_expf, __expf, IFUNC_SELECTOR ());
+
+#ifdef SHARED
+__hidden_ver1 (__expf, __GI___expf, __redirect_expf)
+ __attribute__ ((visibility ("hidden")));
+
+# include <shlib-compat.h>
+versioned_symbol (libm, __expf, expf, GLIBC_2_27);
+#else
+weak_alias (__expf, expf)
+#endif
+
+strong_alias (__expf, __ieee754_expf)
+strong_alias (__expf, __expf_finite)
+
+#define __expf __expf_sse2
+#include <sysdeps/ieee754/flt-32/e_expf.c>
diff --git a/sysdeps/x86_64/fpu/w_expf.c b/sysdeps/x86_64/fpu/w_expf.c
deleted file mode 100644
index b5fe164..0000000
--- a/sysdeps/x86_64/fpu/w_expf.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/../math/w_expf.c>
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources