Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This changeset adds official patches published on gmp website. Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
- Loading branch information
1 parent
5a88b7f
commit bcb6b03
Showing
11 changed files
with
650 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
patches/gmp/4.3.0/100-multiplicity-that-does-not-fit-an-int.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
diff --git a/mpz/remove.c b/mpz/remove.c | ||
--- a/mpz/remove.c | ||
+++ b/mpz/remove.c | ||
@@ -23,7 +23,7 @@ | ||
unsigned long int | ||
mpz_remove (mpz_ptr dest, mpz_srcptr src, mpz_srcptr f) | ||
{ | ||
- mpz_t fpow[40]; /* inexhaustible...until year 2020 or so */ | ||
+ mpz_t fpow[GMP_LIMB_BITS]; /* Really MP_SIZE_T_BITS */ | ||
mpz_t x, rem; | ||
unsigned long int pwr; | ||
int p; | ||
@@ -69,7 +69,7 @@ | ||
mpz_set (dest, x); | ||
} | ||
|
||
- pwr = (1 << p) - 1; | ||
+ pwr = (1L << p) - 1; | ||
|
||
mpz_clear (fpow[p]); | ||
|
||
diff --git a/mpz/remove.c b/mpz/remove.c | ||
--- a/mpz/remove.c | ||
+++ b/mpz/remove.c | ||
@@ -80,7 +80,7 @@ | ||
mpz_tdiv_qr (x, rem, dest, fpow[p]); | ||
if (SIZ (rem) == 0) | ||
{ | ||
- pwr += 1 << p; | ||
+ pwr += 1L << p; | ||
mpz_set (dest, x); | ||
} | ||
mpz_clear (fpow[p]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/mpn/generic/toom44_mul.c b/mpn/generic/toom44_mul.c | ||
--- a/mpn/generic/toom44_mul.c | ||
+++ b/mpn/generic/toom44_mul.c | ||
@@ -116,17 +116,16 @@ | ||
|
||
TMP_MARK; | ||
|
||
- as1 = TMP_SALLOC_LIMBS (n + 1); | ||
- asm1 = TMP_SALLOC_LIMBS (n + 1); | ||
- as2 = TMP_SALLOC_LIMBS (n + 1); | ||
- ash = TMP_SALLOC_LIMBS (n + 1); | ||
- asmh = TMP_SALLOC_LIMBS (n + 1); | ||
- | ||
- bs1 = TMP_SALLOC_LIMBS (n + 1); | ||
- bsm1 = TMP_SALLOC_LIMBS (n + 1); | ||
- bs2 = TMP_SALLOC_LIMBS (n + 1); | ||
- bsh = TMP_SALLOC_LIMBS (n + 1); | ||
- bsmh = TMP_SALLOC_LIMBS (n + 1); | ||
+ as1 = TMP_ALLOC_LIMBS (10 * n + 10); | ||
+ asm1 = as1 + n + 1; | ||
+ as2 = asm1 + n + 1; | ||
+ ash = as2 + n + 1; | ||
+ asmh = ash + n + 1; | ||
+ bs1 = asmh + n + 1; | ||
+ bsm1 = bs1 + n + 1; | ||
+ bs2 = bsm1 + n + 1; | ||
+ bsh = bs2 + n + 1; | ||
+ bsmh = bsh + n + 1; | ||
|
||
gp = pp; | ||
hp = pp + n + 1; |
38 changes: 38 additions & 0 deletions
38
patches/gmp/5.0.1/110-get-mpn_sub_1-size-argument-right.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
# HG changeset patch | ||
# User Torbjorn Granlund <tege@gmplib.org> | ||
# Date 1310730221 -7200 | ||
# Node ID 538dfce27f410b910d5e2f011119269e224d16a3 | ||
# Parent 03ed209dd7efd4f4fff0ce297bb3a8f7e7ba2366 | ||
(mpn_dcpi1_bdiv_q): Get mpn_sub_1 size argument right. | ||
|
||
diff -r 03ed209dd7ef -r 538dfce27f41 mpn/generic/dcpi1_bdiv_q.c | ||
--- a/mpn/generic/dcpi1_bdiv_q.c Thu Jun 16 12:22:24 2011 +0200 | ||
+++ b/mpn/generic/dcpi1_bdiv_q.c Fri Jul 15 13:43:41 2011 +0200 | ||
@@ -7,7 +7,7 @@ | ||
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST | ||
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE. | ||
|
||
-Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc. | ||
+Copyright 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. | ||
|
||
This file is part of the GNU MP Library. | ||
|
||
@@ -28,7 +28,6 @@ | ||
#include "gmp-impl.h" | ||
|
||
|
||
- | ||
mp_size_t | ||
mpn_dcpi1_bdiv_q_n_itch (mp_size_t n) | ||
{ | ||
@@ -130,7 +129,7 @@ | ||
qn = nn - qn; | ||
while (qn > dn) | ||
{ | ||
- mpn_sub_1 (np + dn, np + dn, qn, cy); | ||
+ mpn_sub_1 (np + dn, np + dn, qn - dn, cy); | ||
cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp); | ||
qp += dn; | ||
np += dn; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
Removed ChangeLog part | ||
|
||
# HG changeset patch | ||
# User Torbjorn Granlund <tege@gmplib.org> | ||
# Date 1342891151 -7200 | ||
# Node ID 829215e83ff1db3cd00e510a737092df691442d5 | ||
# Parent 816c18dbd492050ef8892e91602d9e758abc2988 | ||
Fix r0 clobbering issue with "large" code affecting elf+darwin PIC. | ||
|
||
diff -r 816c18dbd492 -r 829215e83ff1 mpn/powerpc32/vmx/mod_34lsub1.asm | ||
--- a/mpn/powerpc32/vmx/mod_34lsub1.asm Tue Jun 19 15:02:48 2012 +0200 | ||
+++ b/mpn/powerpc32/vmx/mod_34lsub1.asm Sat Jul 21 19:19:11 2012 +0200 | ||
@@ -1,6 +1,7 @@ | ||
dnl PowerPC-32 mpn_mod_34lsub1 -- mpn remainder mod 2^24-1. | ||
|
||
-dnl Copyright 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
+dnl Copyright 2002, 2003, 2005, 2006, 2007, 2012 Free Software Foundation, | ||
+dnl Inc. | ||
|
||
dnl This file is part of the GNU MP Library. | ||
|
||
@@ -135,15 +136,15 @@ | ||
|
||
andi. r7, up, 15 | ||
vxor a0, v0, v0 | ||
- lis r0, 0xaaaa | ||
+ lis r9, 0xaaaa | ||
vxor a1, v0, v0 | ||
- ori r0, r0, 0xaaab | ||
+ ori r9, r9, 0xaaab | ||
vxor a2, v0, v0 | ||
li r5, 16 | ||
vxor c0, v0, v0 | ||
li r6, 32 | ||
vxor c1, v0, v0 | ||
- LEAL( r11, cnsts) | ||
+ LEAL( r11, cnsts) C CAUTION clobbers r0 for elf, darwin | ||
vxor c2, v0, v0 | ||
vxor z, v0, v0 | ||
|
||
@@ -158,7 +159,7 @@ | ||
vsldoi a2, z, a2, 12 | ||
|
||
addi n, n, 9 | ||
- mulhwu r0, n, r0 | ||
+ mulhwu r0, n, r9 | ||
srwi r0, r0, 3 C r0 = floor(n/12) | ||
mtctr r0 | ||
|
||
@@ -174,7 +175,7 @@ | ||
vsldoi a1, z, a1, 8 | ||
|
||
addi n, n, 6 | ||
- mulhwu r0, n, r0 | ||
+ mulhwu r0, n, r9 | ||
srwi r0, r0, 3 C r0 = floor(n/12) | ||
mtctr r0 | ||
|
||
@@ -188,7 +189,7 @@ | ||
vsldoi a0, z, a0, 4 | ||
|
||
addi n, n, 3 | ||
- mulhwu r0, n, r0 | ||
+ mulhwu r0, n, r9 | ||
srwi r0, r0, 3 C r0 = floor(n/12) | ||
mtctr r0 | ||
|
||
@@ -197,7 +198,7 @@ | ||
b L(0) | ||
|
||
L(aligned16): | ||
- mulhwu r0, n, r0 | ||
+ mulhwu r0, n, r9 | ||
srwi r0, r0, 3 C r0 = floor(n/12) | ||
mtctr r0 | ||
|
||
|
38 changes: 38 additions & 0 deletions
38
patches/gmp/5.0.2/110-get-mpn_sub_1-size-argument-right.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
# HG changeset patch | ||
# User Torbjorn Granlund <tege@gmplib.org> | ||
# Date 1310730221 -7200 | ||
# Node ID 538dfce27f410b910d5e2f011119269e224d16a3 | ||
# Parent 03ed209dd7efd4f4fff0ce297bb3a8f7e7ba2366 | ||
(mpn_dcpi1_bdiv_q): Get mpn_sub_1 size argument right. | ||
|
||
diff -r 03ed209dd7ef -r 538dfce27f41 mpn/generic/dcpi1_bdiv_q.c | ||
--- a/mpn/generic/dcpi1_bdiv_q.c Thu Jun 16 12:22:24 2011 +0200 | ||
+++ b/mpn/generic/dcpi1_bdiv_q.c Fri Jul 15 13:43:41 2011 +0200 | ||
@@ -7,7 +7,7 @@ | ||
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST | ||
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE. | ||
|
||
-Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc. | ||
+Copyright 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. | ||
|
||
This file is part of the GNU MP Library. | ||
|
||
@@ -28,7 +28,6 @@ | ||
#include "gmp-impl.h" | ||
|
||
|
||
- | ||
mp_size_t | ||
mpn_dcpi1_bdiv_q_n_itch (mp_size_t n) | ||
{ | ||
@@ -130,7 +129,7 @@ | ||
qn = nn - qn; | ||
while (qn > dn) | ||
{ | ||
- mpn_sub_1 (np + dn, np + dn, qn, cy); | ||
+ mpn_sub_1 (np + dn, np + dn, qn - dn, cy); | ||
cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp); | ||
qp += dn; | ||
np += dn; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
Removed ChangeLog part | ||
|
||
# HG changeset patch | ||
# User Torbjorn Granlund <tege@gmplib.org> | ||
# Date 1342891151 -7200 | ||
# Node ID 829215e83ff1db3cd00e510a737092df691442d5 | ||
# Parent 816c18dbd492050ef8892e91602d9e758abc2988 | ||
Fix r0 clobbering issue with "large" code affecting elf+darwin PIC. | ||
|
||
diff -r 816c18dbd492 -r 829215e83ff1 mpn/powerpc32/vmx/mod_34lsub1.asm | ||
--- a/mpn/powerpc32/vmx/mod_34lsub1.asm Tue Jun 19 15:02:48 2012 +0200 | ||
+++ b/mpn/powerpc32/vmx/mod_34lsub1.asm Sat Jul 21 19:19:11 2012 +0200 | ||
@@ -1,6 +1,7 @@ | ||
dnl PowerPC-32 mpn_mod_34lsub1 -- mpn remainder mod 2^24-1. | ||
|
||
-dnl Copyright 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. | ||
+dnl Copyright 2002, 2003, 2005, 2006, 2007, 2012 Free Software Foundation, | ||
+dnl Inc. | ||
|
||
dnl This file is part of the GNU MP Library. | ||
|
||
@@ -135,15 +136,15 @@ | ||
|
||
andi. r7, up, 15 | ||
vxor a0, v0, v0 | ||
- lis r0, 0xaaaa | ||
+ lis r9, 0xaaaa | ||
vxor a1, v0, v0 | ||
- ori r0, r0, 0xaaab | ||
+ ori r9, r9, 0xaaab | ||
vxor a2, v0, v0 | ||
li r5, 16 | ||
vxor c0, v0, v0 | ||
li r6, 32 | ||
vxor c1, v0, v0 | ||
- LEAL( r11, cnsts) | ||
+ LEAL( r11, cnsts) C CAUTION clobbers r0 for elf, darwin | ||
vxor c2, v0, v0 | ||
vxor z, v0, v0 | ||
|
||
@@ -158,7 +159,7 @@ | ||
vsldoi a2, z, a2, 12 | ||
|
||
addi n, n, 9 | ||
- mulhwu r0, n, r0 | ||
+ mulhwu r0, n, r9 | ||
srwi r0, r0, 3 C r0 = floor(n/12) | ||
mtctr r0 | ||
|
||
@@ -174,7 +175,7 @@ | ||
vsldoi a1, z, a1, 8 | ||
|
||
addi n, n, 6 | ||
- mulhwu r0, n, r0 | ||
+ mulhwu r0, n, r9 | ||
srwi r0, r0, 3 C r0 = floor(n/12) | ||
mtctr r0 | ||
|
||
@@ -188,7 +189,7 @@ | ||
vsldoi a0, z, a0, 4 | ||
|
||
addi n, n, 3 | ||
- mulhwu r0, n, r0 | ||
+ mulhwu r0, n, r9 | ||
srwi r0, r0, 3 C r0 = floor(n/12) | ||
mtctr r0 | ||
|
||
@@ -197,7 +198,7 @@ | ||
b L(0) | ||
|
||
L(aligned16): | ||
- mulhwu r0, n, r0 | ||
+ mulhwu r0, n, r9 | ||
srwi r0, r0, 3 C r0 = floor(n/12) | ||
mtctr r0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
# HG changeset patch | ||
# User Torbjorn Granlund <tege@gmplib.org> | ||
# Date 1368052461 -7200 | ||
# Node ID 11fbd825bc45385d00b69c30bd7566acee11f0d2 | ||
# Parent bd4c950486ab4c161ea69b91c25150719c3cb700 | ||
Fix typo. | ||
|
||
diff -r bd4c950486ab -r 11fbd825bc45 mpn/x86_64/bd1/mul_1.asm | ||
--- a/mpn/x86_64/bd1/mul_1.asm Thu May 02 18:20:37 2013 +0200 | ||
+++ b/mpn/x86_64/bd1/mul_1.asm Thu May 09 00:34:21 2013 +0200 | ||
@@ -53,7 +53,7 @@ | ||
IFDOS(` define(`v0', ``%r9'') ') dnl | ||
IFDOS(` define(`r9', ``rdi'') ') dnl | ||
IFDOS(` define(`n', ``%r8'') ') dnl | ||
-IFDOS(` define(`r8', ``r11'') ') dnl | ||
+IFDOS(` define(`r8', ``rbx'') ') dnl | ||
|
||
ASM_START() | ||
TEXT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
# HG changeset patch | ||
# User Torbjorn Granlund <tege@gmplib.org> | ||
# Date 1363174284 -3600 | ||
# Node ID ec4d88674036804b26f22c6a2bfca6ae1e92d370 | ||
# Parent e616ff715c34e112d0a5f7535d31ffe1194a5c7d | ||
(mod): Adhere to mpn_mu_div_qr's overlap requirements. | ||
|
||
diff -r e616ff715c34 -r ec4d88674036 mpz/powm_ui.c | ||
--- a/mpz/powm_ui.c Sun Feb 17 19:40:16 2013 +0100 | ||
+++ b/mpz/powm_ui.c Wed Mar 13 12:31:24 2013 +0100 | ||
@@ -2,8 +2,8 @@ | ||
|
||
Contributed to the GNU project by Torbjorn Granlund. | ||
|
||
-Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2002, 2005, 2008, | ||
-2009, 2011, 2012 Free Software Foundation, Inc. | ||
+Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2002, 2005, 2008, 2009, | ||
+2011, 2012, 2013 Free Software Foundation, Inc. | ||
|
||
This file is part of the GNU MP Library. | ||
|
||
@@ -70,9 +70,14 @@ | ||
} | ||
else | ||
{ | ||
+ /* We need to allocate separate remainder area, since mpn_mu_div_qr does | ||
+ not handle overlap between the numerator and remainder areas. | ||
+ FIXME: Make it handle such overlap. */ | ||
+ mp_ptr rp = TMP_ALLOC_LIMBS (dn); | ||
mp_size_t itch = mpn_mu_div_qr_itch (nn, dn, 0); | ||
mp_ptr scratch = TMP_ALLOC_LIMBS (itch); | ||
- mpn_mu_div_qr (qp, np, np, nn, dp, dn, scratch); | ||
+ mpn_mu_div_qr (qp, rp, np, nn, dp, dn, scratch); | ||
+ MPN_COPY (np, rp, dn); | ||
} | ||
|
||
TMP_FREE; | ||
|
Oops, something went wrong.