about summary refs log tree commit diff
path: root/sysdeps/arm/fegetexcept.c
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/fegetexcept.c
parentcf26a0cb6a0bbaca46a01ddad6662e5e5159a32a (diff)
downloadglibc-1a2f40e5d14ed6450696feacf04fca5eeceae7ef.tar.gz
glibc-1a2f40e5d14ed6450696feacf04fca5eeceae7ef.tar.xz
glibc-1a2f40e5d14ed6450696feacf04fca5eeceae7ef.zip
ARM: Improve fenv implementation
Diffstat (limited to 'sysdeps/arm/fegetexcept.c')
-rw-r--r--sysdeps/arm/fegetexcept.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sysdeps/arm/fegetexcept.c b/sysdeps/arm/fegetexcept.c
index 5974c63336..aa244d0928 100644
--- a/sysdeps/arm/fegetexcept.c
+++ b/sysdeps/arm/fegetexcept.c
@@ -25,15 +25,13 @@
 int
 fegetexcept (void)
 {
-  if (ARM_HAVE_VFP)
-    {
-      unsigned long temp;
+  fpu_control_t fpscr;
 
-      _FPU_GETCW (temp);
+  /* Return with all exceptions disabled if a VFP unit isn't present.  */
+  if (!ARM_HAVE_VFP)
+    return 0;
 
-      return (temp >> FE_EXCEPT_SHIFT) & FE_ALL_EXCEPT;
-    }
+  _FPU_GETCW (fpscr);
 
-  /* Unsupported. Return all exceptions disabled.  */
-  return 0;
+  return (fpscr >> FE_EXCEPT_SHIFT) & FE_ALL_EXCEPT;
 }