about summary refs log tree commit diff
path: root/sysdeps/arm/fgetexcptflg.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/arm/fgetexcptflg.c')
-rw-r--r--sysdeps/arm/fgetexcptflg.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sysdeps/arm/fgetexcptflg.c b/sysdeps/arm/fgetexcptflg.c
index beb43be748..63fdfbf747 100644
--- a/sysdeps/arm/fgetexcptflg.c
+++ b/sysdeps/arm/fgetexcptflg.c
@@ -25,19 +25,14 @@
 int
 fegetexceptflag (fexcept_t *flagp, int excepts)
 {
-  if (ARM_HAVE_VFP)
-    {
-      unsigned long temp;
+  fpu_control_t fpscr;
 
-      /* Get the current exceptions.  */
-      _FPU_GETCW (temp);
+  /* Fail if a VFP unit isn't present.  */
+  if (!ARM_HAVE_VFP)
+    return 1;
 
-      *flagp = temp & excepts & FE_ALL_EXCEPT;
+  _FPU_GETCW (fpscr);
 
-      /* Success.  */
-      return 0;
-    }
-
-  /* Unsupported, so fail.  */
-  return 1;
+  *flagp = fpscr & excepts & FE_ALL_EXCEPT;
+  return 0;
 }