about summary refs log tree commit diff
path: root/ports/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'ports/sysdeps')
-rw-r--r--ports/sysdeps/arm/fesetenv.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ports/sysdeps/arm/fesetenv.c b/ports/sysdeps/arm/fesetenv.c
index 2fad61da1a..e92f9f5ac8 100644
--- a/ports/sysdeps/arm/fesetenv.c
+++ b/ports/sysdeps/arm/fesetenv.c
@@ -40,6 +40,16 @@ __fesetenv (const fenv_t *envp)
 
       _FPU_SETCW (temp);
 
+      if (envp == FE_NOMASK_ENV)
+	{
+	  /* VFPv3 and VFPv4 do not support trapping exceptions, so
+	     test whether the relevant bits were set and fail if
+	     not.  */
+	  _FPU_GETCW (temp);
+	  if ((temp & _FPU_IEEE) != _FPU_IEEE)
+	    return 1;
+	}
+
       /* Success.  */
       return 0;
     }