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/fegetround.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/fegetround.c')
-rw-r--r-- | sysdeps/arm/fegetround.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sysdeps/arm/fegetround.c b/sysdeps/arm/fegetround.c index cb4cf1b..1c9c151 100644 --- a/sysdeps/arm/fegetround.c +++ b/sysdeps/arm/fegetround.c @@ -24,17 +24,14 @@ int fegetround (void) { - if (ARM_HAVE_VFP) - { - unsigned int temp; + fpu_control_t fpscr; - /* Get the current environment. */ - _FPU_GETCW (temp); + /* FE_TONEAREST is the only supported rounding mode + if a VFP unit isn't present. */ + if (!ARM_HAVE_VFP) + return FE_TONEAREST; - return temp & FE_TOWARDZERO; - } - - /* The current soft-float implementation only handles TONEAREST. */ - return FE_TONEAREST; + _FPU_GETCW (fpscr); + return fpscr & FE_TOWARDZERO; } libm_hidden_def (fegetround) |