summaryrefslogtreecommitdiff
path: root/sysdeps/arm/get-rounding-mode.h
diff options
context:
space:
mode:
authorWilco <wdijkstr@arm.com>2014-05-15 15:18:40 +0100
committerMarcus Shawcroft <marcus.shawcroft@arm.com>2014-05-15 15:23:27 +0100
commit1a2f40e5d14ed6450696feacf04fca5eeceae7ef (patch)
treef08d34c9426d8833b6daef1509a1ac431e0b3c0b /sysdeps/arm/get-rounding-mode.h
parentcf26a0cb6a0bbaca46a01ddad6662e5e5159a32a (diff)
ARM: Improve fenv implementation
Diffstat (limited to 'sysdeps/arm/get-rounding-mode.h')
-rw-r--r--sysdeps/arm/get-rounding-mode.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/sysdeps/arm/get-rounding-mode.h b/sysdeps/arm/get-rounding-mode.h
index 7d6054cd89..a1ecf51a46 100644
--- a/sysdeps/arm/get-rounding-mode.h
+++ b/sysdeps/arm/get-rounding-mode.h
@@ -28,15 +28,15 @@
static inline int
get_rounding_mode (void)
{
- if (ARM_HAVE_VFP)
- {
- fpu_control_t fc;
-
- _FPU_GETCW (fc);
- return fc & FE_TOWARDZERO;
- }
- else
+ fpu_control_t fpscr;
+
+ /* FE_TONEAREST is the only supported rounding mode
+ if a VFP unit isn't present. */
+ if (!ARM_HAVE_VFP)
return FE_TONEAREST;
+
+ _FPU_GETCW (fpscr);
+ return fpscr & FE_TOWARDZERO;
}
#endif /* get-rounding-mode.h */