From 0fe0f1f86f82f9e08ca4d4b85111de03f4c2f876 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sat, 10 Mar 2012 08:53:05 -0800 Subject: Create and use libc_feupdateenv_test. We can reduce the number of STMXCSR, and often we can avoid the call to __feraiseexcept. --- sysdeps/generic/math_private.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'sysdeps/generic/math_private.h') diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h index 0b945f9afc..813ad93611 100644 --- a/sysdeps/generic/math_private.h +++ b/sysdeps/generic/math_private.h @@ -457,6 +457,24 @@ default_libc_feupdateenv (fenv_t *e) # define libc_feupdateenv_53bit libc_feupdateenv #endif +static __always_inline int +default_libc_feupdateenv_test (fenv_t *e, int ex) +{ + int ret = fetestexcept (ex); + feupdateenv (e); + return ret; +} + +#ifndef libc_feupdateenv_test +# define libc_feupdateenv_test default_libc_feupdateenv_test +#endif +#ifndef libc_feupdateenv_testf +# define libc_feupdateenv_testf default_libc_feupdateenv_test +#endif +#ifndef libc_feupdateenv_testl +# define libc_feupdateenv_testl default_libc_feupdateenv_test +#endif + /* Save and set the rounding mode. The use of fenv_t to store the old mode allows a target-specific version of this function to avoid converting the rounding mode from the fpu format. By default we have no choice but to -- cgit 1.4.1