about summary refs log tree commit diff
path: root/sysdeps/arm/fpu_control.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/arm/fpu_control.h')
-rw-r--r--sysdeps/arm/fpu_control.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/sysdeps/arm/fpu_control.h b/sysdeps/arm/fpu_control.h
index d49066c473..405d427c84 100644
--- a/sysdeps/arm/fpu_control.h
+++ b/sysdeps/arm/fpu_control.h
@@ -53,12 +53,19 @@ extern fpu_control_t __fpu_control;
 typedef unsigned int fpu_control_t;
 
 /* Macros for accessing the hardware control word.  */
+#ifdef __SOFTFP__
 /* This is fmrx %0, fpscr.  */
-#define _FPU_GETCW(cw) \
+# define _FPU_GETCW(cw) \
   __asm__ __volatile__ ("mrc p10, 7, %0, cr1, cr0, 0" : "=r" (cw))
 /* This is fmxr fpscr, %0.  */
-#define _FPU_SETCW(cw) \
+# define _FPU_SETCW(cw) \
   __asm__ __volatile__ ("mcr p10, 7, %0, cr1, cr0, 0" : : "r" (cw))
+#else
+# define _FPU_GETCW(cw) \
+  __asm__ __volatile__ ("vmrs %0, fpscr" : "=r" (cw))
+# define _FPU_SETCW(cw) \
+  __asm__ __volatile__ ("vmsr fpscr, %0" : : "r" (cw))
+#endif
 
 /* Default control word set at startup.  */
 extern fpu_control_t __fpu_control;