[Gmp-commit] /var/hg/gmp: 2 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Sat Mar 3 00:54:47 CET 2012


details:   /var/hg/gmp/rev/12a897853dc9
changeset: 14712:12a897853dc9
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Mar 03 00:53:33 2012 +0100
description:
Whitespace cleanup, add a copyright year.

details:   /var/hg/gmp/rev/17c03ad3e866
changeset: 14713:17c03ad3e866
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Mar 03 00:54:45 2012 +0100
description:
Trivial merge.

diffstat:

 ChangeLog                         |   5 +++++
 doc/gmp.texi                      |   6 +++---
 mini-gmp/mini-gmp.h               |   4 ++--
 mini-gmp/tests/hex-random.c       |  22 +++++++++++-----------
 mini-gmp/tests/run-tests          |  13 ++++++-------
 mini-gmp/tests/t-add.c            |   4 ++--
 mini-gmp/tests/t-div.c            |   2 +-
 mini-gmp/tests/t-div_2exp.c       |   2 +-
 mini-gmp/tests/t-gcd.c            |   6 +++---
 mini-gmp/tests/t-invert.c         |   2 +-
 mini-gmp/tests/t-lcm.c            |   2 +-
 mini-gmp/tests/t-logops.c         |   4 ++--
 mini-gmp/tests/t-mul.c            |   4 ++--
 mini-gmp/tests/t-powm.c           |   4 ++--
 mini-gmp/tests/t-reuse.c          |   4 ++--
 mini-gmp/tests/t-scan.c           |   2 +-
 mini-gmp/tests/t-sqrt.c           |   8 ++++----
 mini-gmp/tests/t-str.c            |   6 +++---
 mini-gmp/tests/t-sub.c            |   4 ++--
 mpn/x86_64/bd1/aorsmul_1.asm      |  10 +++++-----
 mpn/x86_64/bd1/mul_1.asm          |  10 +++++-----
 mpn/x86_64/core2/aorsmul_1.asm    |  17 ++++++++---------
 mpn/x86_64/coreisbr/aorsmul_1.asm |   2 +-
 mpn/x86_64/coreisbr/mul_1.asm     |  20 ++++++++++----------
 tests/mpz/t-invert.c              |   2 +-
 25 files changed, 84 insertions(+), 81 deletions(-)

diffs (truncated from 626 to 300 lines):

diff -r 21270e2808d8 -r 17c03ad3e866 ChangeLog
--- a/ChangeLog	Thu Mar 01 17:07:50 2012 +0100
+++ b/ChangeLog	Sat Mar 03 00:54:45 2012 +0100
@@ -1,3 +1,8 @@
+2012-03-01 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* doc/gmp.texi (mpz_invert): Correctly document result range.
+	* tests/mpz/t-invert.c: Small range correction.
+
 2012-03-01  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/x86_64/mullo_basecase.asm: New file.
diff -r 21270e2808d8 -r 17c03ad3e866 doc/gmp.texi
--- a/doc/gmp.texi	Thu Mar 01 17:07:50 2012 +0100
+++ b/doc/gmp.texi	Sat Mar 03 00:54:45 2012 +0100
@@ -3585,7 +3585,7 @@
 @cindex Inverse modulo functions
 Compute the inverse of @var{op1} modulo @var{op2} and put the result in
 @var{rop}.  If the inverse exists, the return value is non-zero and @var{rop}
-will satisfy @math{0 < @var{rop} < @var{op2}}.  If an inverse doesn't exist
+will satisfy @math{0 < @var{rop} < @var{@GMPabs{op2}}}.  If an inverse doesn't exist
 the return value is zero and @var{rop} is undefined.
 @end deftypefun
 
@@ -9035,10 +9035,10 @@
 
 @example
           ---
-           \    n                   
+           \    n
 L(p,n) =   /  [---] mod 2   <=  log (n) .
           ---  p^i                p
-          i>0    
+          i>0
 @end example
 @end ifnottex
 
diff -r 21270e2808d8 -r 17c03ad3e866 mini-gmp/mini-gmp.h
--- a/mini-gmp/mini-gmp.h	Thu Mar 01 17:07:50 2012 +0100
+++ b/mini-gmp/mini-gmp.h	Sat Mar 03 00:54:45 2012 +0100
@@ -120,10 +120,10 @@
 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 -r 21270e2808d8 -r 17c03ad3e866 mini-gmp/tests/hex-random.c
--- a/mini-gmp/tests/hex-random.c	Thu Mar 01 17:07:50 2012 +0100
+++ b/mini-gmp/tests/hex-random.c	Sat Mar 03 00:54:45 2012 +0100
@@ -44,7 +44,7 @@
       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 @@
 
   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 @@
 
   mpz_clear (a);
   mpz_clear (b);
-  mpz_clear (r);  
+  mpz_clear (r);
 }
 
 void
@@ -182,7 +182,7 @@
       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 @@
 
   mpz_clear (a);
   mpz_clear (b);
-  mpz_clear (c);  
-  mpz_clear (d);  
+  mpz_clear (c);
+  mpz_clear (d);
 }
 
 void
@@ -272,7 +272,7 @@
 
   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 @@
       break;
     case OP_TDIV_R_2:
       mpz_tdiv_r_2exp (r, a, bbits);
-      break;      
+      break;
     }
 
   gmp_asprintf (ap, "%Zx", a);
@@ -321,7 +321,7 @@
   gmp_asprintf (rp, "%Zx", r);
 
   mpz_clear (a);
-  mpz_clear (r);  
+  mpz_clear (r);
 }
 
 void
@@ -336,7 +336,7 @@
 
   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 @@
   mpz_init (a);
 
   abits = gmp_urandomb_ui (state, 32) % maxbits;
-  
+
   mpz_rrandomb (a, state, abits);
 
   signs = gmp_urandomb_ui (state, 2);
diff -r 21270e2808d8 -r 17c03ad3e866 mini-gmp/tests/run-tests
--- a/mini-gmp/tests/run-tests	Thu Mar 01 17:07:50 2012 +0100
+++ b/mini-gmp/tests/run-tests	Sat Mar 03 00:54:45 2012 +0100
@@ -13,7 +13,7 @@
 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 @@
   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 @@
     testflags='-v'
     ;;
   -*)
-    echo >&2 'Unknown option `'"$1'" 
+    echo >&2 'Unknown option `'"$1'"
     exit 1
     ;;
   *)
@@ -83,7 +83,7 @@
   esac
   shift
 done
-  
+
 if [ $# -eq 0 ] ; then
   for f in *-test; do test_program "./$f"; done
 else
@@ -105,4 +105,3 @@
 fi
 
 [ "$failed" -eq 0 ]
-
diff -r 21270e2808d8 -r 17c03ad3e866 mini-gmp/tests/t-add.c
--- a/mini-gmp/tests/t-add.c	Thu Mar 01 17:07:50 2012 +0100
+++ b/mini-gmp/tests/t-add.c	Sat Mar 03 00:54:45 2012 +0100
@@ -19,14 +19,14 @@
 {
   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 -r 21270e2808d8 -r 17c03ad3e866 mini-gmp/tests/t-div.c
--- a/mini-gmp/tests/t-div.c	Thu Mar 01 17:07:50 2012 +0100
+++ b/mini-gmp/tests/t-div.c	Sat Mar 03 00:54:45 2012 +0100
@@ -48,7 +48,7 @@
 	    {
 	      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 -r 21270e2808d8 -r 17c03ad3e866 mini-gmp/tests/t-div_2exp.c
--- a/mini-gmp/tests/t-div_2exp.c	Thu Mar 01 17:07:50 2012 +0100
+++ b/mini-gmp/tests/t-div_2exp.c	Sat Mar 03 00:54:45 2012 +0100
@@ -53,7 +53,7 @@
 	      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 -r 21270e2808d8 -r 17c03ad3e866 mini-gmp/tests/t-gcd.c
--- a/mini-gmp/tests/t-gcd.c	Thu Mar 01 17:07:50 2012 +0100
+++ b/mini-gmp/tests/t-gcd.c	Sat Mar 03 00:54:45 2012 +0100
@@ -57,7 +57,7 @@
       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 @@
 {
   unsigned i;
   mpz_t a, b, g, s, t;
-  
+
   hex_random_init ();
 
   mpz_init (a);
@@ -130,7 +130,7 @@
 	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 -r 21270e2808d8 -r 17c03ad3e866 mini-gmp/tests/t-invert.c
--- a/mini-gmp/tests/t-invert.c	Thu Mar 01 17:07:50 2012 +0100
+++ b/mini-gmp/tests/t-invert.c	Sat Mar 03 00:54:45 2012 +0100
@@ -61,7 +61,7 @@
       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 -r 21270e2808d8 -r 17c03ad3e866 mini-gmp/tests/t-lcm.c
--- a/mini-gmp/tests/t-lcm.c	Thu Mar 01 17:07:50 2012 +0100
+++ b/mini-gmp/tests/t-lcm.c	Sat Mar 03 00:54:45 2012 +0100
@@ -20,7 +20,7 @@
 {
   unsigned i;
   mpz_t a, b, g, s;
-  
+
   hex_random_init ();
 
   mpz_init (a);
diff -r 21270e2808d8 -r 17c03ad3e866 mini-gmp/tests/t-logops.c


More information about the gmp-commit mailing list