aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu/dp_modf.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/math-emu/dp_modf.c')
-rw-r--r--arch/mips/math-emu/dp_modf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/mips/math-emu/dp_modf.c b/arch/mips/math-emu/dp_modf.c
index 61733ff512c7..d83ec44f1a33 100644
--- a/arch/mips/math-emu/dp_modf.c
+++ b/arch/mips/math-emu/dp_modf.c
@@ -54,24 +54,24 @@ union ieee754dp ieee754dp_modf(union ieee754dp x, union ieee754dp *ip)
54 *ip = ieee754dp_zero(xs); 54 *ip = ieee754dp_zero(xs);
55 return x; 55 return x;
56 } 56 }
57 if (xe >= DP_MBITS) { 57 if (xe >= DP_FBITS) {
58 *ip = x; 58 *ip = x;
59 return ieee754dp_zero(xs); 59 return ieee754dp_zero(xs);
60 } 60 }
61 /* generate ipart mantissa by clearing bottom bits 61 /* generate ipart mantissa by clearing bottom bits
62 */ 62 */
63 *ip = builddp(xs, xe + DP_EBIAS, 63 *ip = builddp(xs, xe + DP_EBIAS,
64 ((xm >> (DP_MBITS - xe)) << (DP_MBITS - xe)) & 64 ((xm >> (DP_FBITS - xe)) << (DP_FBITS - xe)) &
65 ~DP_HIDDEN_BIT); 65 ~DP_HIDDEN_BIT);
66 66
67 /* generate fpart mantissa by clearing top bits 67 /* generate fpart mantissa by clearing top bits
68 * and normalizing (must be able to normalize) 68 * and normalizing (must be able to normalize)
69 */ 69 */
70 xm = (xm << (64 - (DP_MBITS - xe))) >> (64 - (DP_MBITS - xe)); 70 xm = (xm << (64 - (DP_FBITS - xe))) >> (64 - (DP_FBITS - xe));
71 if (xm == 0) 71 if (xm == 0)
72 return ieee754dp_zero(xs); 72 return ieee754dp_zero(xs);
73 73
74 while ((xm >> DP_MBITS) == 0) { 74 while ((xm >> DP_FBITS) == 0) {
75 xm <<= 1; 75 xm <<= 1;
76 xe--; 76 xe--;
77 } 77 }