summaryrefslogtreecommitdiff
path: root/sysdeps/arm/ftestexcept.c
diff options
context:
space:
mode:
authorWilco <wdijkstr@arm.com>2014-05-15 15:18:40 +0100
committerMarcus Shawcroft <marcus.shawcroft@arm.com>2014-05-15 15:23:27 +0100
commit1a2f40e5d14ed6450696feacf04fca5eeceae7ef (patch)
treef08d34c9426d8833b6daef1509a1ac431e0b3c0b /sysdeps/arm/ftestexcept.c
parentcf26a0cb6a0bbaca46a01ddad6662e5e5159a32a (diff)
downloadglibc-1a2f40e5d14ed6450696feacf04fca5eeceae7ef.tar.gz
ARM: Improve fenv implementation
Diffstat (limited to 'sysdeps/arm/ftestexcept.c')
-rw-r--r--sysdeps/arm/ftestexcept.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sysdeps/arm/ftestexcept.c b/sysdeps/arm/ftestexcept.c
index 9295c0fec2..de082b281a 100644
--- a/sysdeps/arm/ftestexcept.c
+++ b/sysdeps/arm/ftestexcept.c
@@ -24,17 +24,15 @@
int
fetestexcept (int excepts)
{
- if (ARM_HAVE_VFP)
- {
- fexcept_t temp;
+ fpu_control_t fpscr;
- /* Get current exceptions. */
- _FPU_GETCW(temp);
+ /* Return no exception flags if a VFP unit isn't present. */
+ if (!ARM_HAVE_VFP)
+ return 0;
- return temp & excepts & FE_ALL_EXCEPT;
- }
+ /* Get current exceptions. */
+ _FPU_GETCW (fpscr);
- /* Unsupported, return 0. */
- return 0;
+ return fpscr & excepts & FE_ALL_EXCEPT;
}
libm_hidden_def (fetestexcept)