aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu/ieee754sp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/math-emu/ieee754sp.c')
-rw-r--r--arch/mips/math-emu/ieee754sp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/mips/math-emu/ieee754sp.c b/arch/mips/math-emu/ieee754sp.c
index ed62ffeeb61e..5b435ec8ae25 100644
--- a/arch/mips/math-emu/ieee754sp.c
+++ b/arch/mips/math-emu/ieee754sp.c
@@ -43,7 +43,7 @@ int ieee754sp_isnan(union ieee754sp x)
43int ieee754sp_issnan(union ieee754sp x) 43int ieee754sp_issnan(union ieee754sp x)
44{ 44{
45 assert(ieee754sp_isnan(x)); 45 assert(ieee754sp_isnan(x));
46 return (SPMANT(x) & SP_MBIT(SP_MBITS-1)); 46 return (SPMANT(x) & SP_MBIT(SP_FBITS-1));
47} 47}
48 48
49 49
@@ -74,7 +74,7 @@ union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp r, const char *op, ...)
74 74
75 if (!ieee754_setandtestcx(IEEE754_INVALID_OPERATION)) { 75 if (!ieee754_setandtestcx(IEEE754_INVALID_OPERATION)) {
76 /* not enabled convert to a quiet NaN */ 76 /* not enabled convert to a quiet NaN */
77 SPMANT(r) &= (~SP_MBIT(SP_MBITS-1)); 77 SPMANT(r) &= (~SP_MBIT(SP_FBITS-1));
78 if (ieee754sp_isnan(r)) 78 if (ieee754sp_isnan(r))
79 return r; 79 return r;
80 else 80 else
@@ -137,7 +137,7 @@ union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm)
137{ 137{
138 assert(xm); /* we don't gen exact zeros (probably should) */ 138 assert(xm); /* we don't gen exact zeros (probably should) */
139 139
140 assert((xm >> (SP_MBITS + 1 + 3)) == 0); /* no execess */ 140 assert((xm >> (SP_FBITS + 1 + 3)) == 0); /* no execess */
141 assert(xm & (SP_HIDDEN_BIT << 3)); 141 assert(xm & (SP_HIDDEN_BIT << 3));
142 142
143 if (xe < SP_EMIN) { 143 if (xe < SP_EMIN) {
@@ -166,7 +166,7 @@ union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm)
166 } 166 }
167 167
168 if (xe == SP_EMIN - 1 168 if (xe == SP_EMIN - 1
169 && get_rounding(sn, xm) >> (SP_MBITS + 1 + 3)) 169 && get_rounding(sn, xm) >> (SP_FBITS + 1 + 3))
170 { 170 {
171 /* Not tiny after rounding */ 171 /* Not tiny after rounding */
172 ieee754_setcx(IEEE754_INEXACT); 172 ieee754_setcx(IEEE754_INEXACT);
@@ -194,7 +194,7 @@ union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm)
194 xm = get_rounding(sn, xm); 194 xm = get_rounding(sn, xm);
195 /* adjust exponent for rounding add overflowing 195 /* adjust exponent for rounding add overflowing
196 */ 196 */
197 if (xm >> (SP_MBITS + 1 + 3)) { 197 if (xm >> (SP_FBITS + 1 + 3)) {
198 /* add causes mantissa overflow */ 198 /* add causes mantissa overflow */
199 xm >>= 1; 199 xm >>= 1;
200 xe++; 200 xe++;
@@ -203,7 +203,7 @@ union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm)
203 /* strip grs bits */ 203 /* strip grs bits */
204 xm >>= 3; 204 xm >>= 3;
205 205
206 assert((xm >> (SP_MBITS + 1)) == 0); /* no execess */ 206 assert((xm >> (SP_FBITS + 1)) == 0); /* no execess */
207 assert(xe >= SP_EMIN); 207 assert(xe >= SP_EMIN);
208 208
209 if (xe > SP_EMAX) { 209 if (xe > SP_EMAX) {
@@ -236,7 +236,7 @@ union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm)
236 ieee754_setcx(IEEE754_UNDERFLOW); 236 ieee754_setcx(IEEE754_UNDERFLOW);
237 return buildsp(sn, SP_EMIN - 1 + SP_EBIAS, xm); 237 return buildsp(sn, SP_EMIN - 1 + SP_EBIAS, xm);
238 } else { 238 } else {
239 assert((xm >> (SP_MBITS + 1)) == 0); /* no execess */ 239 assert((xm >> (SP_FBITS + 1)) == 0); /* no execess */
240 assert(xm & SP_HIDDEN_BIT); 240 assert(xm & SP_HIDDEN_BIT);
241 241
242 return buildsp(sn, xe + SP_EBIAS, xm & ~SP_HIDDEN_BIT); 242 return buildsp(sn, xe + SP_EBIAS, xm & ~SP_HIDDEN_BIT);