diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2014-06-23 17:15:41 +0100 |
---|---|---|
committer | Will Newton <will.newton@linaro.org> | 2014-06-23 17:29:00 +0100 |
commit | e6d90d675d4cae810be76a5ff41b8ae8bd6bc914 (patch) | |
tree | 45d3f98b04e9395347b331c73c64846e823f3c95 /sysdeps/unix | |
parent | 88a4647493fbc2a3f6b1348df010bb0a9c5aed55 (diff) | |
download | glibc-e6d90d675d4cae810be76a5ff41b8ae8bd6bc914.tar.gz glibc-e6d90d675d4cae810be76a5ff41b8ae8bd6bc914.tar.xz glibc-e6d90d675d4cae810be76a5ff41b8ae8bd6bc914.zip |
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.
Diffstat (limited to 'sysdeps/unix')
0 files changed, 0 insertions, 0 deletions