aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2014-04-24 21:19:57 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-05-23 09:11:14 -0400
commit90efba36ed50933c6df92805bd7e5742e9cc0f46 (patch)
treeedcf824726a76c68e7606954ea16fbcbc91a4f27 /arch/mips/math-emu
parent593d33fe334761853890f2f84ed41e7c24051de2 (diff)
MIPS: math-emu: Get rid of the useless parts of exception handling.
All it really did was throw a printk for no obvious reason. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/math-emu')
-rw-r--r--arch/mips/math-emu/Makefile4
-rw-r--r--arch/mips/math-emu/dp_add.c7
-rw-r--r--arch/mips/math-emu/dp_cmp.c2
-rw-r--r--arch/mips/math-emu/dp_div.c10
-rw-r--r--arch/mips/math-emu/dp_flong.c3
-rw-r--r--arch/mips/math-emu/dp_fsp.c5
-rw-r--r--arch/mips/math-emu/dp_mul.c7
-rw-r--r--arch/mips/math-emu/dp_simple.c4
-rw-r--r--arch/mips/math-emu/dp_sqrt.c8
-rw-r--r--arch/mips/math-emu/dp_sub.c7
-rw-r--r--arch/mips/math-emu/dp_tint.c6
-rw-r--r--arch/mips/math-emu/dp_tlong.c6
-rw-r--r--arch/mips/math-emu/ieee754.c55
-rw-r--r--arch/mips/math-emu/ieee754.h16
-rw-r--r--arch/mips/math-emu/ieee754dp.c28
-rw-r--r--arch/mips/math-emu/ieee754dp.h17
-rw-r--r--arch/mips/math-emu/ieee754int.h5
-rw-r--r--arch/mips/math-emu/ieee754sp.c29
-rw-r--r--arch/mips/math-emu/ieee754sp.h18
-rw-r--r--arch/mips/math-emu/ieee754xcpt.c48
-rw-r--r--arch/mips/math-emu/sp_add.c7
-rw-r--r--arch/mips/math-emu/sp_cmp.c2
-rw-r--r--arch/mips/math-emu/sp_div.c10
-rw-r--r--arch/mips/math-emu/sp_fdp.c10
-rw-r--r--arch/mips/math-emu/sp_fint.c2
-rw-r--r--arch/mips/math-emu/sp_flong.c2
-rw-r--r--arch/mips/math-emu/sp_mul.c6
-rw-r--r--arch/mips/math-emu/sp_simple.c4
-rw-r--r--arch/mips/math-emu/sp_sqrt.c8
-rw-r--r--arch/mips/math-emu/sp_sub.c7
-rw-r--r--arch/mips/math-emu/sp_tint.c6
-rw-r--r--arch/mips/math-emu/sp_tlong.c6
32 files changed, 92 insertions, 263 deletions
diff --git a/arch/mips/math-emu/Makefile b/arch/mips/math-emu/Makefile
index 016736ed304c..383cc7889774 100644
--- a/arch/mips/math-emu/Makefile
+++ b/arch/mips/math-emu/Makefile
@@ -2,8 +2,8 @@
2# Makefile for the Linux/MIPS kernel FPU emulation. 2# Makefile for the Linux/MIPS kernel FPU emulation.
3# 3#
4 4
5obj-y += cp1emu.o ieee754dp.o ieee754sp.o ieee754.o ieee754xcpt.o dp_div.o \ 5obj-y += cp1emu.o ieee754dp.o ieee754sp.o ieee754.o dp_div.o dp_mul.o \
6 dp_mul.o dp_sub.o dp_add.o dp_fsp.o dp_cmp.o dp_simple.o dp_tint.o \ 6 dp_sub.o dp_add.o dp_fsp.o dp_cmp.o dp_simple.o dp_tint.o \
7 dp_fint.o dp_tlong.o dp_flong.o sp_div.o sp_mul.o sp_sub.o \ 7 dp_fint.o dp_tlong.o dp_flong.o sp_div.o sp_mul.o sp_sub.o \
8 sp_add.o sp_fdp.o sp_cmp.o sp_simple.o sp_tint.o sp_fint.o \ 8 sp_add.o sp_fdp.o sp_cmp.o sp_simple.o sp_tint.o sp_fint.o \
9 sp_tlong.o sp_flong.o kernel_linkage.o dsemul.o 9 sp_tlong.o sp_flong.o kernel_linkage.o dsemul.o
diff --git a/arch/mips/math-emu/dp_add.c b/arch/mips/math-emu/dp_add.c
index f1c8e70e8beb..48b9ef6f8a0d 100644
--- a/arch/mips/math-emu/dp_add.c
+++ b/arch/mips/math-emu/dp_add.c
@@ -53,7 +53,7 @@ union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y)
53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM): 53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM):
54 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF): 54 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF):
55 ieee754_setcx(IEEE754_INVALID_OPERATION); 55 ieee754_setcx(IEEE754_INVALID_OPERATION);
56 return ieee754dp_nanxcpt(ieee754dp_indef(), "add", x, y); 56 return ieee754dp_nanxcpt(ieee754dp_indef());
57 57
58 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN): 58 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN):
59 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN): 59 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN):
@@ -76,7 +76,7 @@ union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y)
76 if (xs == ys) 76 if (xs == ys)
77 return x; 77 return x;
78 ieee754_setcx(IEEE754_INVALID_OPERATION); 78 ieee754_setcx(IEEE754_INVALID_OPERATION);
79 return ieee754dp_xcpt(ieee754dp_indef(), "add", x, y); 79 return ieee754dp_indef();
80 80
81 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF): 81 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF):
82 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): 82 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF):
@@ -178,5 +178,6 @@ union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y)
178 } 178 }
179 179
180 } 180 }
181 DPNORMRET2(xs, xe, xm, "add", x, y); 181
182 return ieee754dp_format(xs, xe, xm);
182} 183}
diff --git a/arch/mips/math-emu/dp_cmp.c b/arch/mips/math-emu/dp_cmp.c
index 2d9390ecf60d..fe573cb6f77f 100644
--- a/arch/mips/math-emu/dp_cmp.c
+++ b/arch/mips/math-emu/dp_cmp.c
@@ -44,7 +44,7 @@ int ieee754dp_cmp(union ieee754dp x, union ieee754dp y, int cmp, int sig)
44 return 1; 44 return 1;
45 if (cmp & (IEEE754_CLT | IEEE754_CGT)) { 45 if (cmp & (IEEE754_CLT | IEEE754_CGT)) {
46 if (sig && ieee754_setandtestcx(IEEE754_INVALID_OPERATION)) 46 if (sig && ieee754_setandtestcx(IEEE754_INVALID_OPERATION))
47 return ieee754di_xcpt(0, "fcmpf", x); 47 return 0;
48 } 48 }
49 return 0; 49 return 0;
50 } else { 50 } else {
diff --git a/arch/mips/math-emu/dp_div.c b/arch/mips/math-emu/dp_div.c
index 13ecffa9c25e..377e11470e3f 100644
--- a/arch/mips/math-emu/dp_div.c
+++ b/arch/mips/math-emu/dp_div.c
@@ -52,7 +52,7 @@ union ieee754dp ieee754dp_div(union ieee754dp x, union ieee754dp y)
52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM): 52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM):
53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF): 53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF):
54 ieee754_setcx(IEEE754_INVALID_OPERATION); 54 ieee754_setcx(IEEE754_INVALID_OPERATION);
55 return ieee754dp_nanxcpt(ieee754dp_indef(), "div", x, y); 55 return ieee754dp_nanxcpt(ieee754dp_indef());
56 56
57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN): 57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN):
58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN): 58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN):
@@ -73,7 +73,7 @@ union ieee754dp ieee754dp_div(union ieee754dp x, union ieee754dp y)
73 73
74 case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): 74 case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF):
75 ieee754_setcx(IEEE754_INVALID_OPERATION); 75 ieee754_setcx(IEEE754_INVALID_OPERATION);
76 return ieee754dp_xcpt(ieee754dp_indef(), "div", x, y); 76 return ieee754dp_indef();
77 77
78 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF): 78 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF):
79 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): 79 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF):
@@ -90,12 +90,12 @@ union ieee754dp ieee754dp_div(union ieee754dp x, union ieee754dp y)
90 90
91 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): 91 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO):
92 ieee754_setcx(IEEE754_INVALID_OPERATION); 92 ieee754_setcx(IEEE754_INVALID_OPERATION);
93 return ieee754dp_xcpt(ieee754dp_indef(), "div", x, y); 93 return ieee754dp_indef();
94 94
95 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_ZERO): 95 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_ZERO):
96 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_ZERO): 96 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_ZERO):
97 ieee754_setcx(IEEE754_ZERO_DIVIDE); 97 ieee754_setcx(IEEE754_ZERO_DIVIDE);
98 return ieee754dp_xcpt(ieee754dp_inf(xs ^ ys), "div", x, y); 98 return ieee754dp_inf(xs ^ ys);
99 99
100 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_NORM): 100 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_NORM):
101 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_DNORM): 101 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_DNORM):
@@ -151,6 +151,6 @@ union ieee754dp ieee754dp_div(union ieee754dp x, union ieee754dp y)
151 re--; 151 re--;
152 } 152 }
153 153
154 DPNORMRET2(xs == ys ? 0 : 1, re, rm, "div", x, y); 154 return ieee754dp_format(xs == ys ? 0 : 1, re, rm);
155 } 155 }
156} 156}
diff --git a/arch/mips/math-emu/dp_flong.c b/arch/mips/math-emu/dp_flong.c
index fb5eeaadf253..54c8f005acb2 100644
--- a/arch/mips/math-emu/dp_flong.c
+++ b/arch/mips/math-emu/dp_flong.c
@@ -65,5 +65,6 @@ union ieee754dp ieee754dp_flong(s64 x)
65 xe--; 65 xe--;
66 } 66 }
67 } 67 }
68 DPNORMRET1(xs, xe, xm, "dp_flong", x); 68
69 return ieee754dp_format(xs, xe, xm);
69} 70}
diff --git a/arch/mips/math-emu/dp_fsp.c b/arch/mips/math-emu/dp_fsp.c
index 67ee97f06268..ba600be69454 100644
--- a/arch/mips/math-emu/dp_fsp.c
+++ b/arch/mips/math-emu/dp_fsp.c
@@ -40,14 +40,13 @@ union ieee754dp ieee754dp_fsp(union ieee754sp x)
40 switch (xc) { 40 switch (xc) {
41 case IEEE754_CLASS_SNAN: 41 case IEEE754_CLASS_SNAN:
42 ieee754_setcx(IEEE754_INVALID_OPERATION); 42 ieee754_setcx(IEEE754_INVALID_OPERATION);
43 return ieee754dp_nanxcpt(ieee754dp_indef(), "fsp"); 43 return ieee754dp_nanxcpt(ieee754dp_indef());
44 case IEEE754_CLASS_QNAN: 44 case IEEE754_CLASS_QNAN:
45 return ieee754dp_nanxcpt(builddp(xs, 45 return ieee754dp_nanxcpt(builddp(xs,
46 DP_EMAX + 1 + DP_EBIAS, 46 DP_EMAX + 1 + DP_EBIAS,
47 ((u64) xm 47 ((u64) xm
48 << (DP_FBITS - 48 << (DP_FBITS -
49 SP_FBITS))), "fsp", 49 SP_FBITS))));
50 x);
51 case IEEE754_CLASS_INF: 50 case IEEE754_CLASS_INF:
52 return ieee754dp_inf(xs); 51 return ieee754dp_inf(xs);
53 case IEEE754_CLASS_ZERO: 52 case IEEE754_CLASS_ZERO:
diff --git a/arch/mips/math-emu/dp_mul.c b/arch/mips/math-emu/dp_mul.c
index 56fb309b42c1..74bc81017497 100644
--- a/arch/mips/math-emu/dp_mul.c
+++ b/arch/mips/math-emu/dp_mul.c
@@ -52,7 +52,7 @@ union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y)
52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM): 52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM):
53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF): 53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF):
54 ieee754_setcx(IEEE754_INVALID_OPERATION); 54 ieee754_setcx(IEEE754_INVALID_OPERATION);
55 return ieee754dp_nanxcpt(ieee754dp_indef(), "mul", x, y); 55 return ieee754dp_nanxcpt(ieee754dp_indef());
56 56
57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN): 57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN):
58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN): 58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN):
@@ -73,7 +73,7 @@ union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y)
73 case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_ZERO): 73 case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_ZERO):
74 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): 74 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF):
75 ieee754_setcx(IEEE754_INVALID_OPERATION); 75 ieee754_setcx(IEEE754_INVALID_OPERATION);
76 return ieee754dp_xcpt(ieee754dp_indef(), "mul", x, y); 76 return ieee754dp_indef();
77 77
78 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF): 78 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF):
79 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_INF): 79 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_INF):
@@ -171,6 +171,7 @@ union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y)
171 ((rm << (DP_FBITS + 1 + 3 + 1)) != 0); 171 ((rm << (DP_FBITS + 1 + 3 + 1)) != 0);
172 } 172 }
173 assert(rm & (DP_HIDDEN_BIT << 3)); 173 assert(rm & (DP_HIDDEN_BIT << 3));
174 DPNORMRET2(rs, re, rm, "mul", x, y); 174
175 return ieee754dp_format(rs, re, rm);
175 } 176 }
176} 177}
diff --git a/arch/mips/math-emu/dp_simple.c b/arch/mips/math-emu/dp_simple.c
index fddeb33107dd..4eda7595b151 100644
--- a/arch/mips/math-emu/dp_simple.c
+++ b/arch/mips/math-emu/dp_simple.c
@@ -45,7 +45,7 @@ union ieee754dp ieee754dp_neg(union ieee754dp x)
45 union ieee754dp y = ieee754dp_indef(); 45 union ieee754dp y = ieee754dp_indef();
46 ieee754_setcx(IEEE754_INVALID_OPERATION); 46 ieee754_setcx(IEEE754_INVALID_OPERATION);
47 DPSIGN(y) = DPSIGN(x); 47 DPSIGN(y) = DPSIGN(x);
48 return ieee754dp_nanxcpt(y, "neg"); 48 return ieee754dp_nanxcpt(y);
49 } 49 }
50 50
51 return x; 51 return x;
@@ -65,7 +65,7 @@ union ieee754dp ieee754dp_abs(union ieee754dp x)
65 65
66 if (xc == IEEE754_CLASS_SNAN) { 66 if (xc == IEEE754_CLASS_SNAN) {
67 ieee754_setcx(IEEE754_INVALID_OPERATION); 67 ieee754_setcx(IEEE754_INVALID_OPERATION);
68 return ieee754dp_nanxcpt(ieee754dp_indef(), "abs"); 68 return ieee754dp_nanxcpt(ieee754dp_indef());
69 } 69 }
70 70
71 return x; 71 return x;
diff --git a/arch/mips/math-emu/dp_sqrt.c b/arch/mips/math-emu/dp_sqrt.c
index 1e0fbbf56e97..3c36a86d1473 100644
--- a/arch/mips/math-emu/dp_sqrt.c
+++ b/arch/mips/math-emu/dp_sqrt.c
@@ -49,10 +49,10 @@ union ieee754dp ieee754dp_sqrt(union ieee754dp x)
49 switch (xc) { 49 switch (xc) {
50 case IEEE754_CLASS_QNAN: 50 case IEEE754_CLASS_QNAN:
51 /* sqrt(Nan) = Nan */ 51 /* sqrt(Nan) = Nan */
52 return ieee754dp_nanxcpt(x, "sqrt"); 52 return ieee754dp_nanxcpt(x);
53 case IEEE754_CLASS_SNAN: 53 case IEEE754_CLASS_SNAN:
54 ieee754_setcx(IEEE754_INVALID_OPERATION); 54 ieee754_setcx(IEEE754_INVALID_OPERATION);
55 return ieee754dp_nanxcpt(ieee754dp_indef(), "sqrt"); 55 return ieee754dp_nanxcpt(ieee754dp_indef());
56 case IEEE754_CLASS_ZERO: 56 case IEEE754_CLASS_ZERO:
57 /* sqrt(0) = 0 */ 57 /* sqrt(0) = 0 */
58 return x; 58 return x;
@@ -60,7 +60,7 @@ union ieee754dp ieee754dp_sqrt(union ieee754dp x)
60 if (xs) { 60 if (xs) {
61 /* sqrt(-Inf) = Nan */ 61 /* sqrt(-Inf) = Nan */
62 ieee754_setcx(IEEE754_INVALID_OPERATION); 62 ieee754_setcx(IEEE754_INVALID_OPERATION);
63 return ieee754dp_nanxcpt(ieee754dp_indef(), "sqrt"); 63 return ieee754dp_nanxcpt(ieee754dp_indef());
64 } 64 }
65 /* sqrt(+Inf) = Inf */ 65 /* sqrt(+Inf) = Inf */
66 return x; 66 return x;
@@ -71,7 +71,7 @@ union ieee754dp ieee754dp_sqrt(union ieee754dp x)
71 if (xs) { 71 if (xs) {
72 /* sqrt(-x) = Nan */ 72 /* sqrt(-x) = Nan */
73 ieee754_setcx(IEEE754_INVALID_OPERATION); 73 ieee754_setcx(IEEE754_INVALID_OPERATION);
74 return ieee754dp_nanxcpt(ieee754dp_indef(), "sqrt"); 74 return ieee754dp_nanxcpt(ieee754dp_indef());
75 } 75 }
76 break; 76 break;
77 } 77 }
diff --git a/arch/mips/math-emu/dp_sub.c b/arch/mips/math-emu/dp_sub.c
index 25d25bc8d977..3dd62c186767 100644
--- a/arch/mips/math-emu/dp_sub.c
+++ b/arch/mips/math-emu/dp_sub.c
@@ -52,7 +52,7 @@ union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y)
52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM): 52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM):
53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF): 53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF):
54 ieee754_setcx(IEEE754_INVALID_OPERATION); 54 ieee754_setcx(IEEE754_INVALID_OPERATION);
55 return ieee754dp_nanxcpt(ieee754dp_indef(), "sub", x, y); 55 return ieee754dp_nanxcpt(ieee754dp_indef());
56 56
57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN): 57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN):
58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN): 58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN):
@@ -75,7 +75,7 @@ union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y)
75 if (xs != ys) 75 if (xs != ys)
76 return x; 76 return x;
77 ieee754_setcx(IEEE754_INVALID_OPERATION); 77 ieee754_setcx(IEEE754_INVALID_OPERATION);
78 return ieee754dp_xcpt(ieee754dp_indef(), "sub", x, y); 78 return ieee754dp_indef();
79 79
80 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): 80 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF):
81 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_INF): 81 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_INF):
@@ -186,5 +186,6 @@ union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y)
186 xe--; 186 xe--;
187 } 187 }
188 } 188 }
189 DPNORMRET2(xs, xe, xm, "sub", x, y); 189
190 return ieee754dp_format(xs, xe, xm);
190} 191}
diff --git a/arch/mips/math-emu/dp_tint.c b/arch/mips/math-emu/dp_tint.c
index 1270009aee9b..3a23c6409275 100644
--- a/arch/mips/math-emu/dp_tint.c
+++ b/arch/mips/math-emu/dp_tint.c
@@ -40,7 +40,7 @@ int ieee754dp_tint(union ieee754dp x)
40 case IEEE754_CLASS_QNAN: 40 case IEEE754_CLASS_QNAN:
41 case IEEE754_CLASS_INF: 41 case IEEE754_CLASS_INF:
42 ieee754_setcx(IEEE754_INVALID_OPERATION); 42 ieee754_setcx(IEEE754_INVALID_OPERATION);
43 return ieee754si_xcpt(ieee754si_indef(), "dp_tint", x); 43 return ieee754si_indef();
44 case IEEE754_CLASS_ZERO: 44 case IEEE754_CLASS_ZERO:
45 return 0; 45 return 0;
46 case IEEE754_CLASS_DNORM: 46 case IEEE754_CLASS_DNORM:
@@ -51,7 +51,7 @@ int ieee754dp_tint(union ieee754dp x)
51 /* Set invalid. We will only use overflow for floating 51 /* Set invalid. We will only use overflow for floating
52 point overflow */ 52 point overflow */
53 ieee754_setcx(IEEE754_INVALID_OPERATION); 53 ieee754_setcx(IEEE754_INVALID_OPERATION);
54 return ieee754si_xcpt(ieee754si_indef(), "dp_tint", x); 54 return ieee754si_indef();
55 } 55 }
56 /* oh gawd */ 56 /* oh gawd */
57 if (xe > DP_FBITS) { 57 if (xe > DP_FBITS) {
@@ -96,7 +96,7 @@ int ieee754dp_tint(union ieee754dp x)
96 if ((xm >> 31) != 0 && (xs == 0 || xm != 0x80000000)) { 96 if ((xm >> 31) != 0 && (xs == 0 || xm != 0x80000000)) {
97 /* This can happen after rounding */ 97 /* This can happen after rounding */
98 ieee754_setcx(IEEE754_INVALID_OPERATION); 98 ieee754_setcx(IEEE754_INVALID_OPERATION);
99 return ieee754si_xcpt(ieee754si_indef(), "dp_tint", x); 99 return ieee754si_indef();
100 } 100 }
101 if (round || sticky) 101 if (round || sticky)
102 ieee754_setcx(IEEE754_INEXACT); 102 ieee754_setcx(IEEE754_INEXACT);
diff --git a/arch/mips/math-emu/dp_tlong.c b/arch/mips/math-emu/dp_tlong.c
index b9a43a2d4b36..cbeef6098e76 100644
--- a/arch/mips/math-emu/dp_tlong.c
+++ b/arch/mips/math-emu/dp_tlong.c
@@ -40,7 +40,7 @@ s64 ieee754dp_tlong(union ieee754dp x)
40 case IEEE754_CLASS_QNAN: 40 case IEEE754_CLASS_QNAN:
41 case IEEE754_CLASS_INF: 41 case IEEE754_CLASS_INF:
42 ieee754_setcx(IEEE754_INVALID_OPERATION); 42 ieee754_setcx(IEEE754_INVALID_OPERATION);
43 return ieee754di_xcpt(ieee754di_indef(), "dp_tlong", x); 43 return ieee754di_indef();
44 case IEEE754_CLASS_ZERO: 44 case IEEE754_CLASS_ZERO:
45 return 0; 45 return 0;
46 case IEEE754_CLASS_DNORM: 46 case IEEE754_CLASS_DNORM:
@@ -54,7 +54,7 @@ s64 ieee754dp_tlong(union ieee754dp x)
54 /* Set invalid. We will only use overflow for floating 54 /* Set invalid. We will only use overflow for floating
55 point overflow */ 55 point overflow */
56 ieee754_setcx(IEEE754_INVALID_OPERATION); 56 ieee754_setcx(IEEE754_INVALID_OPERATION);
57 return ieee754di_xcpt(ieee754di_indef(), "dp_tlong", x); 57 return ieee754di_indef();
58 } 58 }
59 /* oh gawd */ 59 /* oh gawd */
60 if (xe > DP_FBITS) { 60 if (xe > DP_FBITS) {
@@ -100,7 +100,7 @@ s64 ieee754dp_tlong(union ieee754dp x)
100 if ((xm >> 63) != 0) { 100 if ((xm >> 63) != 0) {
101 /* This can happen after rounding */ 101 /* This can happen after rounding */
102 ieee754_setcx(IEEE754_INVALID_OPERATION); 102 ieee754_setcx(IEEE754_INVALID_OPERATION);
103 return ieee754di_xcpt(ieee754di_indef(), "dp_tlong", x); 103 return ieee754di_indef();
104 } 104 }
105 if (round || sticky) 105 if (round || sticky)
106 ieee754_setcx(IEEE754_INEXACT); 106 ieee754_setcx(IEEE754_INEXACT);
diff --git a/arch/mips/math-emu/ieee754.c b/arch/mips/math-emu/ieee754.c
index f3b5fa0adbbb..ab53f849f2c7 100644
--- a/arch/mips/math-emu/ieee754.c
+++ b/arch/mips/math-emu/ieee754.c
@@ -28,7 +28,6 @@
28 * ######################################################################## 28 * ########################################################################
29 */ 29 */
30 30
31#include <stdarg.h>
32#include <linux/compiler.h> 31#include <linux/compiler.h>
33 32
34#include "ieee754int.h" 33#include "ieee754int.h"
@@ -38,15 +37,13 @@
38/* special constants 37/* special constants
39*/ 38*/
40 39
41#ifdef __MIPSEB__ 40#define DPSTR(s, b, mh, ml) \
42#define SPSTR(s, b, m) {s, b, m} 41{ \
43#define DPSTR(s, b, mh, ml) {s, b, mh, ml} 42 .sign = (s), \
44#elif defined(__MIPSEL__) 43 .bexp = (b), \
45#define SPSTR(s, b, m) {m, b, s} 44 .manthi = (mh), \
46#define DPSTR(s, b, mh, ml) {ml, mh, b, s} 45 .mantlo = (ml) \
47#else /* !defined (__MIPSEB__) && !defined (__MIPSEL__) */ 46}
48#error "MIPS but neither __MIPSEB__ nor __MIPSEL__?"
49#endif
50 47
51const struct ieee754dp_const __ieee754dp_spcvals[] = { 48const struct ieee754dp_const __ieee754dp_spcvals[] = {
52 DPSTR(0, DP_EMIN - 1 + DP_EBIAS, 0, 0), /* + zero */ 49 DPSTR(0, DP_EMIN - 1 + DP_EBIAS, 0, 0), /* + zero */
@@ -68,6 +65,13 @@ const struct ieee754dp_const __ieee754dp_spcvals[] = {
68 DPSTR(0, 63 + DP_EBIAS, 0, 0), /* + 1.0e63 */ 65 DPSTR(0, 63 + DP_EBIAS, 0, 0), /* + 1.0e63 */
69}; 66};
70 67
68#define SPSTR(s, b, m) \
69{ \
70 .sign = (s), \
71 .bexp = (b), \
72 .mant = (m) \
73}
74
71const struct ieee754sp_const __ieee754sp_spcvals[] = { 75const struct ieee754sp_const __ieee754sp_spcvals[] = {
72 SPSTR(0, SP_EMIN - 1 + SP_EBIAS, 0), /* + zero */ 76 SPSTR(0, SP_EMIN - 1 + SP_EBIAS, 0), /* + zero */
73 SPSTR(1, SP_EMIN - 1 + SP_EBIAS, 0), /* - zero */ 77 SPSTR(1, SP_EMIN - 1 + SP_EBIAS, 0), /* - zero */
@@ -87,34 +91,3 @@ const struct ieee754sp_const __ieee754sp_spcvals[] = {
87 SPSTR(0, 31 + SP_EBIAS, 0), /* + 1.0e31 */ 91 SPSTR(0, 31 + SP_EBIAS, 0), /* + 1.0e31 */
88 SPSTR(0, 63 + SP_EBIAS, 0), /* + 1.0e63 */ 92 SPSTR(0, 63 + SP_EBIAS, 0), /* + 1.0e63 */
89}; 93};
90
91
92int __cold ieee754si_xcpt(int r, const char *op, ...)
93{
94 struct ieee754xctx ax;
95
96 if (!ieee754_tstx())
97 return r;
98 ax.op = op;
99 ax.rt = IEEE754_RT_SI;
100 ax.rv.si = r;
101 va_start(ax.ap, op);
102 ieee754_xcpt(&ax);
103 va_end(ax.ap);
104 return ax.rv.si;
105}
106
107s64 __cold ieee754di_xcpt(s64 r, const char *op, ...)
108{
109 struct ieee754xctx ax;
110
111 if (!ieee754_tstx())
112 return r;
113 ax.op = op;
114 ax.rt = IEEE754_RT_DI;
115 ax.rv.di = r;
116 va_start(ax.ap, op);
117 ieee754_xcpt(&ax);
118 va_end(ax.ap);
119 return ax.rv.di;
120}
diff --git a/arch/mips/math-emu/ieee754.h b/arch/mips/math-emu/ieee754.h
index a62aa5a40af9..e87a6361149b 100644
--- a/arch/mips/math-emu/ieee754.h
+++ b/arch/mips/math-emu/ieee754.h
@@ -24,7 +24,6 @@
24#ifndef __ARCH_MIPS_MATH_EMU_IEEE754_H 24#ifndef __ARCH_MIPS_MATH_EMU_IEEE754_H
25#define __ARCH_MIPS_MATH_EMU_IEEE754_H 25#define __ARCH_MIPS_MATH_EMU_IEEE754_H
26 26
27#include <stdarg.h>
28#include <linux/compiler.h> 27#include <linux/compiler.h>
29#include <asm/byteorder.h> 28#include <asm/byteorder.h>
30#include <linux/kernel.h> 29#include <linux/kernel.h>
@@ -343,19 +342,6 @@ static inline s64 ieee754di_indef(void)
343 return S64_MAX; 342 return S64_MAX;
344} 343}
345 344
346/* IEEE exception context, passed to handler */
347struct ieee754xctx {
348 const char *op; /* operation name */
349 int rt; /* result type */
350 union {
351 union ieee754sp sp; /* single precision */
352 union ieee754dp dp; /* double precision */
353 int si; /* standard signed integer (32bits) */
354 s64 di; /* extended signed integer (64bits) */
355 } rv; /* default result format implied by op */
356 va_list ap;
357};
358
359/* result types for xctx.rt */ 345/* result types for xctx.rt */
360#define IEEE754_RT_SP 0 346#define IEEE754_RT_SP 0
361#define IEEE754_RT_DP 1 347#define IEEE754_RT_DP 1
@@ -363,8 +349,6 @@ struct ieee754xctx {
363#define IEEE754_RT_SI 3 349#define IEEE754_RT_SI 3
364#define IEEE754_RT_DI 4 350#define IEEE754_RT_DI 4
365 351
366extern void __cold ieee754_xcpt(struct ieee754xctx *xcp);
367
368/* compat */ 352/* compat */
369#define ieee754dp_fix(x) ieee754dp_tint(x) 353#define ieee754dp_fix(x) ieee754dp_tint(x)
370#define ieee754sp_fix(x) ieee754sp_tint(x) 354#define ieee754sp_fix(x) ieee754sp_tint(x)
diff --git a/arch/mips/math-emu/ieee754dp.c b/arch/mips/math-emu/ieee754dp.c
index d9ceb6bd3536..39c018856834 100644
--- a/arch/mips/math-emu/ieee754dp.c
+++ b/arch/mips/math-emu/ieee754dp.c
@@ -23,7 +23,6 @@
23 * ######################################################################## 23 * ########################################################################
24 */ 24 */
25 25
26#include <stdarg.h>
27#include <linux/compiler.h> 26#include <linux/compiler.h>
28 27
29#include "ieee754dp.h" 28#include "ieee754dp.h"
@@ -47,25 +46,8 @@ static inline int ieee754dp_issnan(union ieee754dp x)
47} 46}
48 47
49 48
50union ieee754dp __cold ieee754dp_xcpt(union ieee754dp r, const char *op, ...) 49union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp r)
51{ 50{
52 struct ieee754xctx ax;
53 if (!ieee754_tstx())
54 return r;
55
56 ax.op = op;
57 ax.rt = IEEE754_RT_DP;
58 ax.rv.dp = r;
59 va_start(ax.ap, op);
60 ieee754_xcpt(&ax);
61 va_end(ax.ap);
62 return ax.rv.dp;
63}
64
65union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp r, const char *op, ...)
66{
67 struct ieee754xctx ax;
68
69 assert(ieee754dp_isnan(r)); 51 assert(ieee754dp_isnan(r));
70 52
71 if (!ieee754dp_issnan(r)) /* QNAN does not cause invalid op !! */ 53 if (!ieee754dp_issnan(r)) /* QNAN does not cause invalid op !! */
@@ -80,13 +62,7 @@ union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp r, const char *op, ...)
80 return ieee754dp_indef(); 62 return ieee754dp_indef();
81 } 63 }
82 64
83 ax.op = op; 65 return r;
84 ax.rt = 0;
85 ax.rv.dp = r;
86 va_start(ax.ap, op);
87 ieee754_xcpt(&ax);
88 va_end(ax.ap);
89 return ax.rv.dp;
90} 66}
91 67
92static u64 get_rounding(int sn, u64 xm) 68static u64 get_rounding(int sn, u64 xm)
diff --git a/arch/mips/math-emu/ieee754dp.h b/arch/mips/math-emu/ieee754dp.h
index 179d249a627b..91d785e49101 100644
--- a/arch/mips/math-emu/ieee754dp.h
+++ b/arch/mips/math-emu/ieee754dp.h
@@ -81,20 +81,5 @@ static inline union ieee754dp builddp(int s, int bx, u64 m)
81} 81}
82 82
83extern int ieee754dp_isnan(union ieee754dp); 83extern int ieee754dp_isnan(union ieee754dp);
84extern int __cold ieee754si_xcpt(int, const char *, ...); 84extern union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp);
85extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
86extern union ieee754dp __cold ieee754dp_xcpt(union ieee754dp, const char *, ...);
87extern union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp, const char *, ...);
88extern union ieee754dp ieee754dp_format(int, int, u64); 85extern union ieee754dp ieee754dp_format(int, int, u64);
89
90
91#define DPNORMRET2(s, e, m, name, a0, a1) \
92{ \
93 union ieee754dp V = ieee754dp_format(s, e, m); \
94 if (ieee754_tstx()) \
95 return ieee754dp_xcpt(V, name, a0, a1); \
96 else \
97 return V; \
98}
99
100#define DPNORMRET1(s, e, m, name, a0) DPNORMRET2(s, e, m, name, a0, a0)
diff --git a/arch/mips/math-emu/ieee754int.h b/arch/mips/math-emu/ieee754int.h
index 4621a3d39a8f..58b90874a7fe 100644
--- a/arch/mips/math-emu/ieee754int.h
+++ b/arch/mips/math-emu/ieee754int.h
@@ -48,11 +48,6 @@ static inline int ieee754_setandtestcx(const unsigned int x)
48 return ieee754_csr.mx & x; 48 return ieee754_csr.mx & x;
49} 49}
50 50
51static inline int ieee754_tstx(void)
52{
53 return ieee754_csr.cx & ieee754_csr.mx;
54}
55
56#define COMPXSP \ 51#define COMPXSP \
57 unsigned xm; int xe; int xs __maybe_unused; int xc 52 unsigned xm; int xe; int xs __maybe_unused; int xc
58 53
diff --git a/arch/mips/math-emu/ieee754sp.c b/arch/mips/math-emu/ieee754sp.c
index a90837a8cd85..1941c120a168 100644
--- a/arch/mips/math-emu/ieee754sp.c
+++ b/arch/mips/math-emu/ieee754sp.c
@@ -23,7 +23,6 @@
23 * ######################################################################## 23 * ########################################################################
24 */ 24 */
25 25
26#include <stdarg.h>
27#include <linux/compiler.h> 26#include <linux/compiler.h>
28 27
29#include "ieee754sp.h" 28#include "ieee754sp.h"
@@ -47,26 +46,8 @@ static inline int ieee754sp_issnan(union ieee754sp x)
47} 46}
48 47
49 48
50union ieee754sp __cold ieee754sp_xcpt(union ieee754sp r, const char *op, ...) 49union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp r)
51{ 50{
52 struct ieee754xctx ax;
53
54 if (!ieee754_tstx())
55 return r;
56
57 ax.op = op;
58 ax.rt = IEEE754_RT_SP;
59 ax.rv.sp = r;
60 va_start(ax.ap, op);
61 ieee754_xcpt(&ax);
62 va_end(ax.ap);
63 return ax.rv.sp;
64}
65
66union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp r, const char *op, ...)
67{
68 struct ieee754xctx ax;
69
70 assert(ieee754sp_isnan(r)); 51 assert(ieee754sp_isnan(r));
71 52
72 if (!ieee754sp_issnan(r)) /* QNAN does not cause invalid op !! */ 53 if (!ieee754sp_issnan(r)) /* QNAN does not cause invalid op !! */
@@ -81,13 +62,7 @@ union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp r, const char *op, ...)
81 return ieee754sp_indef(); 62 return ieee754sp_indef();
82 } 63 }
83 64
84 ax.op = op; 65 return r;
85 ax.rt = 0;
86 ax.rv.sp = r;
87 va_start(ax.ap, op);
88 ieee754_xcpt(&ax);
89 va_end(ax.ap);
90 return ax.rv.sp;
91} 66}
92 67
93static unsigned get_rounding(int sn, unsigned xm) 68static unsigned get_rounding(int sn, unsigned xm)
diff --git a/arch/mips/math-emu/ieee754sp.h b/arch/mips/math-emu/ieee754sp.h
index 0b44569582b9..e5295d7e8ce9 100644
--- a/arch/mips/math-emu/ieee754sp.h
+++ b/arch/mips/math-emu/ieee754sp.h
@@ -87,21 +87,5 @@ static inline union ieee754sp buildsp(int s, int bx, unsigned m)
87} 87}
88 88
89extern int ieee754sp_isnan(union ieee754sp); 89extern int ieee754sp_isnan(union ieee754sp);
90extern int __cold ieee754si_xcpt(int, const char *, ...); 90extern union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp);
91extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
92extern union ieee754sp __cold ieee754sp_xcpt(union ieee754sp, const char *, ...);
93extern union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp, const char *, ...);
94extern union ieee754sp ieee754sp_format(int, int, unsigned); 91extern union ieee754sp ieee754sp_format(int, int, unsigned);
95
96
97#define SPNORMRET2(s, e, m, name, a0, a1) \
98{ \
99 union ieee754sp V = ieee754sp_format(s, e, m); \
100 \
101 if (ieee754_tstx()) \
102 return ieee754sp_xcpt(V, name, a0, a1); \
103 else \
104 return V; \
105}
106
107#define SPNORMRET1(s, e, m, name, a0) SPNORMRET2(s, e, m, name, a0, a0)
diff --git a/arch/mips/math-emu/ieee754xcpt.c b/arch/mips/math-emu/ieee754xcpt.c
deleted file mode 100644
index d68408a19570..000000000000
--- a/arch/mips/math-emu/ieee754xcpt.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * MIPS floating point support
3 * Copyright (C) 1994-2000 Algorithmics Ltd.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 *
20 * ########################################################################
21 */
22
23/**************************************************************************
24 * Nov 7, 2000
25 * Added preprocessor hacks to map to Linux kernel diagnostics.
26 *
27 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
28 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
29 *************************************************************************/
30
31#include <linux/compiler.h>
32#include <linux/printk.h>
33#include "ieee754.h"
34
35/*
36 * Very naff exception handler (you can plug in your own and
37 * override this).
38 */
39
40static const char *const rtnames[] = {
41 "sp", "dp", "xp", "si", "di"
42};
43
44void __cold ieee754_xcpt(struct ieee754xctx *xcp)
45{
46 printk(KERN_DEBUG "floating point exception in \"%s\", type=%s\n",
47 xcp->op, rtnames[xcp->rt]);
48}
diff --git a/arch/mips/math-emu/sp_add.c b/arch/mips/math-emu/sp_add.c
index d107bce38bfd..db4d89beada6 100644
--- a/arch/mips/math-emu/sp_add.c
+++ b/arch/mips/math-emu/sp_add.c
@@ -52,7 +52,7 @@ union ieee754sp ieee754sp_add(union ieee754sp x, union ieee754sp y)
52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM): 52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM):
53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF): 53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF):
54 ieee754_setcx(IEEE754_INVALID_OPERATION); 54 ieee754_setcx(IEEE754_INVALID_OPERATION);
55 return ieee754sp_nanxcpt(ieee754sp_indef(), "add", x, y); 55 return ieee754sp_nanxcpt(ieee754sp_indef());
56 56
57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN): 57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN):
58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN): 58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN):
@@ -75,7 +75,7 @@ union ieee754sp ieee754sp_add(union ieee754sp x, union ieee754sp y)
75 if (xs == ys) 75 if (xs == ys)
76 return x; 76 return x;
77 ieee754_setcx(IEEE754_INVALID_OPERATION); 77 ieee754_setcx(IEEE754_INVALID_OPERATION);
78 return ieee754sp_xcpt(ieee754sp_indef(), "add", x, y); 78 return ieee754sp_indef();
79 79
80 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF): 80 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF):
81 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): 81 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF):
@@ -172,5 +172,6 @@ union ieee754sp ieee754sp_add(union ieee754sp x, union ieee754sp y)
172 } 172 }
173 173
174 } 174 }
175 SPNORMRET2(xs, xe, xm, "add", x, y); 175
176 return ieee754sp_format(xs, xe, xm);
176} 177}
diff --git a/arch/mips/math-emu/sp_cmp.c b/arch/mips/math-emu/sp_cmp.c
index adf30766ecab..fab49887a1b8 100644
--- a/arch/mips/math-emu/sp_cmp.c
+++ b/arch/mips/math-emu/sp_cmp.c
@@ -44,7 +44,7 @@ int ieee754sp_cmp(union ieee754sp x, union ieee754sp y, int cmp, int sig)
44 return 1; 44 return 1;
45 if (cmp & (IEEE754_CLT | IEEE754_CGT)) { 45 if (cmp & (IEEE754_CLT | IEEE754_CGT)) {
46 if (sig && ieee754_setandtestcx(IEEE754_INVALID_OPERATION)) 46 if (sig && ieee754_setandtestcx(IEEE754_INVALID_OPERATION))
47 return ieee754si_xcpt(0, "fcmpf", x); 47 return 0;
48 } 48 }
49 return 0; 49 return 0;
50 } else { 50 } else {
diff --git a/arch/mips/math-emu/sp_div.c b/arch/mips/math-emu/sp_div.c
index 095fb20262a9..0d847a4fbc13 100644
--- a/arch/mips/math-emu/sp_div.c
+++ b/arch/mips/math-emu/sp_div.c
@@ -52,7 +52,7 @@ union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y)
52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM): 52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM):
53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF): 53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF):
54 ieee754_setcx(IEEE754_INVALID_OPERATION); 54 ieee754_setcx(IEEE754_INVALID_OPERATION);
55 return ieee754sp_nanxcpt(ieee754sp_indef(), "div", x, y); 55 return ieee754sp_nanxcpt(ieee754sp_indef());
56 56
57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN): 57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN):
58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN): 58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN):
@@ -73,7 +73,7 @@ union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y)
73 73
74 case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): 74 case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF):
75 ieee754_setcx(IEEE754_INVALID_OPERATION); 75 ieee754_setcx(IEEE754_INVALID_OPERATION);
76 return ieee754sp_xcpt(ieee754sp_indef(), "div", x, y); 76 return ieee754sp_indef();
77 77
78 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF): 78 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF):
79 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): 79 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF):
@@ -90,12 +90,12 @@ union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y)
90 90
91 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): 91 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO):
92 ieee754_setcx(IEEE754_INVALID_OPERATION); 92 ieee754_setcx(IEEE754_INVALID_OPERATION);
93 return ieee754sp_xcpt(ieee754sp_indef(), "div", x, y); 93 return ieee754sp_indef();
94 94
95 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_ZERO): 95 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_ZERO):
96 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_ZERO): 96 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_ZERO):
97 ieee754_setcx(IEEE754_ZERO_DIVIDE); 97 ieee754_setcx(IEEE754_ZERO_DIVIDE);
98 return ieee754sp_xcpt(ieee754sp_inf(xs ^ ys), "div", x, y); 98 return ieee754sp_inf(xs ^ ys);
99 99
100 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_NORM): 100 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_NORM):
101 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_DNORM): 101 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_DNORM):
@@ -151,6 +151,6 @@ union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y)
151 re--; 151 re--;
152 } 152 }
153 153
154 SPNORMRET2(xs == ys ? 0 : 1, re, rm, "div", x, y); 154 return ieee754sp_format(xs == ys ? 0 : 1, re, rm);
155 } 155 }
156} 156}
diff --git a/arch/mips/math-emu/sp_fdp.c b/arch/mips/math-emu/sp_fdp.c
index ccbed8aadcc4..5c1d8aa6bfd5 100644
--- a/arch/mips/math-emu/sp_fdp.c
+++ b/arch/mips/math-emu/sp_fdp.c
@@ -41,13 +41,13 @@ union ieee754sp ieee754sp_fdp(union ieee754dp x)
41 switch (xc) { 41 switch (xc) {
42 case IEEE754_CLASS_SNAN: 42 case IEEE754_CLASS_SNAN:
43 ieee754_setcx(IEEE754_INVALID_OPERATION); 43 ieee754_setcx(IEEE754_INVALID_OPERATION);
44 return ieee754sp_nanxcpt(ieee754sp_indef(), "fdp"); 44 return ieee754sp_nanxcpt(ieee754sp_indef());
45 case IEEE754_CLASS_QNAN: 45 case IEEE754_CLASS_QNAN:
46 nan = buildsp(xs, SP_EMAX + 1 + SP_EBIAS, (u32) 46 nan = buildsp(xs, SP_EMAX + 1 + SP_EBIAS, (u32)
47 (xm >> (DP_FBITS - SP_FBITS))); 47 (xm >> (DP_FBITS - SP_FBITS)));
48 if (!ieee754sp_isnan(nan)) 48 if (!ieee754sp_isnan(nan))
49 nan = ieee754sp_indef(); 49 nan = ieee754sp_indef();
50 return ieee754sp_nanxcpt(nan, "fdp", x); 50 return ieee754sp_nanxcpt(nan);
51 case IEEE754_CLASS_INF: 51 case IEEE754_CLASS_INF:
52 return ieee754sp_inf(xs); 52 return ieee754sp_inf(xs);
53 case IEEE754_CLASS_ZERO: 53 case IEEE754_CLASS_ZERO:
@@ -58,8 +58,8 @@ union ieee754sp ieee754sp_fdp(union ieee754dp x)
58 ieee754_setcx(IEEE754_INEXACT); 58 ieee754_setcx(IEEE754_INEXACT);
59 if ((ieee754_csr.rm == IEEE754_RU && !xs) || 59 if ((ieee754_csr.rm == IEEE754_RU && !xs) ||
60 (ieee754_csr.rm == IEEE754_RD && xs)) 60 (ieee754_csr.rm == IEEE754_RD && xs))
61 return ieee754sp_xcpt(ieee754sp_mind(xs), "fdp", x); 61 return ieee754sp_mind(xs);
62 return ieee754sp_xcpt(ieee754sp_zero(xs), "fdp", x); 62 return ieee754sp_zero(xs);
63 case IEEE754_CLASS_NORM: 63 case IEEE754_CLASS_NORM:
64 break; 64 break;
65 } 65 }
@@ -72,6 +72,6 @@ union ieee754sp ieee754sp_fdp(union ieee754dp x)
72 rm = (xm >> (DP_FBITS - (SP_FBITS + 3))) | 72 rm = (xm >> (DP_FBITS - (SP_FBITS + 3))) |
73 ((xm << (64 - (DP_FBITS - (SP_FBITS + 3)))) != 0); 73 ((xm << (64 - (DP_FBITS - (SP_FBITS + 3)))) != 0);
74 74
75 SPNORMRET1(xs, xe, rm, "fdp", x); 75 return ieee754sp_format(xs, xe, rm);
76 } 76 }
77} 77}
diff --git a/arch/mips/math-emu/sp_fint.c b/arch/mips/math-emu/sp_fint.c
index 0d01200793d1..8e8687bf955d 100644
--- a/arch/mips/math-emu/sp_fint.c
+++ b/arch/mips/math-emu/sp_fint.c
@@ -66,5 +66,5 @@ union ieee754sp ieee754sp_fint(int x)
66 xe--; 66 xe--;
67 } 67 }
68 } 68 }
69 SPNORMRET1(xs, xe, xm, "fint", x); 69 return ieee754sp_format(xs, xe, xm);
70} 70}
diff --git a/arch/mips/math-emu/sp_flong.c b/arch/mips/math-emu/sp_flong.c
index b26c155cc3e6..e56e87603feb 100644
--- a/arch/mips/math-emu/sp_flong.c
+++ b/arch/mips/math-emu/sp_flong.c
@@ -65,5 +65,5 @@ union ieee754sp ieee754sp_flong(s64 x)
65 xe--; 65 xe--;
66 } 66 }
67 } 67 }
68 SPNORMRET1(xs, xe, xm, "sp_flong", x); 68 return ieee754sp_format(xs, xe, xm);
69} 69}
diff --git a/arch/mips/math-emu/sp_mul.c b/arch/mips/math-emu/sp_mul.c
index 28f608f25499..0e19d0edd3f9 100644
--- a/arch/mips/math-emu/sp_mul.c
+++ b/arch/mips/math-emu/sp_mul.c
@@ -52,7 +52,7 @@ union ieee754sp ieee754sp_mul(union ieee754sp x, union ieee754sp y)
52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM): 52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM):
53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF): 53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF):
54 ieee754_setcx(IEEE754_INVALID_OPERATION); 54 ieee754_setcx(IEEE754_INVALID_OPERATION);
55 return ieee754sp_nanxcpt(ieee754sp_indef(), "mul", x, y); 55 return ieee754sp_nanxcpt(ieee754sp_indef());
56 56
57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN): 57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN):
58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN): 58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN):
@@ -73,7 +73,7 @@ union ieee754sp ieee754sp_mul(union ieee754sp x, union ieee754sp y)
73 case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_ZERO): 73 case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_ZERO):
74 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): 74 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF):
75 ieee754_setcx(IEEE754_INVALID_OPERATION); 75 ieee754_setcx(IEEE754_INVALID_OPERATION);
76 return ieee754sp_xcpt(ieee754sp_indef(), "mul", x, y); 76 return ieee754sp_indef();
77 77
78 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF): 78 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_INF):
79 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_INF): 79 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_INF):
@@ -165,6 +165,6 @@ union ieee754sp ieee754sp_mul(union ieee754sp x, union ieee754sp y)
165 } 165 }
166 assert(rm & (SP_HIDDEN_BIT << 3)); 166 assert(rm & (SP_HIDDEN_BIT << 3));
167 167
168 SPNORMRET2(rs, re, rm, "mul", x, y); 168 return ieee754sp_format(rs, re, rm);
169 } 169 }
170} 170}
diff --git a/arch/mips/math-emu/sp_simple.c b/arch/mips/math-emu/sp_simple.c
index 0f5fd57e2cac..8f0202d73019 100644
--- a/arch/mips/math-emu/sp_simple.c
+++ b/arch/mips/math-emu/sp_simple.c
@@ -45,7 +45,7 @@ union ieee754sp ieee754sp_neg(union ieee754sp x)
45 union ieee754sp y = ieee754sp_indef(); 45 union ieee754sp y = ieee754sp_indef();
46 ieee754_setcx(IEEE754_INVALID_OPERATION); 46 ieee754_setcx(IEEE754_INVALID_OPERATION);
47 SPSIGN(y) = SPSIGN(x); 47 SPSIGN(y) = SPSIGN(x);
48 return ieee754sp_nanxcpt(y, "neg"); 48 return ieee754sp_nanxcpt(y);
49 } 49 }
50 50
51 return x; 51 return x;
@@ -65,7 +65,7 @@ union ieee754sp ieee754sp_abs(union ieee754sp x)
65 65
66 if (xc == IEEE754_CLASS_SNAN) { 66 if (xc == IEEE754_CLASS_SNAN) {
67 ieee754_setcx(IEEE754_INVALID_OPERATION); 67 ieee754_setcx(IEEE754_INVALID_OPERATION);
68 return ieee754sp_nanxcpt(ieee754sp_indef(), "abs"); 68 return ieee754sp_nanxcpt(ieee754sp_indef());
69 } 69 }
70 70
71 return x; 71 return x;
diff --git a/arch/mips/math-emu/sp_sqrt.c b/arch/mips/math-emu/sp_sqrt.c
index 7e87f469b979..f4da2cc8ebe0 100644
--- a/arch/mips/math-emu/sp_sqrt.c
+++ b/arch/mips/math-emu/sp_sqrt.c
@@ -42,10 +42,10 @@ union ieee754sp ieee754sp_sqrt(union ieee754sp x)
42 switch (xc) { 42 switch (xc) {
43 case IEEE754_CLASS_QNAN: 43 case IEEE754_CLASS_QNAN:
44 /* sqrt(Nan) = Nan */ 44 /* sqrt(Nan) = Nan */
45 return ieee754sp_nanxcpt(x, "sqrt"); 45 return ieee754sp_nanxcpt(x);
46 case IEEE754_CLASS_SNAN: 46 case IEEE754_CLASS_SNAN:
47 ieee754_setcx(IEEE754_INVALID_OPERATION); 47 ieee754_setcx(IEEE754_INVALID_OPERATION);
48 return ieee754sp_nanxcpt(ieee754sp_indef(), "sqrt"); 48 return ieee754sp_nanxcpt(ieee754sp_indef());
49 case IEEE754_CLASS_ZERO: 49 case IEEE754_CLASS_ZERO:
50 /* sqrt(0) = 0 */ 50 /* sqrt(0) = 0 */
51 return x; 51 return x;
@@ -53,7 +53,7 @@ union ieee754sp ieee754sp_sqrt(union ieee754sp x)
53 if (xs) { 53 if (xs) {
54 /* sqrt(-Inf) = Nan */ 54 /* sqrt(-Inf) = Nan */
55 ieee754_setcx(IEEE754_INVALID_OPERATION); 55 ieee754_setcx(IEEE754_INVALID_OPERATION);
56 return ieee754sp_nanxcpt(ieee754sp_indef(), "sqrt"); 56 return ieee754sp_nanxcpt(ieee754sp_indef());
57 } 57 }
58 /* sqrt(+Inf) = Inf */ 58 /* sqrt(+Inf) = Inf */
59 return x; 59 return x;
@@ -62,7 +62,7 @@ union ieee754sp ieee754sp_sqrt(union ieee754sp x)
62 if (xs) { 62 if (xs) {
63 /* sqrt(-x) = Nan */ 63 /* sqrt(-x) = Nan */
64 ieee754_setcx(IEEE754_INVALID_OPERATION); 64 ieee754_setcx(IEEE754_INVALID_OPERATION);
65 return ieee754sp_nanxcpt(ieee754sp_indef(), "sqrt"); 65 return ieee754sp_nanxcpt(ieee754sp_indef());
66 } 66 }
67 break; 67 break;
68 } 68 }
diff --git a/arch/mips/math-emu/sp_sub.c b/arch/mips/math-emu/sp_sub.c
index 828de931690c..67a1f9e6bbfe 100644
--- a/arch/mips/math-emu/sp_sub.c
+++ b/arch/mips/math-emu/sp_sub.c
@@ -52,7 +52,7 @@ union ieee754sp ieee754sp_sub(union ieee754sp x, union ieee754sp y)
52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM): 52 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_DNORM):
53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF): 53 case CLPAIR(IEEE754_CLASS_SNAN, IEEE754_CLASS_INF):
54 ieee754_setcx(IEEE754_INVALID_OPERATION); 54 ieee754_setcx(IEEE754_INVALID_OPERATION);
55 return ieee754sp_nanxcpt(ieee754sp_indef(), "sub", x, y); 55 return ieee754sp_nanxcpt(ieee754sp_indef());
56 56
57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN): 57 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_QNAN):
58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN): 58 case CLPAIR(IEEE754_CLASS_NORM, IEEE754_CLASS_QNAN):
@@ -75,7 +75,7 @@ union ieee754sp ieee754sp_sub(union ieee754sp x, union ieee754sp y)
75 if (xs != ys) 75 if (xs != ys)
76 return x; 76 return x;
77 ieee754_setcx(IEEE754_INVALID_OPERATION); 77 ieee754_setcx(IEEE754_INVALID_OPERATION);
78 return ieee754sp_xcpt(ieee754sp_indef(), "sub", x, y); 78 return ieee754sp_indef();
79 79
80 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): 80 case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF):
81 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_INF): 81 case CLPAIR(IEEE754_CLASS_DNORM, IEEE754_CLASS_INF):
@@ -179,5 +179,6 @@ union ieee754sp ieee754sp_sub(union ieee754sp x, union ieee754sp y)
179 xe--; 179 xe--;
180 } 180 }
181 } 181 }
182 SPNORMRET2(xs, xe, xm, "sub", x, y); 182
183 return ieee754sp_format(xs, xe, xm);
183} 184}
diff --git a/arch/mips/math-emu/sp_tint.c b/arch/mips/math-emu/sp_tint.c
index 690cb5b4cfa8..53f04dc2991e 100644
--- a/arch/mips/math-emu/sp_tint.c
+++ b/arch/mips/math-emu/sp_tint.c
@@ -40,7 +40,7 @@ int ieee754sp_tint(union ieee754sp x)
40 case IEEE754_CLASS_QNAN: 40 case IEEE754_CLASS_QNAN:
41 case IEEE754_CLASS_INF: 41 case IEEE754_CLASS_INF:
42 ieee754_setcx(IEEE754_INVALID_OPERATION); 42 ieee754_setcx(IEEE754_INVALID_OPERATION);
43 return ieee754si_xcpt(ieee754si_indef(), "sp_tint", x); 43 return ieee754si_indef();
44 case IEEE754_CLASS_ZERO: 44 case IEEE754_CLASS_ZERO:
45 return 0; 45 return 0;
46 case IEEE754_CLASS_DNORM: 46 case IEEE754_CLASS_DNORM:
@@ -54,7 +54,7 @@ int ieee754sp_tint(union ieee754sp x)
54 /* Set invalid. We will only use overflow for floating 54 /* Set invalid. We will only use overflow for floating
55 point overflow */ 55 point overflow */
56 ieee754_setcx(IEEE754_INVALID_OPERATION); 56 ieee754_setcx(IEEE754_INVALID_OPERATION);
57 return ieee754si_xcpt(ieee754si_indef(), "sp_tint", x); 57 return ieee754si_indef();
58 } 58 }
59 /* oh gawd */ 59 /* oh gawd */
60 if (xe > SP_FBITS) { 60 if (xe > SP_FBITS) {
@@ -100,7 +100,7 @@ int ieee754sp_tint(union ieee754sp x)
100 if ((xm >> 31) != 0) { 100 if ((xm >> 31) != 0) {
101 /* This can happen after rounding */ 101 /* This can happen after rounding */
102 ieee754_setcx(IEEE754_INVALID_OPERATION); 102 ieee754_setcx(IEEE754_INVALID_OPERATION);
103 return ieee754si_xcpt(ieee754si_indef(), "sp_tint", x); 103 return ieee754si_indef();
104 } 104 }
105 if (round || sticky) 105 if (round || sticky)
106 ieee754_setcx(IEEE754_INEXACT); 106 ieee754_setcx(IEEE754_INEXACT);
diff --git a/arch/mips/math-emu/sp_tlong.c b/arch/mips/math-emu/sp_tlong.c
index 346cbad4a1ae..df117923adaa 100644
--- a/arch/mips/math-emu/sp_tlong.c
+++ b/arch/mips/math-emu/sp_tlong.c
@@ -41,7 +41,7 @@ s64 ieee754sp_tlong(union ieee754sp x)
41 case IEEE754_CLASS_QNAN: 41 case IEEE754_CLASS_QNAN:
42 case IEEE754_CLASS_INF: 42 case IEEE754_CLASS_INF:
43 ieee754_setcx(IEEE754_INVALID_OPERATION); 43 ieee754_setcx(IEEE754_INVALID_OPERATION);
44 return ieee754di_xcpt(ieee754di_indef(), "sp_tlong", x); 44 return ieee754di_indef();
45 case IEEE754_CLASS_ZERO: 45 case IEEE754_CLASS_ZERO:
46 return 0; 46 return 0;
47 case IEEE754_CLASS_DNORM: 47 case IEEE754_CLASS_DNORM:
@@ -55,7 +55,7 @@ s64 ieee754sp_tlong(union ieee754sp x)
55 /* Set invalid. We will only use overflow for floating 55 /* Set invalid. We will only use overflow for floating
56 point overflow */ 56 point overflow */
57 ieee754_setcx(IEEE754_INVALID_OPERATION); 57 ieee754_setcx(IEEE754_INVALID_OPERATION);
58 return ieee754di_xcpt(ieee754di_indef(), "sp_tlong", x); 58 return ieee754di_indef();
59 } 59 }
60 /* oh gawd */ 60 /* oh gawd */
61 if (xe > SP_FBITS) { 61 if (xe > SP_FBITS) {
@@ -97,7 +97,7 @@ s64 ieee754sp_tlong(union ieee754sp x)
97 if ((xm >> 63) != 0) { 97 if ((xm >> 63) != 0) {
98 /* This can happen after rounding */ 98 /* This can happen after rounding */
99 ieee754_setcx(IEEE754_INVALID_OPERATION); 99 ieee754_setcx(IEEE754_INVALID_OPERATION);
100 return ieee754di_xcpt(ieee754di_indef(), "sp_tlong", x); 100 return ieee754di_indef();
101 } 101 }
102 if (round || sticky) 102 if (round || sticky)
103 ieee754_setcx(IEEE754_INEXACT); 103 ieee754_setcx(IEEE754_INEXACT);