summaryrefslogtreecommitdiffstats
path: root/mpi-patches/fix-bad-shifts
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-03-04 11:55:19 -0800
committerKaz Kylheku <kaz@kylheku.com>2012-03-04 11:55:19 -0800
commit3490dd06c52d5aa7c258f03025a05064837ce1c6 (patch)
tree23f4ef5380a7863f1ef290c9c309af4529689a0f /mpi-patches/fix-bad-shifts
parentf75994545cb88c6625e4122afa61fbbe1adeb081 (diff)
downloadtxr-3490dd06c52d5aa7c258f03025a05064837ce1c6.tar.gz
txr-3490dd06c52d5aa7c258f03025a05064837ce1c6.tar.bz2
txr-3490dd06c52d5aa7c258f03025a05064837ce1c6.zip
* mpi-patches/add-mp-hash (mp_hash): Fixed use of uninitialized
variable on platforms where the MP digit is smaller than a long integer. (Not anything TXR is known to run on). Changed algorithm to take the first and last digit and add them together, rather than just taking the last digit. The last digit will be zeros for numbers that contain 2 as a factor with a large enough multiplicity. * mpi-patches/add-mpi-toradix-with-case: Refreshed. * mpi-patches/bit-search-optimizations: Likewise. * mpi-patches/faster-square-root: Likewise. * mpi-patches/fix-bad-shifts: Likewise. * mpi-patches/fix-mult-bug: Likewise.
Diffstat (limited to 'mpi-patches/fix-bad-shifts')
-rw-r--r--mpi-patches/fix-bad-shifts12
1 files changed, 6 insertions, 6 deletions
diff --git a/mpi-patches/fix-bad-shifts b/mpi-patches/fix-bad-shifts
index f6e7c979..abe109a2 100644
--- a/mpi-patches/fix-bad-shifts
+++ b/mpi-patches/fix-bad-shifts
@@ -1,7 +1,7 @@
Index: mpi-1.8.6/mpi.c
===================================================================
---- mpi-1.8.6.orig/mpi.c 2011-12-11 19:52:15.000000000 -0800
-+++ mpi-1.8.6/mpi.c 2011-12-11 19:53:09.000000000 -0800
+--- mpi-1.8.6.orig/mpi.c 2012-03-04 11:49:57.142719257 -0800
++++ mpi-1.8.6/mpi.c 2012-03-04 11:49:59.676143507 -0800
@@ -764,7 +764,7 @@
if((pow = s_mp_ispow2d(d)) >= 0) {
mp_digit mask;
@@ -11,7 +11,7 @@ Index: mpi-1.8.6/mpi.c
rem = DIGIT(a, 0) & mask;
if(q) {
-@@ -3068,7 +3068,7 @@
+@@ -3081,7 +3081,7 @@
return;
/* Flush all the bits above 2^d in its digit */
@@ -20,7 +20,7 @@ Index: mpi-1.8.6/mpi.c
dp[ndig] &= dmask;
/* Flush all digits above the one with 2^d in it */
-@@ -3101,7 +3101,7 @@
+@@ -3114,7 +3114,7 @@
dp = DIGITS(mp); used = USED(mp);
d %= DIGIT_BIT;
@@ -29,7 +29,7 @@ Index: mpi-1.8.6/mpi.c
/* If the shift requires another digit, make sure we've got one to
work with */
-@@ -3149,7 +3149,7 @@
+@@ -3162,7 +3162,7 @@
s_mp_rshd(mp, d / DIGIT_BIT);
d %= DIGIT_BIT;
@@ -38,7 +38,7 @@ Index: mpi-1.8.6/mpi.c
save = 0;
for(ix = USED(mp) - 1; ix >= 0; ix--) {
-@@ -3829,7 +3829,7 @@
+@@ -3842,7 +3842,7 @@
if((res = s_mp_pad(a, dig + 1)) != MP_OKAY)
return res;