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>
This commit is contained in:
@@ -74,17 +74,17 @@ int ieee754dp_tint(union ieee754dp x)
|
||||
to be zero */
|
||||
odd = (xm & 0x1) != 0x0;
|
||||
switch (ieee754_csr.rm) {
|
||||
case IEEE754_RN:
|
||||
case FPU_CSR_RN:
|
||||
if (round && (sticky || odd))
|
||||
xm++;
|
||||
break;
|
||||
case IEEE754_RZ:
|
||||
case FPU_CSR_RZ:
|
||||
break;
|
||||
case IEEE754_RU: /* toward +Infinity */
|
||||
case FPU_CSR_RU: /* toward +Infinity */
|
||||
if ((round || sticky) && !xs)
|
||||
xm++;
|
||||
break;
|
||||
case IEEE754_RD: /* toward -Infinity */
|
||||
case FPU_CSR_RD: /* toward -Infinity */
|
||||
if ((round || sticky) && xs)
|
||||
xm++;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user