diff options
-rw-r--r-- | doc/gmp.texi | 4 | ||||
-rw-r--r-- | mini-gmp/mini-gmp.h | 4 | ||||
-rw-r--r-- | mini-gmp/tests/hex-random.c | 22 | ||||
-rwxr-xr-x | mini-gmp/tests/run-tests | 13 | ||||
-rw-r--r-- | mini-gmp/tests/t-add.c | 4 | ||||
-rw-r--r-- | mini-gmp/tests/t-div.c | 2 | ||||
-rw-r--r-- | mini-gmp/tests/t-div_2exp.c | 2 | ||||
-rw-r--r-- | mini-gmp/tests/t-gcd.c | 6 | ||||
-rw-r--r-- | mini-gmp/tests/t-invert.c | 2 | ||||
-rw-r--r-- | mini-gmp/tests/t-lcm.c | 2 | ||||
-rw-r--r-- | mini-gmp/tests/t-logops.c | 4 | ||||
-rw-r--r-- | mini-gmp/tests/t-mul.c | 4 | ||||
-rw-r--r-- | mini-gmp/tests/t-powm.c | 4 | ||||
-rw-r--r-- | mini-gmp/tests/t-reuse.c | 4 | ||||
-rw-r--r-- | mini-gmp/tests/t-scan.c | 2 | ||||
-rw-r--r-- | mini-gmp/tests/t-sqrt.c | 8 | ||||
-rw-r--r-- | mini-gmp/tests/t-str.c | 6 | ||||
-rw-r--r-- | mini-gmp/tests/t-sub.c | 4 | ||||
-rw-r--r-- | mpn/x86_64/bd1/aorsmul_1.asm | 10 | ||||
-rw-r--r-- | mpn/x86_64/bd1/mul_1.asm | 10 | ||||
-rw-r--r-- | mpn/x86_64/core2/aorsmul_1.asm | 17 | ||||
-rw-r--r-- | mpn/x86_64/coreisbr/aorsmul_1.asm | 2 | ||||
-rw-r--r-- | mpn/x86_64/coreisbr/mul_1.asm | 20 |
23 files changed, 77 insertions, 79 deletions
diff --git a/doc/gmp.texi b/doc/gmp.texi index ca89add0a..df78a08f5 100644 --- a/doc/gmp.texi +++ b/doc/gmp.texi @@ -9035,10 +9035,10 @@ $$\mathop{\rm L}(p,n) = \sum_{i>0}\left\lfloor{n\over p^i}\right\rfloor\bmod2 @example --- - \ n + \ n L(p,n) = / [---] mod 2 <= log (n) . --- p^i p - i>0 + i>0 @end example @end ifnottex diff --git a/mini-gmp/mini-gmp.h b/mini-gmp/mini-gmp.h index 38402e72e..927784c5d 100644 --- a/mini-gmp/mini-gmp.h +++ b/mini-gmp/mini-gmp.h @@ -120,10 +120,10 @@ void mpz_ui_sub (mpz_t, unsigned long, const mpz_t); void mpz_sub (mpz_t, const mpz_t, const mpz_t); void mpz_mul_si (mpz_t, const mpz_t, long int); -void mpz_mul_ui (mpz_t, const mpz_t, unsigned long int); +void mpz_mul_ui (mpz_t, const mpz_t, unsigned long int); void mpz_mul (mpz_t, const mpz_t, const mpz_t); void mpz_mul_2exp (mpz_t, const mpz_t, mp_bitcnt_t); - + void mpz_cdiv_qr (mpz_t, mpz_t, const mpz_t, const mpz_t); void mpz_fdiv_qr (mpz_t, mpz_t, const mpz_t, const mpz_t); void mpz_tdiv_qr (mpz_t, mpz_t, const mpz_t, const mpz_t); diff --git a/mini-gmp/tests/hex-random.c b/mini-gmp/tests/hex-random.c index fae02034c..260b3cdce 100644 --- a/mini-gmp/tests/hex-random.c +++ b/mini-gmp/tests/hex-random.c @@ -44,7 +44,7 @@ hex_random_init (void) else { seed = time(NULL) + getpid(); - printf ("Seed GMP_CHECK_RANDOMIZE=%lu (include this in bug reports)\n", seed); + printf ("Seed GMP_CHECK_RANDOMIZE=%lu (include this in bug reports)\n", seed); } } else @@ -94,7 +94,7 @@ hex_random_op (enum hex_random_op op, unsigned long maxbits, abits = gmp_urandomb_ui (state, 32) % maxbits; bbits = gmp_urandomb_ui (state, 32) % maxbits; - + mpz_rrandomb (a, state, abits); mpz_rrandomb (b, state, bbits); @@ -156,7 +156,7 @@ hex_random_op (enum hex_random_op op, unsigned long maxbits, mpz_clear (a); mpz_clear (b); - mpz_clear (r); + mpz_clear (r); } void @@ -182,7 +182,7 @@ hex_random_op4 (enum hex_random_op op, unsigned long maxbits, mpz_rrandomb (a, state, abits); mpz_rrandomb (b, state, bbits); mpz_rrandomb (c, state, cbits); - + signs = gmp_urandomb_ui (state, 3); if (signs & 1) mpz_neg (a, a); @@ -255,8 +255,8 @@ hex_random_op4 (enum hex_random_op op, unsigned long maxbits, mpz_clear (a); mpz_clear (b); - mpz_clear (c); - mpz_clear (d); + mpz_clear (c); + mpz_clear (d); } void @@ -272,7 +272,7 @@ hex_random_bit_op (enum hex_random_op op, unsigned long maxbits, abits = gmp_urandomb_ui (state, 32) % maxbits; bbits = gmp_urandomb_ui (state, 32) % (maxbits + 100); - + mpz_rrandomb (a, state, abits); signs = gmp_urandomb_ui (state, 1); @@ -313,7 +313,7 @@ hex_random_bit_op (enum hex_random_op op, unsigned long maxbits, break; case OP_TDIV_R_2: mpz_tdiv_r_2exp (r, a, bbits); - break; + break; } gmp_asprintf (ap, "%Zx", a); @@ -321,7 +321,7 @@ hex_random_bit_op (enum hex_random_op op, unsigned long maxbits, gmp_asprintf (rp, "%Zx", r); mpz_clear (a); - mpz_clear (r); + mpz_clear (r); } void @@ -336,7 +336,7 @@ hex_random_scan_op (enum hex_random_op op, unsigned long maxbits, abits = gmp_urandomb_ui (state, 32) % maxbits; bbits = gmp_urandomb_ui (state, 32) % (maxbits + 100); - + mpz_rrandomb (a, state, abits); signs = gmp_urandomb_ui (state, 1); @@ -372,7 +372,7 @@ hex_random_str_op (unsigned long maxbits, mpz_init (a); abits = gmp_urandomb_ui (state, 32) % maxbits; - + mpz_rrandomb (a, state, abits); signs = gmp_urandomb_ui (state, 2); diff --git a/mini-gmp/tests/run-tests b/mini-gmp/tests/run-tests index 560cc4e0f..18ca334e2 100755 --- a/mini-gmp/tests/run-tests +++ b/mini-gmp/tests/run-tests @@ -13,7 +13,7 @@ fi export srcdir # When used in make rules, we sometimes get the filenames VPATH -# expanded, but usually not. +# expanded, but usually not. find_program () { case "$1" in */*) @@ -48,14 +48,14 @@ test_program () { fi case "$?" in 0) - echo PASS: $testname + echo PASS: $testname all=`expr $all + 1` ;; 77) - echo SKIP: $testname + echo SKIP: $testname ;; *) - echo FAIL: $testname + echo FAIL: $testname failed=`expr $failed + 1` all=`expr $all + 1` ;; @@ -74,7 +74,7 @@ do testflags='-v' ;; -*) - echo >&2 'Unknown option `'"$1'" + echo >&2 'Unknown option `'"$1'" exit 1 ;; *) @@ -83,7 +83,7 @@ do esac shift done - + if [ $# -eq 0 ] ; then for f in *-test; do test_program "./$f"; done else @@ -105,4 +105,3 @@ if [ "x$debug" = xno ] ; then fi [ "$failed" -eq 0 ] - diff --git a/mini-gmp/tests/t-add.c b/mini-gmp/tests/t-add.c index d688e07eb..e3bd14a8b 100644 --- a/mini-gmp/tests/t-add.c +++ b/mini-gmp/tests/t-add.c @@ -19,14 +19,14 @@ main (int argc, char **argv) { unsigned i; mpz_t a, b, res, ref; - + hex_random_init (); mpz_init (a); mpz_init (b); mpz_init (res); mpz_init (ref); - + for (i = 0; i < COUNT; i++) { mini_random_op (OP_ADD, MAXBITS, a, b, ref); diff --git a/mini-gmp/tests/t-div.c b/mini-gmp/tests/t-div.c index 546680f0b..89bf21861 100644 --- a/mini-gmp/tests/t-div.c +++ b/mini-gmp/tests/t-div.c @@ -48,7 +48,7 @@ main (int argc, char **argv) { mpz_cdiv_qr_ui, mpz_fdiv_qr_ui, mpz_tdiv_qr_ui }; - + mini_random_op4 (ops[j], MAXBITS, a, b, rq, rr); div[j] (q, r, a, b); if (mpz_cmp (r, rr) || mpz_cmp (q, rq)) diff --git a/mini-gmp/tests/t-div_2exp.c b/mini-gmp/tests/t-div_2exp.c index 69b89f75f..02ee80313 100644 --- a/mini-gmp/tests/t-div_2exp.c +++ b/mini-gmp/tests/t-div_2exp.c @@ -53,7 +53,7 @@ main (int argc, char **argv) mpz_fdiv_q_2exp, mpz_fdiv_r_2exp, mpz_tdiv_q_2exp, mpz_tdiv_r_2exp }; - + mini_random_bit_op (ops[j], MAXBITS, a, &b, ref); div[j] (res, a, b); if (mpz_cmp (ref, res)) diff --git a/mini-gmp/tests/t-gcd.c b/mini-gmp/tests/t-gcd.c index b54cc108f..2c80cc326 100644 --- a/mini-gmp/tests/t-gcd.c +++ b/mini-gmp/tests/t-gcd.c @@ -57,7 +57,7 @@ gcdext_valid_p (const mpz_t a, const mpz_t b, mpz_clear (tb); mpz_clear (r); return 0; - } + } mpz_tdiv_qr (ta, r, a, g); if (mpz_sgn (r) != 0) goto fail; @@ -89,7 +89,7 @@ main (int argc, char **argv) { unsigned i; mpz_t a, b, g, s, t; - + hex_random_init (); mpz_init (a); @@ -130,7 +130,7 @@ main (int argc, char **argv) mpz_neg (a, a); if (flags & 2) mpz_neg (b, b); - + mpz_gcdext (g, s, t, a, b); if (!gcdext_valid_p (a, b, g, s, t)) { diff --git a/mini-gmp/tests/t-invert.c b/mini-gmp/tests/t-invert.c index 1d538e425..85f82d1e7 100644 --- a/mini-gmp/tests/t-invert.c +++ b/mini-gmp/tests/t-invert.c @@ -61,7 +61,7 @@ main (int argc, char **argv) mpz_setbit (u, 2*GMP_LIMB_BITS -1); mpz_set_ui (m, mpn_invert_3by2 (u[0]._mp_d[1], u[0]._mp_d[0])); - + mpz_setbit (m, GMP_LIMB_BITS); mpz_mul (p, m, u); diff --git a/mini-gmp/tests/t-lcm.c b/mini-gmp/tests/t-lcm.c index 5255b4f27..fe55c6653 100644 --- a/mini-gmp/tests/t-lcm.c +++ b/mini-gmp/tests/t-lcm.c @@ -20,7 +20,7 @@ main (int argc, char **argv) { unsigned i; mpz_t a, b, g, s; - + hex_random_init (); mpz_init (a); diff --git a/mini-gmp/tests/t-logops.c b/mini-gmp/tests/t-logops.c index 06561d831..a037d221f 100644 --- a/mini-gmp/tests/t-logops.c +++ b/mini-gmp/tests/t-logops.c @@ -20,14 +20,14 @@ main (int argc, char **argv) { unsigned i; mpz_t a, b, res, ref; - + hex_random_init (); mpz_init (a); mpz_init (b); mpz_init (res); mpz_init (ref); - + for (i = 0; i < COUNT; i++) { mini_random_op (OP_AND, MAXBITS, a, b, ref); diff --git a/mini-gmp/tests/t-mul.c b/mini-gmp/tests/t-mul.c index d29308a8e..1affb47d3 100644 --- a/mini-gmp/tests/t-mul.c +++ b/mini-gmp/tests/t-mul.c @@ -20,14 +20,14 @@ main (int argc, char **argv) { unsigned i; mpz_t a, b, res, ref; - + hex_random_init (); mpz_init (a); mpz_init (b); mpz_init (res); mpz_init (ref); - + for (i = 0; i < COUNT; i++) { mini_random_op (OP_MUL, MAXBITS, a, b, ref); diff --git a/mini-gmp/tests/t-powm.c b/mini-gmp/tests/t-powm.c index 1f71f2114..ba494201c 100644 --- a/mini-gmp/tests/t-powm.c +++ b/mini-gmp/tests/t-powm.c @@ -20,7 +20,7 @@ main (int argc, char **argv) { unsigned i; mpz_t b, e, m, res, ref; - + hex_random_init (); mpz_init (b); @@ -28,7 +28,7 @@ main (int argc, char **argv) mpz_init (m); mpz_init (res); mpz_init (ref); - + for (i = 0; i < COUNT; i++) { mini_random_op4 (OP_POWM, MAXBITS, b, e, m, ref); diff --git a/mini-gmp/tests/t-reuse.c b/mini-gmp/tests/t-reuse.c index a226938f1..0ecaeac8d 100644 --- a/mini-gmp/tests/t-reuse.c +++ b/mini-gmp/tests/t-reuse.c @@ -656,12 +656,12 @@ mpz_check_format (const mpz_t x) if (n > x->_mp_alloc) { fprintf (stderr, "mpz_t size exceeds allocation!\n"); - abort (); + abort (); } if (n > 0 && x->_mp_d[n-1] == 0) { fprintf (stderr, "Unnormalized mpz_t!\n"); abort (); - } + } } diff --git a/mini-gmp/tests/t-scan.c b/mini-gmp/tests/t-scan.c index 8ac7e27b4..9c66ff132 100644 --- a/mini-gmp/tests/t-scan.c +++ b/mini-gmp/tests/t-scan.c @@ -25,7 +25,7 @@ main (int argc, char **argv) hex_random_init (); mpz_init (a); - + for (i = 0; i < COUNT; i++) { mini_random_scan_op (OP_SCAN0, MAXBITS, a, &b, &ref); diff --git a/mini-gmp/tests/t-sqrt.c b/mini-gmp/tests/t-sqrt.c index 0105da26b..c5449a753 100644 --- a/mini-gmp/tests/t-sqrt.c +++ b/mini-gmp/tests/t-sqrt.c @@ -36,9 +36,9 @@ sqrtrem_valid_p (const mpz_t u, const mpz_t s, const mpz_t r) mpz_clear (t); return 0; } - + mpz_clear (t); - return 1; + return 1; } int @@ -46,13 +46,13 @@ main (int argc, char **argv) { unsigned i; mpz_t u, s, r; - + hex_random_init (); mpz_init (u); mpz_init (s); mpz_init (r); - + for (i = 0; i < COUNT; i++) { mini_rrandomb (u, MAXBITS); diff --git a/mini-gmp/tests/t-str.c b/mini-gmp/tests/t-str.c index 4d6529742..c7cf55f18 100644 --- a/mini-gmp/tests/t-str.c +++ b/mini-gmp/tests/t-str.c @@ -26,7 +26,7 @@ main (int argc, char **argv) size_t bn, rn, arn; mpz_t a, b; - + hex_random_init (); mpz_init (a); @@ -52,7 +52,7 @@ main (int argc, char **argv) { fprintf (stderr, "mpz_sizeinbase failed:\n"); dump ("a", a); - fprintf (stderr, "r = %s\n", rp); + fprintf (stderr, "r = %s\n", rp); fprintf (stderr, " base %d, correct size %u, got %u\n", base, (unsigned) arn, (unsigned)bn); abort (); @@ -82,7 +82,7 @@ main (int argc, char **argv) abort (); } free (ap); - free (bp); + free (bp); } } mpz_clear (a); diff --git a/mini-gmp/tests/t-sub.c b/mini-gmp/tests/t-sub.c index ba740b9e7..dfdd16523 100644 --- a/mini-gmp/tests/t-sub.c +++ b/mini-gmp/tests/t-sub.c @@ -19,14 +19,14 @@ main (int argc, char **argv) { unsigned i; mpz_t a, b, res, ref; - + hex_random_init (); mpz_init (a); mpz_init (b); mpz_init (res); mpz_init (ref); - + for (i = 0; i < COUNT; i++) { mini_random_op (OP_SUB, MAXBITS, a, b, ref); diff --git a/mpn/x86_64/bd1/aorsmul_1.asm b/mpn/x86_64/bd1/aorsmul_1.asm index 2a44f0a39..9cf5db962 100644 --- a/mpn/x86_64/bd1/aorsmul_1.asm +++ b/mpn/x86_64/bd1/aorsmul_1.asm @@ -22,15 +22,15 @@ include(`../config.m4') C cycles/limb C AMD K8,K9 -C AMD K10 +C AMD K10 C AMD bd1 4.5-4.7 -C AMD bobcat -C Intel P4 +C AMD bobcat +C Intel P4 C Intel core2 C Intel NHM -C Intel SBR +C Intel SBR C Intel atom -C VIA nano +C VIA nano C The loop of this code is the result of running a code generation and C optimisation tool suite written by David Harvey and Torbjorn Granlund. diff --git a/mpn/x86_64/bd1/mul_1.asm b/mpn/x86_64/bd1/mul_1.asm index 2b2378ee5..3273f8f1a 100644 --- a/mpn/x86_64/bd1/mul_1.asm +++ b/mpn/x86_64/bd1/mul_1.asm @@ -22,15 +22,15 @@ include(`../config.m4') C cycles/limb C AMD K8,K9 -C AMD K10 +C AMD K10 C AMD bd1 4 -C AMD bobcat -C Intel P4 +C AMD bobcat +C Intel P4 C Intel core2 C Intel NHM -C Intel SBR +C Intel SBR C Intel atom -C VIA nano +C VIA nano C The loop of this code is the result of running a code generation and C optimisation tool suite written by David Harvey and Torbjorn Granlund. diff --git a/mpn/x86_64/core2/aorsmul_1.asm b/mpn/x86_64/core2/aorsmul_1.asm index 5a2340c51..9d7894797 100644 --- a/mpn/x86_64/core2/aorsmul_1.asm +++ b/mpn/x86_64/core2/aorsmul_1.asm @@ -1,6 +1,6 @@ dnl x86-64 mpn_addmul_1 and mpn_submul_1, optimized for "Core 2". -dnl Copyright 2003, 2004, 2005, 2007, 2008, 2009, 2011 Free Software +dnl Copyright 2003, 2004, 2005, 2007, 2008, 2009, 2011, 2012 Free Software dnl Foundation, Inc. dnl This file is part of the GNU MP Library. @@ -24,7 +24,7 @@ C cycles/limb C AMD K8,K9 4 C AMD K10 4 C AMD bd1 5.1 -C AMD bobcat +C AMD bobcat C Intel P4 ? C Intel core2 4.3-4.5 (fluctuating) C Intel NHM 5.0 @@ -40,12 +40,12 @@ define(`v0', `%rcx') ifdef(`OPERATION_addmul_1',` define(`ADDSUB', `add') - define(`func', `mpn_addmul_1') + define(`func', `mpn_addmul_1') define(`func_1c', `mpn_addmul_1c') ') ifdef(`OPERATION_submul_1',` define(`ADDSUB', `sub') - define(`func', `mpn_submul_1') + define(`func', `mpn_submul_1') define(`func_1c', `mpn_submul_1c') ') @@ -54,13 +54,12 @@ MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c) ABI_SUPPORT(DOS64) ABI_SUPPORT(STD64) - C For DOS, on the stack we have four saved registers, return - C address, space for four register arguments, and finally the - C carry input. - + C For DOS, on the stack we have four saved registers, return address, + C space for four register arguments, and finally the carry input. + IFDOS(` define(`carry_in', `72(%rsp)')') dnl IFSTD(` define(`carry_in', `%r8')') dnl - + ASM_START() TEXT ALIGN(16) diff --git a/mpn/x86_64/coreisbr/aorsmul_1.asm b/mpn/x86_64/coreisbr/aorsmul_1.asm index 69162887b..d9a0b716b 100644 --- a/mpn/x86_64/coreisbr/aorsmul_1.asm +++ b/mpn/x86_64/coreisbr/aorsmul_1.asm @@ -165,7 +165,7 @@ L(L2): adc $0, %r11 ADDSUB %r9, %r10 adc $0, %r11 mov %r10, (rp,n,8) - add $4, n + add $4, n jnc L(top) L(end): mul v0 diff --git a/mpn/x86_64/coreisbr/mul_1.asm b/mpn/x86_64/coreisbr/mul_1.asm index d9fa2947a..6769429aa 100644 --- a/mpn/x86_64/coreisbr/mul_1.asm +++ b/mpn/x86_64/coreisbr/mul_1.asm @@ -21,16 +21,16 @@ dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. include(`../config.m4') C cycles/limb -C AMD K8,K9 -C AMD K10 -C AMD bd1 -C AMD bobcat -C Intel P4 -C Intel core2 -C Intel NHM -C Intel SBR -C Intel atom -C VIA nano +C AMD K8,K9 +C AMD K10 +C AMD bd1 +C AMD bobcat +C Intel P4 +C Intel core2 +C Intel NHM +C Intel SBR +C Intel atom +C VIA nano C The loop of this code is the result of running a code generation and C optimisation tool suite written by David Harvey and Torbjorn Granlund. |