aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/aarch64/fpu/fclrexcpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/aarch64/fpu/fclrexcpt.c')
-rw-r--r--sysdeps/aarch64/fpu/fclrexcpt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/aarch64/fpu/fclrexcpt.c b/sysdeps/aarch64/fpu/fclrexcpt.c
index 531269f9cf..b24f0ffbbc 100644
--- a/sysdeps/aarch64/fpu/fclrexcpt.c
+++ b/sysdeps/aarch64/fpu/fclrexcpt.c
@@ -23,13 +23,15 @@ int
feclearexcept (int excepts)
{
fpu_fpsr_t fpsr;
+ fpu_fpsr_t fpsr_new;
excepts &= FE_ALL_EXCEPT;
_FPU_GETFPSR (fpsr);
- fpsr = (fpsr & ~FE_ALL_EXCEPT) | (fpsr & FE_ALL_EXCEPT & ~excepts);
+ fpsr_new = (fpsr & ~FE_ALL_EXCEPT) | (fpsr & FE_ALL_EXCEPT & ~excepts);
- _FPU_SETFPSR (fpsr);
+ if (fpsr != fpsr_new)
+ _FPU_SETFPSR (fpsr_new);
return 0;
}