]> git.ipfire.org Git - thirdparty/glibc.git/commit - ChangeLog
Add generic HAVE_RM_CTX implementation
authorWilco Dijkstra <wdijkstr@arm.com>
Mon, 23 Jun 2014 16:15:41 +0000 (17:15 +0100)
committerWill Newton <will.newton@linaro.org>
Mon, 23 Jun 2014 16:29:00 +0000 (17:29 +0100)
commite6d90d675d4cae810be76a5ff41b8ae8bd6bc914
tree45d3f98b04e9395347b331c73c64846e823f3c95
parent88a4647493fbc2a3f6b1348df010bb0a9c5aed55
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.
ChangeLog
sysdeps/generic/math_private.h