aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/aarch64/fpu/fesetround.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/aarch64/fpu/fesetround.c')
-rw-r--r--sysdeps/aarch64/fpu/fesetround.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/aarch64/fpu/fesetround.c b/sysdeps/aarch64/fpu/fesetround.c
index 40a05f6..225096a 100644
--- a/sysdeps/aarch64/fpu/fesetround.c
+++ b/sysdeps/aarch64/fpu/fesetround.c
@@ -23,6 +23,7 @@ int
fesetround (int round)
{
fpu_control_t fpcr;
+ fpu_control_t fpcr_new;
switch (round)
{
@@ -31,9 +32,10 @@ fesetround (int round)
case FE_DOWNWARD:
case FE_TOWARDZERO:
_FPU_GETCW (fpcr);
- fpcr = (fpcr & ~FE_TOWARDZERO) | round;
+ fpcr_new = (fpcr & ~FE_TOWARDZERO) | round;
- _FPU_SETCW (fpcr);
+ if (fpcr != fpcr_new)
+ _FPU_SETCW (fpcr_new);
return 0;
default: