MIPS: math-emu: Turn macros into functions where possible.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Ralf Baechle
2014-04-19 00:36:32 +02:00
parent bee1653593
commit 9e8bad1f9c
39 changed files with 143 additions and 131 deletions

View File

@@ -35,7 +35,7 @@ union ieee754sp ieee754sp_sqrt(union ieee754sp x)
/* take care of Inf and NaN */
EXPLODEXSP;
CLEARCX;
ieee754_clearcx();
FLUSHXSP;
/* x == INF or NAN? */
@@ -44,7 +44,7 @@ union ieee754sp ieee754sp_sqrt(union ieee754sp x)
/* sqrt(Nan) = Nan */
return ieee754sp_nanxcpt(x, "sqrt");
case IEEE754_CLASS_SNAN:
SETCX(IEEE754_INVALID_OPERATION);
ieee754_setcx(IEEE754_INVALID_OPERATION);
return ieee754sp_nanxcpt(ieee754sp_indef(), "sqrt");
case IEEE754_CLASS_ZERO:
/* sqrt(0) = 0 */
@@ -52,7 +52,7 @@ union ieee754sp ieee754sp_sqrt(union ieee754sp x)
case IEEE754_CLASS_INF:
if (xs) {
/* sqrt(-Inf) = Nan */
SETCX(IEEE754_INVALID_OPERATION);
ieee754_setcx(IEEE754_INVALID_OPERATION);
return ieee754sp_nanxcpt(ieee754sp_indef(), "sqrt");
}
/* sqrt(+Inf) = Inf */
@@ -61,7 +61,7 @@ union ieee754sp ieee754sp_sqrt(union ieee754sp x)
case IEEE754_CLASS_NORM:
if (xs) {
/* sqrt(-x) = Nan */
SETCX(IEEE754_INVALID_OPERATION);
ieee754_setcx(IEEE754_INVALID_OPERATION);
return ieee754sp_nanxcpt(ieee754sp_indef(), "sqrt");
}
break;
@@ -99,7 +99,7 @@ union ieee754sp ieee754sp_sqrt(union ieee754sp x)
}
if (ix != 0) {
SETCX(IEEE754_INEXACT);
ieee754_setcx(IEEE754_INEXACT);
switch (ieee754_csr.rm) {
case IEEE754_RP:
q += 2;