aboutsummaryrefslogtreecommitdiff
path: root/ports/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'ports/sysdeps')
-rw-r--r--ports/sysdeps/arm/feenablxcpt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ports/sysdeps/arm/feenablxcpt.c b/ports/sysdeps/arm/feenablxcpt.c
index baad4320cc..e2e287b6e5 100644
--- a/ports/sysdeps/arm/feenablxcpt.c
+++ b/ports/sysdeps/arm/feenablxcpt.c
@@ -39,6 +39,18 @@ feenableexcept (int excepts)
_FPU_SETCW(new_exc);
+ if (excepts != 0)
+ {
+ /* VFPv3 and VFPv4 do not support trapping exceptions, so
+ test whether the relevant bits were set and fail if
+ not. */
+ unsigned int temp;
+ _FPU_GETCW (temp);
+ if ((temp & (excepts << FE_EXCEPT_SHIFT))
+ != (excepts << FE_EXCEPT_SHIFT))
+ return -1;
+ }
+
return old_exc;
}