aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu/dp_sqrt.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/math-emu/dp_sqrt.c')
-rw-r--r--arch/mips/math-emu/dp_sqrt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/mips/math-emu/dp_sqrt.c b/arch/mips/math-emu/dp_sqrt.c
index a2a51b87ae8f..b874d60a942b 100644
--- a/arch/mips/math-emu/dp_sqrt.c
+++ b/arch/mips/math-emu/dp_sqrt.c
@@ -87,7 +87,7 @@ ieee754dp ieee754dp_sqrt(ieee754dp x)
87 if (xe > 512) { /* x > 2**-512? */ 87 if (xe > 512) { /* x > 2**-512? */
88 xe -= 512; /* x = x / 2**512 */ 88 xe -= 512; /* x = x / 2**512 */
89 scalx += 256; 89 scalx += 256;
90 } else if (xe < -512) { /* x < 2**-512? */ 90 } else if (xe < -512) { /* x < 2**-512? */
91 xe += 512; /* x = x * 2**512 */ 91 xe += 512; /* x = x * 2**512 */
92 scalx -= 256; 92 scalx -= 256;
93 } 93 }
@@ -108,13 +108,13 @@ ieee754dp ieee754dp_sqrt(ieee754dp x)
108 y.bits &= 0xffffffff00000000LL; 108 y.bits &= 0xffffffff00000000LL;
109 109
110 /* triple to almost 56 sig. bits: y ~= sqrt(x) to within 1 ulp */ 110 /* triple to almost 56 sig. bits: y ~= sqrt(x) to within 1 ulp */
111 /* t=y*y; z=t; pt[n0]+=0x00100000; t+=z; z=(x-z)*y; */ 111 /* t=y*y; z=t; pt[n0]+=0x00100000; t+=z; z=(x-z)*y; */
112 z = t = ieee754dp_mul(y, y); 112 z = t = ieee754dp_mul(y, y);
113 t.parts.bexp += 0x001; 113 t.parts.bexp += 0x001;
114 t = ieee754dp_add(t, z); 114 t = ieee754dp_add(t, z);
115 z = ieee754dp_mul(ieee754dp_sub(x, z), y); 115 z = ieee754dp_mul(ieee754dp_sub(x, z), y);
116 116
117 /* t=z/(t+x) ; pt[n0]+=0x00100000; y+=t; */ 117 /* t=z/(t+x) ; pt[n0]+=0x00100000; y+=t; */
118 t = ieee754dp_div(z, ieee754dp_add(t, x)); 118 t = ieee754dp_div(z, ieee754dp_add(t, x));
119 t.parts.bexp += 0x001; 119 t.parts.bexp += 0x001;
120 y = ieee754dp_add(y, t); 120 y = ieee754dp_add(y, t);