MIPS: math-emu: Turn macros into functions where possible.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user