From 1a2f40e5d14ed6450696feacf04fca5eeceae7ef Mon Sep 17 00:00:00 2001 From: Wilco Date: Thu, 15 May 2014 15:18:40 +0100 Subject: ARM: Improve fenv implementation --- sysdeps/arm/fegetexcept.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'sysdeps/arm/fegetexcept.c') diff --git a/sysdeps/arm/fegetexcept.c b/sysdeps/arm/fegetexcept.c index 5974c63336..aa244d0928 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; } -- cgit v1.2.3