diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-12-12 22:01:52 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-12-12 22:01:52 -0800 |
commit | 5a9bf359b9aca63f5eb26f5a371b0fae7dd353b4 (patch) | |
tree | 1dcf9463ed92bf267ec6be339dbfcff514d34257 /mpi-patches/fix-mult-bug | |
parent | 705896d8c9d738de984e593a67ec008a16736276 (diff) | |
download | txr-5a9bf359b9aca63f5eb26f5a371b0fae7dd353b4.tar.gz txr-5a9bf359b9aca63f5eb26f5a371b0fae7dd353b4.tar.bz2 txr-5a9bf359b9aca63f5eb26f5a371b0fae7dd353b4.zip |
* mpi-patches/bit-search-optimizations (s_highest_bit): Added static
storage class specifier.
* mpi-patches/fix-mult-bug (s_mp_sqr): More braindamage found in MPI.
This function performs additions and multiplication mp_digit,
expecting a mp_word precision result without casting. This function
is needed for exponentiation.
Diffstat (limited to 'mpi-patches/fix-mult-bug')
-rw-r--r-- | mpi-patches/fix-mult-bug | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/mpi-patches/fix-mult-bug b/mpi-patches/fix-mult-bug index 78bc59b1..a894eefe 100644 --- a/mpi-patches/fix-mult-bug +++ b/mpi-patches/fix-mult-bug @@ -1,7 +1,7 @@ Index: mpi-1.8.6/mpi.c =================================================================== --- mpi-1.8.6.orig/mpi.c 2011-12-10 19:43:20.000000000 -0800 -+++ mpi-1.8.6/mpi.c 2011-12-12 14:31:12.000000000 -0800 ++++ mpi-1.8.6/mpi.c 2011-12-12 21:55:28.000000000 -0800 @@ -3255,7 +3255,7 @@ unless absolutely necessary. */ @@ -29,3 +29,30 @@ Index: mpi-1.8.6/mpi.c *pt = ACCUM(w); k = CARRYOUT(w); } +@@ -3562,7 +3562,7 @@ + if(*pa1 == 0) + continue; + +- w = DIGIT(&tmp, ix + ix) + (*pa1 * *pa1); ++ w = DIGIT(&tmp, ix + ix) + (*pa1 * (mp_word) *pa1); + + pbt[ix + ix] = ACCUM(w); + k = CARRYOUT(w); +@@ -3584,7 +3584,7 @@ + pt = pbt + ix + jx; + + /* Compute the multiplicative step */ +- w = *pa1 * *pa2; ++ w = *pa1 * (mp_word) *pa2; + + /* If w is more than half MP_WORD_MAX, the doubling will + overflow, and we need to record a carry out into the next +@@ -3628,7 +3628,7 @@ + */ + kx = 1; + while(k) { +- k = pbt[ix + jx + kx] + 1; ++ k = (mp_word) pbt[ix + jx + kx] + 1; + pbt[ix + jx + kx] = ACCUM(k); + k = CARRYOUT(k); + ++kx; |