glibc/sysdeps
Wilco Dijkstra ea5c662c62 Improve performance of sincosf
This patch is a complete rewrite of sincosf.  The new version is
significantly faster, as well as simple and accurate.
The worst-case ULP is 0.5607, maximum relative error is 0.5303 * 2^-23 over
all 4 billion inputs.  In non-nearest rounding modes the error is 1ULP.

The algorithm uses 3 main cases: small inputs which don't need argument
reduction, small inputs which need a simple range reduction and large inputs
requiring complex range reduction.  The code uses approximate integer
comparisons to quickly decide between these cases.

The small range reducer uses a single reduction step to handle values up to
120.0.  It is fastest on targets which support inlined round instructions.

The large range reducer uses integer arithmetic for simplicity.  It does a
32x96 bit multiply to compute a 64-bit modulo result.  This is more than
accurate enough to handle the worst-case cancellation for values close to
an integer multiple of PI/4.  It could be further optimized, however it is
already much faster than necessary.

sincosf throughput gains on Cortex-A72:
* |x| < 0x1p-12 : 1.6x
* |x| < M_PI_4  : 1.7x
* |x| < 2 * M_PI: 1.5x
* |x| < 120.0   : 1.8x
* |x| < Inf     : 2.3x

	* math/Makefile: Add s_sincosf_data.c.
	* sysdeps/ia64/fpu/s_sincosf_data.c: New file.
	* sysdeps/ieee754/flt-32/s_sincosf.h (abstop12): Add new function.
	(sincosf_poly): Likewise.
	(reduce_small): Likewise.
	(reduce_large): Likewise.
	* sysdeps/ieee754/flt-32/s_sincosf.c (sincosf): Rewrite.
	* sysdeps/ieee754/flt-32/s_sincosf_data.c: New file with sincosf data.
	* sysdeps/m68k/m680x0/fpu/s_sincosf_data.c: New file.
	* sysdeps/x86_64/fpu/s_sincosf_data.c: New file.
2018-08-10 17:34:39 +01:00
..
aarch64 Clean up converttoint handling and document the semantics 2018-08-10 17:23:16 +01:00
alpha Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
arm Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
generic Replace gen-libm-test.pl with gen-libm-test.py. 2018-08-09 15:34:12 +00:00
gnu hurd: Fix shmid_ds's shm_segsz field type 2018-06-02 21:52:43 +02:00
hppa Move SNAN_TESTS_PRESERVE_PAYLOAD out of math-tests.h. 2018-08-01 11:21:16 +00:00
htl hurd: Avoid PLTs for __pthread_get/setspecific 2018-08-09 01:28:55 +02:00
hurd Fix ISO C threads installed header and HURD assumption 2018-07-25 17:27:45 -03:00
i386 Move __fentry__ version definition to sysdeps/{i386,x86_64} 2018-08-10 09:07:44 +02:00
ia64 Improve performance of sincosf 2018-08-10 17:34:39 +01:00
ieee754 Improve performance of sincosf 2018-08-10 17:34:39 +01:00
init_array sysdeps/init_array: Add PREINIT_FUNCTION to crti.S 2018-01-29 10:22:26 -08:00
m68k Improve performance of sincosf 2018-08-10 17:34:39 +01:00
mach hurd: Fix exec usage of mach_setup_thread 2018-08-01 00:10:03 +02:00
microblaze Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
mips Do not define various fenv.h macros for MIPS soft-float (bug 23479). 2018-08-02 15:53:29 +00:00
nios2 Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
nptl Fix ISO C threads installed header and HURD assumption 2018-07-25 17:27:45 -03:00
posix Fix Linux fcntl OFD locks for non-LFS architectures (BZ#20251) 2018-06-26 13:22:53 -03:00
powerpc Rename the glibc.tune namespace to glibc.cpu 2018-08-02 23:49:19 +05:30
pthread hurd: fix sigevent's sigev_notify_attributes field type 2018-04-19 21:43:44 +02:00
riscv RISC-V: Don't use ps_get_thread_area in libthread_db (bug 23402) 2018-08-06 12:51:59 -07:00
s390 S390: Fix unwind in 32-bit _mcount 2018-08-10 09:07:44 +02:00
sh Update SH libm-tests-ulps 2018-07-31 10:33:53 -03:00
sparc Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
unix Linux: Rewrite __old_getdents64 [BZ #23497] 2018-08-10 10:20:13 +02:00
wordsize-32 Use libc_hidden_* for strtoumax (bug 15105). 2018-02-28 14:16:21 +00:00
wordsize-64 Use libc_hidden_* for strtoumax (bug 15105). 2018-02-28 14:16:21 +00:00
x86 x86: Move STATE_SAVE_OFFSET/STATE_SAVE_MASK to sysdep.h 2018-08-06 06:25:43 -07:00
x86_64 Improve performance of sincosf 2018-08-10 17:34:39 +01:00