aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/arm/fegetexcept.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/arm/fegetexcept.c')
-rw-r--r--sysdeps/arm/fegetexcept.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sysdeps/arm/fegetexcept.c b/sysdeps/arm/fegetexcept.c
index 5974c63..aa244d0 100644
--- a/sysdeps/arm/fegetexcept.c
+++ b/sysdeps/arm/fegetexcept.c
@@ -25,15 +25,13 @@
int
fegetexcept (void)
{
- if (ARM_HAVE_VFP)
- {
- unsigned long temp;
+ fpu_control_t fpscr;
- _FPU_GETCW (temp);
+ /* Return with all exceptions disabled if a VFP unit isn't present. */
+ if (!ARM_HAVE_VFP)
+ return 0;
- return (temp >> FE_EXCEPT_SHIFT) & FE_ALL_EXCEPT;
- }
+ _FPU_GETCW (fpscr);
- /* Unsupported. Return all exceptions disabled. */
- return 0;
+ return (fpscr >> FE_EXCEPT_SHIFT) & FE_ALL_EXCEPT;
}