glibc/sysdeps
Wilco Dijkstra c3d466cba1 Remove slow paths from pow
Remove the slow paths from pow.  Like several other double precision math
functions, pow is exactly rounded.  This is not required from math functions
and causes major overheads as it requires multiple fallbacks using higher
precision arithmetic if a result is close to 0.5ULP.  Ridiculous slowdowns
of up to 100000x have been reported when the highest precision path triggers.

All GLIBC math tests pass on AArch64 and x64 (with ULP of pow set to 1).
The worst case error is ~0.506ULP.  A simple test over a few hundred million
values shows pow is 10% faster on average.  This fixes BZ #13932.

	[BZ #13932]
	* sysdeps/ieee754/dbl-64/uexp.h (err_1): Remove.
	* benchtests/pow-inputs: Update comment for slow path cases.
	* manual/probes.texi (slowpow_p10): Delete removed probe.
	(slowpow_p10): Likewise.
	* math/Makefile: Remove halfulp.c and slowpow.c.
	* sysdeps/aarch64/libm-test-ulps: Set ULP of pow to 1.
	* sysdeps/generic/math_private.h (__exp1): Remove error argument.
	(__halfulp): Remove.
	(__slowpow): Remove.
	* sysdeps/i386/fpu/halfulp.c: Delete file.
	* sysdeps/i386/fpu/slowpow.c: Likewise.
	* sysdeps/ia64/fpu/halfulp.c: Likewise.
	* sysdeps/ia64/fpu/slowpow.c: Likewise.
	* sysdeps/ieee754/dbl-64/e_exp.c (__exp1): Remove error argument,
	improve comments and add error analysis.
	* sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Add error analysis.
	(power1): Remove function:
	(log1): Remove error argument, add error analysis.
	(my_log2): Remove function.
	* sysdeps/ieee754/dbl-64/halfulp.c: Delete file.
	* sysdeps/ieee754/dbl-64/slowpow.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/halfulp.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/slowpow.c: Likewise.
	* sysdeps/powerpc/power4/fpu/Makefile: Remove CPPFLAGS-slowpow.c.
	* sysdeps/x86_64/fpu/libm-test-ulps: Set ULP of pow to 1.
	* sysdeps/x86_64/fpu/multiarch/Makefile: Remove slowpow-fma.c,
	slowpow-fma4.c, halfulp-fma.c, halfulp-fma4.c.
	* sysdeps/x86_64/fpu/multiarch/e_pow-fma.c (__slowpow): Remove define.
	* sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c (__slowpow): Likewise.
	* sysdeps/x86_64/fpu/multiarch/halfulp-fma.c: Delete file.
	* sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/slowpow-fma.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c: Likewise.
2018-02-12 10:47:09 +00:00
..
aarch64 Remove slow paths from pow 2018-02-12 10:47:09 +00:00
alpha Update Alpha libm-test-ulps 2018-01-27 13:31:38 +01:00
arm Move LDBL_CLASSIFY_COMPAT to its own header. 2018-02-01 21:01:00 +00:00
generic Remove slow paths from pow 2018-02-12 10:47:09 +00:00
gnu Add TCP_FASTOPEN_KEY, TCP_FASTOPEN_NO_COOKIE from Linux 4.15. 2018-02-06 00:42:22 +00:00
hppa Update hppa libm-test-ulps 2018-01-27 13:32:36 +01:00
i386 Remove slow paths from pow 2018-02-12 10:47:09 +00:00
ia64 Remove slow paths from pow 2018-02-12 10:47:09 +00:00
ieee754 Remove slow paths from pow 2018-02-12 10:47:09 +00:00
init_array sysdeps/init_array: Add PREINIT_FUNCTION to crti.S 2018-01-29 10:22:26 -08:00
m68k Remove slow paths from pow 2018-02-12 10:47:09 +00:00
mach Add narrowing add functions. 2018-02-10 02:08:43 +00:00
microblaze Move LDBL_CLASSIFY_COMPAT to its own header. 2018-02-01 21:01:00 +00:00
mips Move LDBL_CLASSIFY_COMPAT to its own header. 2018-02-01 21:01:00 +00:00
nios2 Move LDBL_CLASSIFY_COMPAT to its own header. 2018-02-01 21:01:00 +00:00
nptl Revert Intel CET changes to __jmp_buf_tag (Bug 22743) 2018-01-25 23:43:46 -08:00
posix preadv2/pwritev2: Handle offset == -1 [BZ #22753] 2018-02-02 10:46:26 +01:00
powerpc Remove slow paths from pow 2018-02-12 10:47:09 +00:00
pthread allocalim.h: use __glibc_likely instead of __builtin_expect 2018-01-30 21:42:21 +01:00
riscv RISC-V: Build Infastructure 2018-01-29 10:43:15 -08:00
s390 Unify and simplify bits/byteswap.h, bits/byteswap-16.h headers (bug 14508, bug 15512, bug 17082, bug 20530). 2018-02-06 21:55:08 +00:00
sh Move LDBL_CLASSIFY_COMPAT to its own header. 2018-02-01 21:01:00 +00:00
sparc sparc: Check PIC instead of SHARED in start.S [BZ #22638] 2018-02-05 05:46:56 -08:00
tile Unify and simplify bits/byteswap.h, bits/byteswap-16.h headers (bug 14508, bug 15512, bug 17082, bug 20530). 2018-02-06 21:55:08 +00:00
unix linux/aarch64: sync sys/ptrace.h with Linux 4.15 [BZ #22433] 2018-02-10 22:12:12 +00:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
x86 Unify and simplify bits/byteswap.h, bits/byteswap-16.h headers (bug 14508, bug 15512, bug 17082, bug 20530). 2018-02-06 21:55:08 +00:00
x86_64 Remove slow paths from pow 2018-02-12 10:47:09 +00:00