diff options
author | Wilco <wdijkstr@arm.com> | 2014-05-15 15:18:40 +0100 |
---|---|---|
committer | Marcus Shawcroft <marcus.shawcroft@arm.com> | 2014-05-15 15:23:27 +0100 |
commit | 1a2f40e5d14ed6450696feacf04fca5eeceae7ef (patch) | |
tree | f08d34c9426d8833b6daef1509a1ac431e0b3c0b /sysdeps/arm/feupdateenv.c | |
parent | cf26a0cb6a0bbaca46a01ddad6662e5e5159a32a (diff) | |
download | glibc-1a2f40e5d14ed6450696feacf04fca5eeceae7ef.zip glibc-1a2f40e5d14ed6450696feacf04fca5eeceae7ef.tar.gz glibc-1a2f40e5d14ed6450696feacf04fca5eeceae7ef.tar.bz2 |
ARM: Improve fenv implementation
Diffstat (limited to 'sysdeps/arm/feupdateenv.c')
-rw-r--r-- | sysdeps/arm/feupdateenv.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/sysdeps/arm/feupdateenv.c b/sysdeps/arm/feupdateenv.c index f5deb60..55a1502 100644 --- a/sysdeps/arm/feupdateenv.c +++ b/sysdeps/arm/feupdateenv.c @@ -25,24 +25,19 @@ int feupdateenv (const fenv_t *envp) { - if (ARM_HAVE_VFP) - { - unsigned int temp; + fpu_control_t fpscr; - /* Get the current exception state. */ - _FPU_GETCW (temp); + /* Fail if a VFP unit isn't present. */ + if (!ARM_HAVE_VFP) + return 1; - /* Install new environment. */ - fesetenv (envp); + _FPU_GETCW (fpscr); - /* Raise the saved exceptions. */ - feraiseexcept (temp & FE_ALL_EXCEPT); + /* Install new environment. */ + fesetenv (envp); - /* Success. */ - return 0; - } - - /* Unsupported, so fail. */ - return 1; + /* Raise the saved exceptions. */ + feraiseexcept (fpscr & FE_ALL_EXCEPT); + return 0; } libm_hidden_def (feupdateenv) |