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

mercurial at gmplib.org mercurial at gmplib.org
Sat Jan 21 13:47:05 CET 2012


details:   /var/hg/gmp-5.0/rev/d89a56def94d
changeset: 13509:d89a56def94d
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Jan 21 11:51:30 2012 +0100
description:
Merge mpn/sh changes from mainline repo.

details:   /var/hg/gmp-5.0/rev/13e1d308963a
changeset: 13510:13e1d308963a
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Jan 21 13:47:00 2012 +0100
description:
Partially merge powerpc configure changes from mainline repo.

diffstat:

 ChangeLog               |  10 +++++++-
 configure.in            |  50 +++++++++++++++++++--------------------------
 mpn/sh/add_n.asm        |  48 +++++++++++++++++++++++++++++++++++++++++++
 mpn/sh/add_n.s          |  45 ----------------------------------------
 mpn/sh/sh2/addmul_1.asm |  54 +++++++++++++++++++++++++++++++++++++++++++++++++
 mpn/sh/sh2/addmul_1.s   |  51 ----------------------------------------------
 mpn/sh/sh2/mul_1.asm    |  51 ++++++++++++++++++++++++++++++++++++++++++++++
 mpn/sh/sh2/mul_1.s      |  48 -------------------------------------------
 mpn/sh/sh2/submul_1.asm |  54 +++++++++++++++++++++++++++++++++++++++++++++++++
 mpn/sh/sh2/submul_1.s   |  51 ----------------------------------------------
 mpn/sh/sub_n.asm        |  48 +++++++++++++++++++++++++++++++++++++++++++
 mpn/sh/sub_n.s          |  45 ----------------------------------------
 12 files changed, 284 insertions(+), 271 deletions(-)

diffs (truncated from 681 to 300 lines):

diff -r 1fba5664bd9a -r 13e1d308963a ChangeLog
--- a/ChangeLog	Sat Jan 21 08:42:50 2012 +0100
+++ b/ChangeLog	Sat Jan 21 13:47:00 2012 +0100
@@ -1,11 +1,13 @@
+2012-01-21  Torbjorn Granlund  <tege at gmplib.org>
+
+	* Version 5.0.3 released.
+
 2012-01-18  Marc Glisse  <marc.glisse at inria.fr>
 
 	* doc/gmp.texi (mpf_class::mpf_class): Use mp_bitcnt_t.
 
 2012-01-17  Torbjorn Granlund  <tege at gmplib.org>
 
-	* Version 5.0.3 released.
-
 	* gmp-h.in (__GNU_MP_VERSION_PATCHLEVEL): Bump.
 
 	* Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
@@ -65,6 +67,9 @@
 	* configure.in: Split x86 CPUs into more subtypes for more accurate
 	passing of gcc flags.
 
+	* configure.in: Pass -m32 for powerpc64 with abi=32, using via _maybe
+	mechanism.
+
 2011-11-15  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/generic/powm_sec.c (mpn_local_sqr): Remove forgotten TMP_* calls.
@@ -99,6 +104,7 @@
 
 2011-09-25  Torbjorn Granlund  <tege at gmplib.org>
 
+	* mpn/sh: Migrate files to '.asm'.
 	* configure.in: Recognise sh3 and sh4.
 
 2011-08-18  Torbjorn Granlund  <tege at gmplib.org>
diff -r 1fba5664bd9a -r 13e1d308963a configure.in
--- a/configure.in	Sat Jan 21 08:42:50 2012 +0100
+++ b/configure.in	Sat Jan 21 13:47:00 2012 +0100
@@ -863,7 +863,7 @@
     abilist="32"
     cclist="gcc cc"
     cc_cflags="-O2"
-    gcc_cflags="$gcc_cflags -mpowerpc"
+    gcc_32_cflags="$gcc_cflags -mpowerpc"
     gcc_cflags_optlist="precomp subtype asm cpu"
     gcc_cflags_precomp="-no-cpp-precomp"
     gcc_cflags_subtype="-force_cpusubtype_ALL"	# for vmx on darwin
@@ -886,19 +886,6 @@
         path="powerpc32" ;;
     esac
 
-    # gcc 2.7.2 knows -mcpu=403, 601, 603, 604.
-    # gcc 2.95 adds 401, 505, 602, 603e, ec603e, 604e, 620, 740, 750,
-    #   801, 821, 823, 860.
-    # gcc 3.0 adds 630, rs64a.
-    # gcc 3.1 adds 405, 7400, 7450.
-    # gcc 3.2 adds nothing.
-    # gcc 3.3 adds power3, power4, 8540.  power3 seems to be a synonym for 630.
-    # gcc pre-release 3.4 adds 405fp, 440, 440fp, 970.
-    #
-    # FIXME: The way 603e falls back to 603 for gcc 2.7.2 should be
-    # done for all the others too.  But what would be the correct
-    # arrangements?
-    #
     case $host_cpu in
       powerpc401)   gcc_cflags_cpu="-mcpu=401" ;;
       powerpc403)   gcc_cflags_cpu="-mcpu=403"
@@ -973,7 +960,8 @@
 	    gcc_aix64_cflags="-O2 -maix64 -mpowerpc64"
 	    gcc_aix64_cflags_optlist="cpu"
 	    gcc_aix64_ldflags="-Wc,-maix64"
-	    xlc_aix64_cflags="-O2 -q64 -qtune=pwr3 -qmaxmem=20000"
+	    xlc_aix64_cflags="-O2 -q64 -qmaxmem=20000"
+	    xlc_aix64_cflags_optlist="arch"
 	    xlc_aix64_ldflags="-Wc,-q64"
 	    # Must indicate object type to ar and nm
 	    ar_aix64_flags="-X64"
@@ -1006,8 +994,10 @@
 	    # incompatible with a shared library.
 	    #
 	    abilist="mode64 mode32 $abilist"
+	    gcc_32_cflags_maybe="-m32"
 	    gcc_cflags_opt="-O3 -O2 -O1"	# will this become used?
 	    cclist_mode32="gcc"
+	    gcc_mode32_cflags_maybe="-m32"
 	    gcc_mode32_cflags="-mpowerpc64"
 	    gcc_mode32_cflags_optlist="subtype cpu opt"
 	    gcc_mode32_cflags_subtype="-force_cpusubtype_ALL"
@@ -1021,8 +1011,8 @@
 	    path_mode64=""
 	    for i in $cpu_path; do path_mode64="${path_mode64}powerpc64/mode64/$i "; done
 	    path_mode64="${path_mode64}powerpc64/mode64 $vmx_path powerpc64"
-            SPEED_CYCLECOUNTER_OBJ_mode64=powerpc64.lo
-            cyclecounter_size_mode64=0
+	    SPEED_CYCLECOUNTER_OBJ_mode64=powerpc64.lo
+	    cyclecounter_size_mode64=0
 	    any_mode64_testlist="sizeof-long-8"
 	    ;;
 	  *-*-linux* | *-*-*bsd*)
@@ -1031,17 +1021,19 @@
 	    # others require -m64, hence the use of cflags_maybe.  The
 	    # sizeof-long-8 test checks the mode is right (for the no option
 	    # case).
-            #
-            # -mpowerpc64 is not used, since it should be the default in
-            # 64-bit mode.  (We need its effect for the various longlong.h
-            # asm macros to be right of course.)
-            #
-            # gcc64 was an early port of gcc to 64-bit mode, but should be
-            # obsolete before too long.  We prefer plain gcc when it knows
-            # 64-bits.
+	    #
+	    # -mpowerpc64 is not used, since it should be the default in
+	    # 64-bit mode.  (We need its effect for the various longlong.h
+	    # asm macros to be right of course.)
+	    #
+	    # gcc64 was an early port of gcc to 64-bit mode, but should be
+	    # obsolete before too long.  We prefer plain gcc when it knows
+	    # 64-bits.
 	    #
 	    abilist="mode64 mode32 $abilist"
+	    gcc_32_cflags_maybe="-m32"
 	    cclist_mode32="gcc"
+	    gcc_mode32_cflags_maybe="-m32"
 	    gcc_mode32_cflags="-mpowerpc64"
 	    gcc_mode32_cflags_optlist="cpu opt"
 	    gcc_mode32_cflags_opt="-O3 -O2 -O1"
@@ -1054,12 +1046,12 @@
 	    path_mode64=""
 	    for i in $cpu_path; do path_mode64="${path_mode64}powerpc64/mode64/$i "; done
 	    path_mode64="${path_mode64}powerpc64/mode64 $vmx_path powerpc64"
-            SPEED_CYCLECOUNTER_OBJ_mode64=powerpc64.lo
-            cyclecounter_size_mode64=0
+	    SPEED_CYCLECOUNTER_OBJ_mode64=powerpc64.lo
+	    cyclecounter_size_mode64=0
 	    any_mode64_testlist="sizeof-long-8"
 	    ;;
-        esac
-        ;;
+	esac
+	;;
     esac
     ;;
 
diff -r 1fba5664bd9a -r 13e1d308963a mpn/sh/add_n.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/sh/add_n.asm	Sat Jan 21 13:47:00 2012 +0100
@@ -0,0 +1,48 @@
+dnl  SH mpn_add_n -- Add two limb vectors of the same length > 0 and store sum
+dnl  in a third limb vector.
+
+dnl  Copyright 1995, 1997, 2000, 2011 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')
+
+C INPUT PARAMETERS
+C rp		r4
+C up		r5
+C vp		r6
+C n		r7
+
+changecom(blah)			C disable # to make all C comments below work
+
+ASM_START()
+PROLOGUE(mpn_add_n)
+	mov	#0,r3		C clear cy save reg
+
+L(top):	mov.l	@r5+,r1
+	mov.l	@r6+,r2
+	shlr	r3		C restore cy
+	addc	r2,r1
+	movt	r3		C save cy
+	mov.l	r1, at r4
+	dt	r7
+	bf.s	L(top)
+	 add	#4,r4
+
+	rts
+	mov	r3,r0		C return carry-out from most significant limb
+EPILOGUE()
diff -r 1fba5664bd9a -r 13e1d308963a mpn/sh/add_n.s
--- a/mpn/sh/add_n.s	Sat Jan 21 08:42:50 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-! SH __gmpn_add_n -- Add two limb vectors of the same length > 0 and store
-! sum in a third limb vector.
-
-! Copyright 1995, 1997, 2000 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/.
-
-
-! INPUT PARAMETERS
-! res_ptr	r4
-! s1_ptr	r5
-! s2_ptr	r6
-! size		r7
-
-	.text
-	.align 2
-	.global	___gmpn_add_n
-___gmpn_add_n:
-	mov	#0,r3		! clear cy save reg
-
-Loop:	mov.l	@r5+,r1
-	mov.l	@r6+,r2
-	shlr	r3		! restore cy
-	addc	r2,r1
-	movt	r3		! save cy
-	mov.l	r1, at r4
-	dt	r7
-	bf.s	Loop
-	 add	#4,r4
-
-	rts
-	mov	r3,r0		! return carry-out from most sign. limb
diff -r 1fba5664bd9a -r 13e1d308963a mpn/sh/sh2/addmul_1.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/sh/sh2/addmul_1.asm	Sat Jan 21 13:47:00 2012 +0100
@@ -0,0 +1,54 @@
+dnl  SH2 mpn_addmul_1 -- Multiply a limb vector with a limb and add the result
+dnl  to a second limb vector.
+
+dnl  Copyright 1995, 2000, 2011 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')
+
+C INPUT PARAMETERS
+C res_ptr	r4
+C s1_ptr	r5
+C size		r6
+C s2_limb	r7
+
+changecom(blah)			C disable # to make all C comments below work
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+	mov	#0,r2		C cy_limb = 0
+	mov	#0,r0		C Keep r0 = 0 for entire loop
+	clrt
+
+L(top):	mov.l	@r5+,r3
+	dmulu.l	r3,r7
+	sts	macl,r1
+	addc	r2,r1		C lo_prod += old cy_limb
+	sts	mach,r2		C new cy_limb = hi_prod
+	mov.l	@r4,r3
+	addc	r0,r2		C cy_limb += T, T = 0
+	addc	r3,r1
+	addc	r0,r2		C cy_limb += T, T = 0
+	dt	r6
+	mov.l	r1, at r4
+	bf.s	L(top)


More information about the gmp-commit mailing list