[Gmp-commit] /home/hgfiles/gmp-5.0: 3 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Thu Feb 10 11:32:42 CET 2011


details:   /home/hgfiles/gmp-5.0/rev/9c82f00d681e
changeset: 13440:9c82f00d681e
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Feb 10 11:30:35 2011 +0100
description:
Merge "orb" assembly workaround from mainline.

details:   /home/hgfiles/gmp-5.0/rev/4821b03d6863
changeset: 13441:4821b03d6863
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Feb 10 11:31:40 2011 +0100
description:
*** empty log message ***

details:   /home/hgfiles/gmp-5.0/rev/1ebe39104437
changeset: 13442:1ebe39104437
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Feb 10 11:32:39 2011 +0100
description:
Trivial merge.

diffstat:

 ChangeLog                  |  10 ++++++++++
 INSTALL                    |   7 ++-----
 doc/gmp.texi               |  10 ++++++----
 mpn/generic/matrix22_mul.c |   4 ++--
 mpn/x86/divrem_2.asm       |   4 ++--
 mpn/x86_64/divrem_2.asm    |   4 ++--
 mpz/mul.c                  |  12 ++++++------
 7 files changed, 30 insertions(+), 21 deletions(-)

diffs (185 lines):

diff -r a3091e12fad7 -r 1ebe39104437 ChangeLog
--- a/ChangeLog	Thu Nov 11 14:11:09 2010 +0100
+++ b/ChangeLog	Thu Feb 10 11:32:39 2011 +0100
@@ -1,3 +1,7 @@
+2011-01-25 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* mpz/mul.c: Remove redundant size computation.
+
 2010-11-11  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/x86_64/atom/aors_n.asm: Don't rely on ZF after 'bt' insn.
@@ -11,6 +15,12 @@
 
 	* mpn/generic/redc_2.c: Use asm code just for GNU C.
 
+2010-04-10  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/x86/divrem_2.asm: Use "orb" instead of "or" to work around
+	Solaris assembler bug.
+	* mpn/x86_64/mpn/x86_64/divrem_2.asm: Likewise.
+
 2010-02-26  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/pa64/aors_n.asm: Fix typo in last change.
diff -r a3091e12fad7 -r 1ebe39104437 INSTALL
--- a/INSTALL	Thu Nov 11 14:11:09 2010 +0100
+++ b/INSTALL	Thu Feb 10 11:32:39 2011 +0100
@@ -27,12 +27,9 @@
 These instructions are only for the impatient.  Others should read the install
 instructions in gmp.info.  Use
 
-	info -f ./gmp.info
+	info -f doc/gmp.info
 
-or in emacs
-
-	C-u C-h i gmp.info
-
+from the gmp source directory.
 
 Here are some brief instructions on how to install GMP.  First you need to
 compile.  Since you're impatient, try this
diff -r a3091e12fad7 -r 1ebe39104437 doc/gmp.texi
--- a/doc/gmp.texi	Thu Nov 11 14:11:09 2010 +0100
+++ b/doc/gmp.texi	Thu Feb 10 11:32:39 2011 +0100
@@ -15,7 +15,8 @@
 arithmetic library, version @value{VERSION}.
 
 Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document under
 the terms of the GNU Free Documentation License, Version 1.3 or any later
@@ -4114,7 +4115,7 @@
 @code{mp_bits_per_limb}.
 
 @item
- at code{mpz_mul}, @code{mpz_mul_ui} and @code{mpz_mul_ui} need room for the sum
+ at code{mpz_mul}, @code{mpz_mul_ui} and @code{mpz_mul_si} need room for the sum
 of the number of bits in their operands, but each rounded up to a multiple of
 @code{mp_bits_per_limb}.
 
@@ -8526,7 +8527,7 @@
 resulting matrix is applied to the inputs using @code{mpn_mul_1} and
 @code{mpn_submul_1}. Each iteration usually reduces the inputs by almost one
 limb. In the rare case of a large quotient, no progress can be made by
-examining just the most significant two limbs, and the quotient is computing
+examining just the most significant two limbs, and the quotient is computed
 using plain division.
 
 The resulting algorithm is asymptotically @math{O(N^2)}, just as the Euclidean
@@ -10471,7 +10472,8 @@
 
 @item
 Niels M@"oller and Torbj@"orn Granlund, ``Improved division by invariant
-integers'', to appear.
+integers'', IEEE Transactions on Computers, 11 June 2010.
+ at uref{http://gmplib.org/~tege/division-paper.pdf}
 
 @item
 Torbj@"orn Granlund and Niels M@"oller, ``Division of integers large and
diff -r a3091e12fad7 -r 1ebe39104437 mpn/generic/matrix22_mul.c
--- a/mpn/generic/matrix22_mul.c	Thu Nov 11 14:11:09 2010 +0100
+++ b/mpn/generic/matrix22_mul.c	Thu Feb 10 11:32:39 2011 +0100
@@ -95,8 +95,8 @@
 
   Note: the two matrices above are the same, but s_i and t_i are used
   in the same product, only for i<4, see "A Strassen-like Matrix
-  Multiplication suited for squaring and highest power computation" by
-  M. Bodrato (2008).
+  Multiplication suited for squaring and higher power computation" by
+  M. Bodrato, in Proceedings of ISSAC 2010.
 
     / r0 \   / 1 0  0  0  0  1  0 \ / s0*t0 \
     | r1 | = | 0 0 -1  1 -1  1  0 | | s1*t1 |
diff -r a3091e12fad7 -r 1ebe39104437 mpn/x86/divrem_2.asm
--- a/mpn/x86/divrem_2.asm	Thu Nov 11 14:11:09 2010 +0100
+++ b/mpn/x86/divrem_2.asm	Thu Feb 10 11:32:39 2011 +0100
@@ -81,7 +81,7 @@
 	seta	%dl
 	cmp	20(%esp), %ebp
 	setae	%al
-	or	%dl, %al
+	orb	%dl, %al
 	jne	L(35)
 L(8):
 	mov	60(%esp), %esi		C fn
@@ -174,7 +174,7 @@
 L(fix):	seta	%dl
 	cmp	20(%esp), %ebp
 	setae	%al
-	or	%dl, %al
+	orb	%dl, %al
 	je	L(bck)
 	inc	%edi
 	sub	20(%esp), %ebp
diff -r a3091e12fad7 -r 1ebe39104437 mpn/x86_64/divrem_2.asm
--- a/mpn/x86_64/divrem_2.asm	Thu Nov 11 14:11:09 2010 +0100
+++ b/mpn/x86_64/divrem_2.asm	Thu Feb 10 11:32:39 2011 +0100
@@ -1,6 +1,6 @@
 dnl  x86-64 mpn_divrem_2 -- Divide an mpn number by a normalized 2-limb number.
 
-dnl  Copyright 2007, 2008 Free Software Foundation, Inc.
+dnl  Copyright 2007, 2008, 2010 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -73,7 +73,7 @@
 	setb	%dl
 	cmp	%r10, %r8
 	setbe	%al
-	or	%al, %dl
+	orb	%al, %dl
 	jne	L(23)
 L(2):
 	lea	-3(%rcx,%r13), %rbx	C un + fn - 3
diff -r a3091e12fad7 -r 1ebe39104437 mpz/mul.c
--- a/mpz/mul.c	Thu Nov 11 14:11:09 2010 +0100
+++ b/mpz/mul.c	Thu Feb 10 11:32:39 2011 +0100
@@ -1,7 +1,7 @@
 /* mpz_mul -- Multiply two integers.
 
-Copyright 1991, 1993, 1994, 1996, 2000, 2001, 2005, 2009 Free Software
-Foundation, Inc.
+Copyright 1991, 1993, 1994, 1996, 2000, 2001, 2005, 2009, 2011 Free
+Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -33,8 +33,8 @@
 mult (mpz_srcptr u, mpz_srcptr v, mpz_ptr w)
 #endif /* BERKELEY_MP */
 {
-  mp_size_t usize = SIZ(u);
-  mp_size_t vsize = SIZ(v);
+  mp_size_t usize;
+  mp_size_t vsize;
   mp_size_t wsize;
   mp_size_t sign_product;
   mp_ptr up, vp;
@@ -44,6 +44,8 @@
   mp_limb_t cy_limb;
   TMP_DECL;
 
+  usize = SIZ (u);
+  vsize = SIZ (v);
   sign_product = usize ^ vsize;
   usize = ABS (usize);
   vsize = ABS (vsize);
@@ -137,13 +139,11 @@
   if (up == vp)
     {
       mpn_sqr (wp, up, usize);
-      wsize = usize + vsize;
       cy_limb = wp[wsize - 1];
     }
   else
     {
       cy_limb = mpn_mul (wp, up, usize, vp, vsize);
-      wsize = usize + vsize;
     }
 
   wsize -= cy_limb == 0;


More information about the gmp-commit mailing list