glibc/sysdeps
Wilco Dijkstra e6d90d675d Add generic HAVE_RM_CTX implementation
This patch adds a generic implementation of HAVE_RM_CTX using standard
fenv calls. As a result math functions using SET_RESTORE_ROUND* macros
do not suffer from a large slowdown on targets which do not implement
optimized libc_fe*_ctx inline functions. Most of the libc_fe* inline
functions are now unused and could be removed in the future (there are
a few math functions left which use a mixture of standard fenv calls
and libc_fe* inline functions - they could be updated to use
SET_RESTORE_ROUND or improved to avoid expensive fenv manipulations
across just a few FP instructions).

libc_feholdsetround*_noex_ctx is added to enable better optimization of
SET_RESTORE_ROUND_NOEX* implementations.

Performance measurements on ARM and x86 of sin() show significant gains
over the current default, fairly close to a highly optimized fenv_private:

                        ARM   x86
no fenv_private      : 100%  100%
generic HAVE_RM_CTX  : 250%  350%
fenv_private (CTX)   : 250%  450%

2014-06-23  Will Newton  <will.newton@linaro.org>
	    Wilco  <wdijkstr@arm.com>

	* sysdeps/generic/math_private.h: Add generic HAVE_RM_CTX
	implementation.  Include get-rounding-mode.h.
	[!HAVE_RM_CTX]: Define HAVE_RM_CTX to zero.
	[!libc_feholdsetround_noex_ctx]: Define
	libc_feholdsetround_noex_ctx.
	[!libc_feholdsetround_noexf_ctx]: Define
	libc_feholdsetround_noexf_ctx.
	[!libc_feholdsetround_noexl_ctx]: Define
	libc_feholdsetround_noexl_ctx.
	(libc_feholdsetround_ctx): New function.
	(libc_feresetround_ctx): New function.
	(libc_feholdsetround_noex_ctx): New function.
	(libc_feresetround_noex_ctx): New function.
2014-06-23 17:29:00 +01:00
..
aarch64 [AArch64] Add optimized strchr. 2014-06-19 11:03:59 +01:00
alpha Alpha: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:35 -07:00
arm [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
generic Add generic HAVE_RM_CTX implementation 2014-06-23 17:29:00 +01:00
gnu Silence a missing-noreturn warning for _Unwind_Resume. 2014-05-09 10:06:20 -07:00
hppa HPPA: Define TLS_DEFINE_INIT_TP 2014-06-09 14:04:45 -07:00
i386 Clean up stack-coloring macros. 2014-06-20 19:50:16 -07:00
ia64 [BZ #6803] Set errno for scalbln, scalbn 2014-06-20 07:48:20 +05:30
ieee754 [BZ #6803] Set errno for scalbln, scalbn 2014-06-20 07:48:20 +05:30
init_array Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
m68k m68k: Consolidate nptl/ subdirectories under linux/... 2014-06-23 09:24:18 -07:00
mach Remove second argument from TLS_INIT_TP macro 2014-05-27 14:48:46 +02:00
microblaze Remove second argument from TLS_INIT_TP macro 2014-05-27 14:48:46 +02:00
mips MIPS: Move NPTL public headers to sysdeps/mips/nptl/. 2014-06-23 09:25:41 -07:00
nptl Add adaptive elision to rwlocks 2014-06-13 13:15:28 -07:00
posix Return EAI_AGAIN for AF_UNSPEC when herrno is TRY_AGAIN (BZ #16849) 2014-05-15 12:33:11 +05:30
powerpc PowerPC: sync hwcap.h capabilities 2014-06-23 09:40:05 -05:00
pthread Use list.h in posix-timer code. 2014-06-12 14:17:14 -07:00
s390 Use $(rtld-prefix) more consistently. 2014-06-18 10:35:29 +00:00
sh Include <kernel-features.h> explicitly where required. 2014-06-20 23:24:00 +00:00
sparc Missing new file from last commit. 2014-06-20 17:27:16 -07:00
tile Add adaptive elision to rwlocks 2014-06-13 13:15:28 -07:00
unix MIPS: Move NPTL public headers to sysdeps/mips/nptl/. 2014-06-23 09:25:41 -07:00
wordsize-32 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
wordsize-64 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
x86 Use 3 bytes for __pad1 in pthread_rwlock_t for x32 2014-06-19 15:24:33 -07:00
x86_64 Clean up stack-coloring macros. 2014-06-20 19:50:16 -07:00