summaryrefslogtreecommitdiff
path: root/src/fenv/sh/fenv.S
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2020-04-18 03:23:40 -0400
committerRich Felker <dalias@aerifal.cx>2020-04-18 03:23:40 -0400
commit043c6e31d9135c27875a1ccb4c0f1638f0170e77 (patch)
tree9fbe00e8f036b11e2873a34d970cf7140887eedb /src/fenv/sh/fenv.S
parent2e0907ce624e2058bb31fab5ae565f413dbaf87f (diff)
downloadmusl-043c6e31d9135c27875a1ccb4c0f1638f0170e77.tar.gz
fix sh fesetround failure to clear old mode
the sh version of fesetround or'd the new rounding mode onto the control register without clearing the old rounding mode bits, making changes sticky. this was the root cause of multiple test failures.
Diffstat (limited to 'src/fenv/sh/fenv.S')
-rw-r--r--src/fenv/sh/fenv.S2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/fenv/sh/fenv.S b/src/fenv/sh/fenv.S
index 907aefc0..b3b7d66a 100644
--- a/src/fenv/sh/fenv.S
+++ b/src/fenv/sh/fenv.S
@@ -12,6 +12,8 @@ fegetround:
.type __fesetround, @function
__fesetround:
sts fpscr, r0
+ mov #-4, r1
+ and r1, r0
or r4, r0
lds r0, fpscr
rts