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

mercurial at gmplib.org mercurial at gmplib.org
Tue Feb 12 21:03:56 CET 2013


details:   /var/hg/gmp/rev/b49c2791e8c3
changeset: 15408:b49c2791e8c3
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Feb 12 21:00:13 2013 +0100
description:
New file, mainly for testing HNI.

details:   /var/hg/gmp/rev/bc41520894cd
changeset: 15409:bc41520894cd
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Feb 12 21:03:26 2013 +0100
description:
Recognise haswell.

details:   /var/hg/gmp/rev/a4a4dd24ccab
changeset: 15410:a4a4dd24ccab
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Feb 12 21:03:50 2013 +0100
description:
ChangeLog

diffstat:

 ChangeLog                    |   8 ++++
 config.guess                 |   2 +-
 config.sub                   |   2 +-
 configure.ac                 |   6 +++
 mpn/x86_64/haswell/mul_1.asm |  86 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 102 insertions(+), 2 deletions(-)

diffs (145 lines):

diff -r 26b6c6d4f7a5 -r a4a4dd24ccab ChangeLog
--- a/ChangeLog	Tue Feb 12 16:44:04 2013 +0100
+++ b/ChangeLog	Tue Feb 12 21:03:50 2013 +0100
@@ -1,3 +1,11 @@
+2013-02-12  Torbjorn Granlund  <tege at gmplib.org>
+
+	* configure.ac: Recognise haswell.
+	* config.guess: Recognise haswell.
+	* config.sub: Match haswell.
+
+	* mpn/x86_64/haswell/mul_1.asm: New file, mainly for testing HNI.
+
 2013-02-12 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* gmp-impl.h (MPZ_PROVOKE_REALLOC): Remove unused macro.
diff -r 26b6c6d4f7a5 -r a4a4dd24ccab config.guess
--- a/config.guess	Tue Feb 12 16:44:04 2013 +0100
+++ b/config.guess	Tue Feb 12 21:03:50 2013 +0100
@@ -812,7 +812,7 @@
 	  else if (model == 0x2e)	cpu_64bit = 1, modelstr = "coreinhm"; /* NHM Beckton */
 	  else if (model == 0x2f)	cpu_64bit = 1, modelstr = "coreiwsm"; /* WSM Eagleton */
 	  else if (model == 0x3a)	cpu_64bit = 1, modelstr = "coreisbr"; /* IBR */
-	  else if (model == 0x3c)	cpu_64bit = 1, modelstr = "coreisbr"; /* Haswell */
+	  else if (model == 0x3c)	cpu_64bit = 1, modelstr = "coreihwl"; /* Haswell */
 	  else if (model == 0x36)	cpu_64bit = 1, modelstr = "atom";  /* Cedarview/Saltwell */
 	  else cpu_64bit = 1, modelstr = "corei"; /* default */
 	  break;
diff -r 26b6c6d4f7a5 -r a4a4dd24ccab config.sub
--- a/config.sub	Tue Feb 12 16:44:04 2013 +0100
+++ b/config.sub	Tue Feb 12 21:03:50 2013 +0100
@@ -91,7 +91,7 @@
   test_cpu=ia64 ;;
 pentium | pentiummmx | pentiumpro | pentium[234m] | k[567] | k6[23] | geode | athlon | viac3*)
   test_cpu=i386 ;;
-athlon64 | atom | core2 | corei | coreinhm | coreiwsm | coreisbr | opteron | k[89] | k10 | bobcat | bulldozer | nano)
+athlon64 | atom | core2 | corei | coreinhm | coreiwsm | coreisbr | coreihwl | opteron | k[89] | k10 | bobcat | bulldozer | nano)
   test_cpu=x86_64 ;;
 power[2-9] | power2sc)
   test_cpu=power ;;
diff -r 26b6c6d4f7a5 -r a4a4dd24ccab configure.ac
--- a/configure.ac	Tue Feb 12 16:44:04 2013 +0100
+++ b/configure.ac	Tue Feb 12 21:03:50 2013 +0100
@@ -1640,6 +1640,12 @@
 	path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86"
 	path_64="x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
 	;;
+      coreihwl)
+	gcc_cflags_cpu="-mtune=corei7 -mtune=core2 -mtune=k8"
+	gcc_cflags_arch="-march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
+	path="x86/haswell x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86"
+	path_64="x86_64/haswell x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
+	;;
       atom)
 	gcc_cflags_cpu="-mtune=atom -mtune=pentium3"
 	gcc_cflags_arch="-march=atom -march=pentium3"
diff -r 26b6c6d4f7a5 -r a4a4dd24ccab mpn/x86_64/haswell/mul_1.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/x86_64/haswell/mul_1.asm	Tue Feb 12 21:03:50 2013 +0100
@@ -0,0 +1,86 @@
+dnl  AMD64 mpn_mul_1 for Intel Haswell.
+
+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')
+
+C	     cycles/limb
+C AMD K8,K9
+C AMD K10
+C AMD bd1
+C AMD bobcat
+C Intel P4
+C Intel PNR
+C Intel NHM
+C Intel SBR
+C Intel HWL
+C Intel atom
+C VIA nano
+
+define(`rp',      `%rdi')   C rcx
+define(`up',      `%rsi')   C rdx
+define(`n_param', `%rdx')   C r8
+define(`v0_param',`%rcx')   C r9
+
+define(`n',       `%rcx')
+define(`v0',      `%rdx')
+
+IFDOS(`	define(`up', ``%rsi'')	') dnl
+IFDOS(`	define(`rp', ``%rcx'')	') dnl
+IFDOS(`	define(`v0', ``%r9'')	') dnl
+IFDOS(`	define(`r9', ``rdi'')	') dnl
+IFDOS(`	define(`n',  ``%r8'')	') dnl
+IFDOS(`	define(`r8', ``r11'')	') dnl
+
+ASM_START()
+	TEXT
+	ALIGN(16)
+PROLOGUE(mpn_mul_1c)
+	mov	%r8, %rax
+	jmp	L(ent)
+EPILOGUE()
+	ALIGN(16)
+PROLOGUE(mpn_mul_1)
+	xor	%rax, %rax
+L(ent):	mov	v0_param, %r8
+	mov	n_param, n
+	mov	%r8, v0
+	lea	(rp,n,8), rp
+	lea	(up,n,8), up
+	neg	n
+	test	$1, R8(n)
+	jne	L(odd)
+
+L(top):	jrcxz	L(end)
+	mulx	(up,n,8), %r9, %r8
+	adc	%rax, %r9
+	mov	%r9, (rp,n,8)
+L(mid):	mulx	8(up,n,8), %r11, %rax
+	adc	%r8, %r11
+	mov	%r11, 8(rp,n,8)
+	lea	2(n), n
+	jmp	L(top)
+
+L(end):	adc	$0, %rax
+	ret
+
+L(odd):	dec	n
+	mov	%rax, %r8
+	jmp	L(mid)
+EPILOGUE()
+ASM_END()


More information about the gmp-commit mailing list