summaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu/dp_sub.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2014-04-30 11:21:55 +0200
committerRalf Baechle <ralf@linux-mips.org>2014-05-23 15:12:38 +0200
commit56a6473339dbd2e908cf8c6f2856d5de2bf8d15b (patch)
treea500f42c8e140cd909d0a5340474f6012c0740b4 /arch/mips/math-emu/dp_sub.c
parentaef3fb76aa1390ef864db888d06d8fcd5510df2d (diff)
downloadblackbird-op-linux-56a6473339dbd2e908cf8c6f2856d5de2bf8d15b.tar.gz
blackbird-op-linux-56a6473339dbd2e908cf8c6f2856d5de2bf8d15b.zip
MIPS: math-emu: Switch to using the MIPS rounding modes.
Previously math-emu was using the IEEE-754 constants internally. These were differing by having the constants for rounding to +/- infinity switched, so a conversion was necessary. This would be entirely avoidable if the MIPS constants were used throughout, so get rid of the bloat. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/math-emu/dp_sub.c')
-rw-r--r--arch/mips/math-emu/dp_sub.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/math-emu/dp_sub.c b/arch/mips/math-emu/dp_sub.c
index d502984df7cc..7a174029043a 100644
--- a/arch/mips/math-emu/dp_sub.c
+++ b/arch/mips/math-emu/dp_sub.c
@@ -91,7 +91,7 @@ union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y)
if (xs != ys)
return x;
else
- return ieee754dp_zero(ieee754_csr.rm == IEEE754_RD);
+ return ieee754dp_zero(ieee754_csr.rm == FPU_CSR_RD);
case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_ZERO):
case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_ZERO):
@@ -171,7 +171,7 @@ union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y)
xs = ys;
}
if (xm == 0) {
- if (ieee754_csr.rm == IEEE754_RD)
+ if (ieee754_csr.rm == FPU_CSR_RD)
return ieee754dp_zero(1); /* round negative inf. => sign = -1 */
else
return ieee754dp_zero(0); /* other round modes => sign = 1 */
OpenPOWER on IntegriCloud