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

mercurial at gmplib.org mercurial at gmplib.org
Tue Oct 4 00:24:10 CEST 2011


details:   /var/hg/gmp/rev/ce976cb8d2d1
changeset: 14255:ce976cb8d2d1
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Oct 04 00:10:44 2011 +0200
description:
Run 25 mpz_millerrabin tests (was 10).

details:   /var/hg/gmp/rev/b7b24abaac22
changeset: 14256:b7b24abaac22
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Oct 04 00:12:26 2011 +0200
description:
Run 25 Miller-Rabin tests.

details:   /var/hg/gmp/rev/45bd3dc0ffa0
changeset: 14257:45bd3dc0ffa0
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Oct 04 00:13:40 2011 +0200
description:
Fix typo.

details:   /var/hg/gmp/rev/2f2c367d62d3
changeset: 14258:2f2c367d62d3
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Oct 04 00:20:59 2011 +0200
description:
(Custom Allocation): Rephrase a paragraph.

details:   /var/hg/gmp/rev/539563537221
changeset: 14259:539563537221
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Oct 04 00:22:04 2011 +0200
description:
Directory mpn/s390 renamed.

details:   /var/hg/gmp/rev/371ab4c8d9cb
changeset: 14260:371ab4c8d9cb
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Oct 04 00:24:02 2011 +0200
description:
*** empty log message ***

diffstat:

 ChangeLog                   |  10 ++++-
 demos/factorize.c           |   6 +-
 doc/gmp.texi                |  18 ++++-----
 mpn/s390/README             |  37 --------------------
 mpn/s390/addmul_1.asm       |  82 ---------------------------------------------
 mpn/s390/gmp-mparam.h       |  54 -----------------------------
 mpn/s390/mul_1.asm          |  74 ----------------------------------------
 mpn/s390/submul_1.asm       |  82 ---------------------------------------------
 mpn/s390_32/esame/add_n.asm |   2 +-
 mpz/nextprime.c             |   2 +-
 10 files changed, 22 insertions(+), 345 deletions(-)

diffs (truncated from 476 to 300 lines):

diff -r 0225fcaacf23 -r 371ab4c8d9cb ChangeLog
--- a/ChangeLog	Tue Oct 04 00:06:08 2011 +0200
+++ b/ChangeLog	Tue Oct 04 00:24:02 2011 +0200
@@ -1,3 +1,11 @@
+2011-10-04  Torbjorn Granlund  <tege at gmplib.org>
+
+	* doc/gmp.texi (Custom Allocation): Rephrase a paragraph.
+
+	* demos/factorize.c: Run 25 Miller-Rabin tests.
+
+	* mpz/nextprime.c: Run 25 mpz_millerrabin tests (was 10).
+
 2011-10-03  Torbjorn Granlund  <tege at gmplib.org>
 
 	* configure.in: Support s390x.
@@ -4473,7 +4481,7 @@
 
 	* nextprime.c: New file.
 	* gmp-impl.h (gmp_primesieve_t, gmp_init_primesieve, gmp_nextprime):
-	Declare
+	Declare.
 	* Makefile.am (libgmp_la_SOURCES): Add nextprime.c.
 
 2009-06-11  Torbjorn Granlund  <tege at gmplib.org>
diff -r 0225fcaacf23 -r 371ab4c8d9cb demos/factorize.c
--- a/demos/factorize.c	Tue Oct 04 00:06:08 2011 +0200
+++ b/demos/factorize.c	Tue Oct 04 00:24:02 2011 +0200
@@ -231,7 +231,7 @@
 
       mpz_divexact (n, n, t1);	/* divide by t1, before t1 is overwritten */
 
-      if (!mpz_probab_prime_p (t1, 10))
+      if (!mpz_probab_prime_p (t1, 25))
 	{
 	  do
 	    {
@@ -257,7 +257,7 @@
       mpz_mod (x, x, n);
       mpz_mod (x1, x1, n);
       mpz_mod (y, y, n);
-      if (mpz_probab_prime_p (n, 10))
+      if (mpz_probab_prime_p (n, 25))
 	{
 	  mpz_out_str (stdout, 10, n);
 	  fflush (stdout);
@@ -296,7 +296,7 @@
 	  printf ("[is number prime?] ");
 	  fflush (stdout);
 	}
-      if (mpz_probab_prime_p (t, 10))
+      if (mpz_probab_prime_p (t, 25))
 	mpz_out_str (stdout, 10, t);
       else
 	factor_using_pollard_rho (t, 1L, p);
diff -r 0225fcaacf23 -r 371ab4c8d9cb doc/gmp.texi
--- a/doc/gmp.texi	Tue Oct 04 00:06:08 2011 +0200
+++ b/doc/gmp.texi	Tue Oct 04 00:24:02 2011 +0200
@@ -3529,10 +3529,9 @@
 @deftypefun void mpz_gcd (mpz_t @var{rop}, mpz_t @var{op1}, mpz_t @var{op2})
 @cindex Greatest common divisor functions
 @cindex GCD functions
-Set @var{rop} to the greatest common divisor of @var{op1} and @var{op2}. The
+Set @var{rop} to the greatest common divisor of @var{op1} and @var{op2}.  The
 result is always positive even if one or both input operands are negative.
-Except if both inputs are zero; then this function defines @math{gcd(0,0) =
-0}.
+Except if both inputs are zero; then this function defines @math{gcd(0,0) = 0}.
 @end deftypefun
 
 @deftypefun {unsigned long int} mpz_gcd_ui (mpz_t @var{rop}, mpz_t @var{op1}, unsigned long int @var{op2})
@@ -5382,8 +5381,8 @@
 0} if and only if @math{V} divides @math{U} (i.e., @math{G = V}).
 
 Store @math{G} at @var{gp} and let the return value define its limb count.
-Store @math{S} at @var{sp} and let |*@var{sn}| define its limb count. @math{S}
-can be negative; when this happens *@var{sn} will be negative. The area at
+Store @math{S} at @var{sp} and let |*@var{sn}| define its limb count.  @math{S}
+can be negative; when this happens *@var{sn} will be negative.  The area at
 @var{gp} should have room for @var{vn} limbs and the area at @var{sp} should
 have room for @math{@var{vn}+1} limbs.
 
@@ -5396,7 +5395,6 @@
 @{@var{vp}, @math{@var{vn}+1}@} were destroyed (i.e.@: the operands plus an
 extra limb past the end of each), and the areas pointed to by @var{gp} and
 @var{sp} should each have room for @math{@var{un}+1} limbs.
-
 @end deftypefun
 
 @deftypefun mp_size_t mpn_sqrtrem (mp_limb_t *@var{r1p}, mp_limb_t *@var{r2p}, const mp_limb_t *@var{sp}, mp_size_t @var{n})
@@ -7010,10 +7008,10 @@
 
 A @dfn{byte} here means the unit used by the @code{sizeof} operator.
 
-The @var{old_size} parameters to @var{reallocate_function} and
- at var{free_function} are passed for convenience, but of course can be ignored
-if not needed.  The default functions using @code{malloc} and friends for
-instance don't use them.
+The @var{reallocate_function} parameter @var{old_size} and the
+ at var{free_function} parameter @var{size} are passed for convenience, but of
+course they can be ignored if not needed by an implementation.  The default
+functions using @code{malloc} and friends for instance don't use them.
 
 No error return is allowed from any of these functions, if they return then
 they must have performed the specified operation.  In particular note that
diff -r 0225fcaacf23 -r 371ab4c8d9cb mpn/s390/README
--- a/mpn/s390/README	Tue Oct 04 00:06:08 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-All current (2001) S/390 and z/Architecture machines are single-issue,
-but some newer machines have a deep pipeline.  Software-pipelining is
-therefore beneficial.
-
-* mpn_add_n, mpn_sub_n: Use code along the lines below.  Two-way unrolling
-  would be adequate.
-
-  mp_limb_t
-  mpn_add_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
-  {
-    mp_limb_t a, b, r, cy;
-    mp_size_t i;
-    mp_limb_t mm = -1;
-
-    cy = 0;
-    up += n;
-    vp += n;
-    rp += n;
-    i = -n;
-    do
-      {
-	a = up[i];
-	b = vp[i];
-	r = a + b + cy;
-	rp[i] = r;
-	cy = (((a & b) | ((a | b) & (r ^ mm)))) >> 31;
-	i++;
-      }
-    while (i < 0);
-    return cy;
-  }
-
-* mpn_lshift, mpn_rshift: Use SLDL/SRDL, and two-way unrolling.
-
-* mpn_mul_1, mpn_addmul_1, mpn_submul_1: For machines with just signed
-  multiply (MR), use two loops, similar to the corresponding VAX or
-  POWER functions.  Handle carry like for mpn_add_n.
diff -r 0225fcaacf23 -r 371ab4c8d9cb mpn/s390/addmul_1.asm
--- a/mpn/s390/addmul_1.asm	Tue Oct 04 00:06:08 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-dnl  S/390 mpn_addmul_1 -- Multiply a limb vector with a limb and add the
-dnl  result to a second limb vector.
-
-dnl  Copyright 2001 Free Software Foundation, Inc.
-
-dnl  This file is part of the GNU MP Library.
-
-dnl  The GNU MP Library is free software; you can redistribute it and/or modify
-dnl  it under the terms of the GNU Lesser General Public License as published
-dnl  by the Free Software Foundation; either version 3 of the License, or (at
-dnl  your option) any later version.
-
-dnl  The GNU MP Library is distributed in the hope that it will be useful, but
-dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
-dnl  License for more details.
-
-dnl  You should have received a copy of the GNU Lesser General Public License
-dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-define(`rp',2)
-define(`up',3)
-define(`n',4)
-define(`vlimb',5)
-define(`cylimb',7)
-
-ASM_START()
-PROLOGUE(mpn_addmul_1)
-	stm	6,7,24(15)
-	slr	cylimb,cylimb	# clear cylimb
-	ltr	vlimb,vlimb
-	jnl	.Loopp
-
-.Loopn:	l	1,0(up)		# load from u
-	lr	6,1		#
-	mr	0,vlimb		# multiply signed
-	alr	0,6		# add vlimb to phi
-	sra	6,31		# make mask
-	nr	6,vlimb		# 0 or vlimb
-	alr	0,6		# conditionally add vlimb to phi
-	alr	1,cylimb	# add carry limb to plo
-	brc	8+4,+8		# branch if not carry
-	ahi	0,1		# increment phi
-	l	6,0(rp)		# load r limb
-	alr	6,1		# add u limb to plo
-	brc	8+4,+8		# branch if not carry
-	ahi	0,1		# increment phi
-	lr	cylimb,0	# new cylimb
-	st	6,0(rp)		# store
-	la	up,4(,up)
-	la	rp,4(,rp)
-	brct	n,.Loopn
-
-	lr	2,cylimb
-	lm	6,7,24(15)
-	br	14
-
-.Loopp:	l	1,0(up)		# load from u
-	lr	6,1		#
-	mr	0,vlimb		# multiply signed
-	sra	6,31		# make mask
-	nr	6,vlimb		# 0 or vlimb
-	alr	0,6		# conditionally add vlimb to phi
-	alr	1,cylimb	# add carry limb to plo
-	brc	8+4,+8		# branch if not carry
-	ahi	0,1		# increment phi
-	l	6,0(rp)		# load r limb
-	alr	6,1		# add u limb to plo
-	brc	8+4,+8		# branch if not carry
-	ahi	0,1		# increment phi
-	lr	cylimb,0	# new cylimb
-	st	6,0(rp)		# store
-	la	up,4(,up)
-	la	rp,4(,rp)
-	brct	n,.Loopp
-
-	lr	2,cylimb
-	lm	6,7,24(15)
-	br	14
-EPILOGUE(mpn_addmul_1)
diff -r 0225fcaacf23 -r 371ab4c8d9cb mpn/s390/gmp-mparam.h
--- a/mpn/s390/gmp-mparam.h	Tue Oct 04 00:06:08 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/* IBM s370 gmp-mparam.h -- Compiler/machine parameter header file.
-
-Copyright 2001, 2002 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-The GNU MP Library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
-License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.  */
-
-
-/* GMP_LIMB_BITS etc generated by configure */
-
-
-/* Generated by tuneup.c, 2001-12-03, gcc 2.95 */
-
-#define MUL_TOOM22_THRESHOLD          18
-#define MUL_TOOM33_THRESHOLD         210
-
-#define SQR_BASECASE_THRESHOLD         8
-#define SQR_TOOM2_THRESHOLD           40
-#define SQR_TOOM3_THRESHOLD          250
-
-#define DIV_SB_PREINV_THRESHOLD            0
-#define DIV_DC_THRESHOLD                  63
-#define POWM_THRESHOLD                63
-
-#define GCD_ACCEL_THRESHOLD            3
-
-#define DIVREM_1_NORM_THRESHOLD        0
-#define DIVREM_1_UNNORM_THRESHOLD      5
-#define MOD_1_NORM_THRESHOLD           0
-#define MOD_1_UNNORM_THRESHOLD         4
-#define USE_PREINV_MOD_1               0
-#define DIVREM_2_THRESHOLD             0
-#define DIVEXACT_1_THRESHOLD           0
-#define MODEXACT_1_ODD_THRESHOLD       0
-
-#define MUL_FFT_TABLE  { 432, 992, 1664, 4608, 14336, 40960, 0 }
-#define MUL_FFT_MODF_THRESHOLD       448
-#define MUL_FFT_THRESHOLD           3840
-
-#define SQR_FFT_TABLE  { 400, 992, 1664, 4608, 10240, 40960, 0 }
-#define SQR_FFT_MODF_THRESHOLD       416
-#define SQR_FFT_THRESHOLD           3328
diff -r 0225fcaacf23 -r 371ab4c8d9cb mpn/s390/mul_1.asm
--- a/mpn/s390/mul_1.asm	Tue Oct 04 00:06:08 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-dnl  S/390 mpn_mul_1 -- Multiply a limb vector with a limb and store the
-dnl  result in a second limb vector.
-
-dnl  Copyright 2001 Free Software Foundation, Inc.
-
-dnl  This file is part of the GNU MP Library.
-


More information about the gmp-commit mailing list