Fix some bugs that caused sparc64's quad precision sqrt to get
the wrong answer for virtually all inputs. Thanks to remko for access to a sparc64 box for testing.
This commit is contained in:
parent
a9d5aa6aeb
commit
10a465e525
@ -334,7 +334,7 @@ __fpu_sqrt(fe)
|
|||||||
FPU_SUBC(d0, x0, t0);
|
FPU_SUBC(d0, x0, t0);
|
||||||
if ((int)d0 >= 0) {
|
if ((int)d0 >= 0) {
|
||||||
x0 = d0, x1 = d1, x2 = d2;
|
x0 = d0, x1 = d1, x2 = d2;
|
||||||
q |= bit;
|
q = bit;
|
||||||
y1 |= 1; /* now t1, y1 are set in concrete */
|
y1 |= 1; /* now t1, y1 are set in concrete */
|
||||||
}
|
}
|
||||||
ODD_DOUBLE;
|
ODD_DOUBLE;
|
||||||
@ -366,12 +366,12 @@ __fpu_sqrt(fe)
|
|||||||
FPU_SUBCS(d2, x2, t2);
|
FPU_SUBCS(d2, x2, t2);
|
||||||
FPU_SUBCS(d1, x1, t1);
|
FPU_SUBCS(d1, x1, t1);
|
||||||
FPU_SUBC(d0, x0, t0);
|
FPU_SUBC(d0, x0, t0);
|
||||||
ODD_DOUBLE;
|
|
||||||
if ((int)d0 >= 0) {
|
if ((int)d0 >= 0) {
|
||||||
x0 = d0, x1 = d1, x2 = d2;
|
x0 = d0, x1 = d1, x2 = d2; x3 = d3;
|
||||||
q |= bit;
|
q = bit;
|
||||||
y2 |= 1;
|
y2 |= 1;
|
||||||
}
|
}
|
||||||
|
ODD_DOUBLE;
|
||||||
while ((bit >>= 1) != 0) {
|
while ((bit >>= 1) != 0) {
|
||||||
EVEN_DOUBLE;
|
EVEN_DOUBLE;
|
||||||
t3 = y3 | bit;
|
t3 = y3 | bit;
|
||||||
@ -380,7 +380,7 @@ __fpu_sqrt(fe)
|
|||||||
FPU_SUBCS(d1, x1, t1);
|
FPU_SUBCS(d1, x1, t1);
|
||||||
FPU_SUBC(d0, x0, t0);
|
FPU_SUBC(d0, x0, t0);
|
||||||
if ((int)d0 >= 0) {
|
if ((int)d0 >= 0) {
|
||||||
x0 = d0, x1 = d1, x2 = d2;
|
x0 = d0, x1 = d1, x2 = d2; x3 = d3;
|
||||||
q |= bit;
|
q |= bit;
|
||||||
y3 |= bit << 1;
|
y3 |= bit << 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user