aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu/ieee754dp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/math-emu/ieee754dp.c')
-rw-r--r--arch/mips/math-emu/ieee754dp.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/mips/math-emu/ieee754dp.c b/arch/mips/math-emu/ieee754dp.c
index 9723a518e5ad..49c811a920b5 100644
--- a/arch/mips/math-emu/ieee754dp.c
+++ b/arch/mips/math-emu/ieee754dp.c
@@ -42,18 +42,16 @@ static inline int ieee754dp_issnan(union ieee754dp x)
42} 42}
43 43
44 44
45/*
46 * Raise the Invalid Operation IEEE 754 exception
47 * and convert the signaling NaN supplied to a quiet NaN.
48 */
45union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp r) 49union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp r)
46{ 50{
47 assert(ieee754dp_isnan(r)); 51 assert(ieee754dp_issnan(r));
48
49 if (!ieee754dp_issnan(r)) /* QNAN does not cause invalid op !! */
50 return r;
51
52 /* If not enabled convert to a quiet NaN. */
53 if (!ieee754_setandtestcx(IEEE754_INVALID_OPERATION))
54 return ieee754dp_indef();
55 52
56 return r; 53 ieee754_setcx(IEEE754_INVALID_OPERATION);
54 return ieee754dp_indef();
57} 55}
58 56
59static u64 ieee754dp_get_rounding(int sn, u64 xm) 57static u64 ieee754dp_get_rounding(int sn, u64 xm)