about summary refs log tree commit diff
path: root/sysdeps/arm/setfpucw.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/setfpucw.c
parentcf26a0cb6a0bbaca46a01ddad6662e5e5159a32a (diff)
downloadglibc-1a2f40e5d14ed6450696feacf04fca5eeceae7ef.tar.gz
glibc-1a2f40e5d14ed6450696feacf04fca5eeceae7ef.tar.xz
glibc-1a2f40e5d14ed6450696feacf04fca5eeceae7ef.zip
ARM: Improve fenv implementation
Diffstat (limited to 'sysdeps/arm/setfpucw.c')
-rw-r--r--sysdeps/arm/setfpucw.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sysdeps/arm/setfpucw.c b/sysdeps/arm/setfpucw.c
index 92333eb364..7416377f9e 100644
--- a/sysdeps/arm/setfpucw.c
+++ b/sysdeps/arm/setfpucw.c
@@ -24,20 +24,19 @@
 void
 __setfpucw (fpu_control_t set)
 {
-  if (ARM_HAVE_VFP)
-    {
-      fpu_control_t cw;
+  fpu_control_t fpscr;
 
-      /* Fetch the current control word.  */
-      _FPU_GETCW (cw);
+  /* Do nothing if a VFP unit isn't present.  */
+  if (!ARM_HAVE_VFP)
+    return;
 
-      /* Preserve the reserved bits, and set the rest as the user
-	 specified (or the default, if the user gave zero).  */
-      cw &= _FPU_RESERVED;
-      cw |= set & ~_FPU_RESERVED;
+  /* Fetch the current control word.  */
+  _FPU_GETCW (fpscr);
 
-      _FPU_SETCW (cw);
-    }
+  /* Preserve the reserved bits, and set the rest as the user
+     specified (or the default, if the user gave zero).  */
+  fpscr &= _FPU_RESERVED;
+  fpscr |= set & ~_FPU_RESERVED;
 
-  /* Do nothing if a VFP unit isn't present.  */
+  _FPU_SETCW (fpscr);
 }