diff options
author | Ian Bolton <ian.bolton@arm.com> | 2014-04-24 07:15:33 +0100 |
---|---|---|
committer | Will Newton <will.newton@linaro.org> | 2014-06-06 11:41:12 +0100 |
commit | f987b7bf3769e1e2191017a5efd0a19e1c8bace4 (patch) | |
tree | 62e6c4b9d1b6e29bf505893cccf9119c389e1878 /libc/ports/sysdeps/aarch64/fpu/fedisblxcpt.c | |
parent | 541e8be48a93c689ca7b624020afcc9f06a6dd8b (diff) |
Suppress unnecessary FPSR and FPCR writes.
Diffstat (limited to 'libc/ports/sysdeps/aarch64/fpu/fedisblxcpt.c')
-rw-r--r-- | libc/ports/sysdeps/aarch64/fpu/fedisblxcpt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libc/ports/sysdeps/aarch64/fpu/fedisblxcpt.c b/libc/ports/sysdeps/aarch64/fpu/fedisblxcpt.c index 719d52f60..c43335c4e 100644 --- a/libc/ports/sysdeps/aarch64/fpu/fedisblxcpt.c +++ b/libc/ports/sysdeps/aarch64/fpu/fedisblxcpt.c @@ -23,6 +23,7 @@ int fedisableexcept (int excepts) { fpu_control_t fpcr; + fpu_control_t fpcr_new; int original_excepts; _FPU_GETCW (fpcr); @@ -31,9 +32,10 @@ fedisableexcept (int excepts) excepts &= FE_ALL_EXCEPT; - fpcr &= ~(excepts << FE_EXCEPT_SHIFT); + fpcr_new = fpcr & ~(excepts << FE_EXCEPT_SHIFT); - _FPU_SETCW (fpcr); + if (fpcr != fpcr_new) + _FPU_SETCW (fpcr_new); return original_excepts; } |