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

mercurial at gmplib.org mercurial at gmplib.org
Thu Mar 15 20:04:21 CET 2012


details:   /var/hg/gmp/rev/b9e0a4ebcbce
changeset: 14758:b9e0a4ebcbce
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Mar 15 18:07:33 2012 +0100
description:
Remove spurious PROLOGUE/EPILOGUE.

details:   /var/hg/gmp/rev/42afdc528634
changeset: 14759:42afdc528634
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Mar 15 20:02:58 2012 +0100
description:
New nano gcd_1 support.

details:   /var/hg/gmp/rev/5027cd1d7fbe
changeset: 14760:5027cd1d7fbe
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Mar 15 20:04:10 2012 +0100
description:
Parameterise zerotab code.

diffstat:

 ChangeLog                          |   4 ++++
 mpn/generic/gcd_1.c                |  18 ++++++++++++------
 mpn/powerpc64/mode64/aorsmul_1.asm |   3 ---
 mpn/x86_64/nano/gcd_1.asm          |  26 ++++++++++++++++++++++++++
 4 files changed, 42 insertions(+), 9 deletions(-)

diffs (103 lines):

diff -r 7c7a9cba56d3 -r 5027cd1d7fbe ChangeLog
--- a/ChangeLog	Thu Mar 15 15:53:22 2012 +0100
+++ b/ChangeLog	Thu Mar 15 20:04:10 2012 +0100
@@ -1,5 +1,9 @@
 2012-03-15  Torbjorn Granlund  <tege at gmplib.org>
 
+	* mpn/generic/gcd_1.c: Parameterise zerotab code.
+
+	* mpn/x86_64/nano/gcd_1.asm: New file, grabbing core2 asm file.
+
 	* mpn/x86_64/core2/gcd_1.asm: Speed up loop code, simplify non-loop
 	code.
 
diff -r 7c7a9cba56d3 -r 5027cd1d7fbe mpn/generic/gcd_1.c
--- a/mpn/generic/gcd_1.c	Thu Mar 15 15:53:22 2012 +0100
+++ b/mpn/generic/gcd_1.c	Thu Mar 15 20:04:10 2012 +0100
@@ -1,6 +1,6 @@
 /* mpn_gcd_1 -- mpn and limb greatest common divisor.
 
-Copyright 1994, 1996, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1994, 1996, 2000, 2001, 2009, 2012 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -28,7 +28,13 @@
 #define USE_ZEROTAB 0
 
 #if USE_ZEROTAB
-static const unsigned char zerotab[16] = {
+#define MAXSHIFT 4
+#define MASK ((1 << MAXSHIFT) - 1)
+static const unsigned char zerotab[1 << MAXSHIFT] =
+{
+#if MAXSHIFT > 4
+  5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
+#endif
   4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
 };
 #endif
@@ -148,16 +154,16 @@
 #if USE_ZEROTAB
       /* Number of trailing zeros is the same no matter if we look at
        * t or ulimb, but using t gives more parallelism. */
-      c = zerotab[t & 15];
+      c = zerotab[t & MASK];
 
-      while (UNLIKELY (c == 4))
+      while (UNLIKELY (c == MAXSHIFT))
 	{
-	  ulimb >>= 4;
+	  ulimb >>= MAXSHIFT;
 	  if (0)
 	  strip_u_maybe:
 	    vlimb >>= 1;
 
-	  c = zerotab[ulimb & 15];
+	  c = zerotab[ulimb & MASK];
 	}
 #else
       if (0)
diff -r 7c7a9cba56d3 -r 5027cd1d7fbe mpn/powerpc64/mode64/aorsmul_1.asm
--- a/mpn/powerpc64/mode64/aorsmul_1.asm	Thu Mar 15 15:53:22 2012 +0100
+++ b/mpn/powerpc64/mode64/aorsmul_1.asm	Thu Mar 15 20:04:10 2012 +0100
@@ -56,9 +56,6 @@
 MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
 
 ASM_START()
-PROLOGUE(func_nc)
-EPILOGUE()
-
 PROLOGUE(func)
 	std	r31, -8(r1)
 	rldicl.	r0, n, 0,62	C r0 = n & 3, set cr0
diff -r 7c7a9cba56d3 -r 5027cd1d7fbe mpn/x86_64/nano/gcd_1.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/x86_64/nano/gcd_1.asm	Thu Mar 15 20:04:10 2012 +0100
@@ -0,0 +1,26 @@
+dnl  AMD64 mpn_gcd_1.
+
+dnl  Copyright 2012 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')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(STD64)
+
+MULFUNC_PROLOGUE(mpn_gcd_1)
+include_mpn(`x86_64/core2/gcd_1.asm')


More information about the gmp-commit mailing list