diff options
author | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-03-07 13:18:56 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-03-07 13:18:56 +0530 |
commit | e6ebd4a7d5de4c5afcede367483051e55363b18f (patch) | |
tree | 1435fba0893bbff73f314ca2209ead7d919b8ae6 /sysdeps | |
parent | 82a9811d29c00161c7c8ea7f70e2cc30988e192e (diff) | |
download | glibc-e6ebd4a7d5de4c5afcede367483051e55363b18f.tar.gz |
Use an intermediate variable to sum exponents in powerpc __mul and __sqr
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/powerpc/powerpc32/power4/fpu/mpa.c | 11 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/power4/fpu/mpa.c | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c b/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c index ef7ada749a..1858c97407 100644 --- a/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c +++ b/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c @@ -99,16 +99,16 @@ __mul (const mp_no *x, const mp_no *y, mp_no *z, int p) } Z[k] = zk; + int e = EX + EY; /* Is there a carry beyond the most significant digit? */ if (Z[1] == ZERO) { for (i = 1; i <= p2; i++) Z[i] = Z[i + 1]; - EZ = EX + EY - 1; + e--; } - else - EZ = EX + EY; + EZ = e; Z[0] = X[0] * Y[0]; } @@ -202,12 +202,13 @@ __sqr (const mp_no *x, mp_no *y, int p) /* Squares are always positive. */ Y[0] = 1.0; - EY = 2 * EX; + int e = EX * 2; /* Is there a carry beyond the most significant digit? */ if (__glibc_unlikely (Y[1] == ZERO)) { for (i = 1; i <= p; i++) Y[i] = Y[i + 1]; - EY--; + e--; } + EY = e; } diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c b/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c index ef7ada749a..1858c97407 100644 --- a/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c +++ b/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c @@ -99,16 +99,16 @@ __mul (const mp_no *x, const mp_no *y, mp_no *z, int p) } Z[k] = zk; + int e = EX + EY; /* Is there a carry beyond the most significant digit? */ if (Z[1] == ZERO) { for (i = 1; i <= p2; i++) Z[i] = Z[i + 1]; - EZ = EX + EY - 1; + e--; } - else - EZ = EX + EY; + EZ = e; Z[0] = X[0] * Y[0]; } @@ -202,12 +202,13 @@ __sqr (const mp_no *x, mp_no *y, int p) /* Squares are always positive. */ Y[0] = 1.0; - EY = 2 * EX; + int e = EX * 2; /* Is there a carry beyond the most significant digit? */ if (__glibc_unlikely (Y[1] == ZERO)) { for (i = 1; i <= p; i++) Y[i] = Y[i + 1]; - EY--; + e--; } + EY = e; } |