about summary refs log tree commit diff
path: root/sysdeps/sh/sh4/fpu/fraiseexcpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/sh/sh4/fpu/fraiseexcpt.c')
-rw-r--r--sysdeps/sh/sh4/fpu/fraiseexcpt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sysdeps/sh/sh4/fpu/fraiseexcpt.c b/sysdeps/sh/sh4/fpu/fraiseexcpt.c
index a555b10885..729e8bf3ec 100644
--- a/sysdeps/sh/sh4/fpu/fraiseexcpt.c
+++ b/sysdeps/sh/sh4/fpu/fraiseexcpt.c
@@ -60,6 +60,14 @@ feraiseexcept (int excepts)
     __asm__ __volatile__ ("fmul %1, %0" : "+d" (d) : "d" (x));
   }
 
+  {
+    /* Restore flag fields.  */
+    fpu_control_t cw;
+    _FPU_GETCW (cw);
+    cw |= (excepts & FE_ALL_EXCEPT);
+    _FPU_SETCW (cw);
+  }
+
   return 0;
 }
 libm_hidden_def (feraiseexcept)