summaryrefslogtreecommitdiff
path: root/ports/sysdeps/arm/fesetenv.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/sysdeps/arm/fesetenv.c')
-rw-r--r--ports/sysdeps/arm/fesetenv.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ports/sysdeps/arm/fesetenv.c b/ports/sysdeps/arm/fesetenv.c
index 2fad61da1a..8f5349c4d3 100644
--- a/ports/sysdeps/arm/fesetenv.c
+++ b/ports/sysdeps/arm/fesetenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment.
- Copyright (C) 2004-2012 Free Software Foundation, Inc.
+ Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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;
}