[Gmp-commit] /var/hg/gmp: Make n = 1 work for DOS64, streamline.

mercurial at gmplib.org mercurial at gmplib.org
Sat May 11 18:00:43 CEST 2013


details:   /var/hg/gmp/rev/ea101cedad37
changeset: 15808:ea101cedad37
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat May 11 18:00:39 2013 +0200
description:
Make n = 1 work for DOS64, streamline.

diffstat:

 ChangeLog                         |   5 +++++
 mpn/x86_64/coreisbr/aorsmul_1.asm |  22 +++++++++++-----------
 mpn/x86_64/coreisbr/mul_1.asm     |  24 +++++++++++++-----------
 3 files changed, 29 insertions(+), 22 deletions(-)

diffs (115 lines):

diff -r 19a0318df6f4 -r ea101cedad37 ChangeLog
--- a/ChangeLog	Fri May 10 18:01:39 2013 +0200
+++ b/ChangeLog	Sat May 11 18:00:39 2013 +0200
@@ -1,3 +1,8 @@
+2013-05-11  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/x86_64/coreisbr/mul_1.asm: Handle n = 1 for DOS64.  Streamline.
+	* mpn/x86_64/coreisbr/aorsmul_1.asm: Streamline.
+
 2013-05-10  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/x86_64/coreisbr/aorsmul_1.asm: Fix, then enable DOS64 support.
diff -r 19a0318df6f4 -r ea101cedad37 mpn/x86_64/coreisbr/aorsmul_1.asm
--- a/mpn/x86_64/coreisbr/aorsmul_1.asm	Fri May 10 18:01:39 2013 +0200
+++ b/mpn/x86_64/coreisbr/aorsmul_1.asm	Sat May 11 18:00:39 2013 +0200
@@ -1,6 +1,6 @@
 dnl  X86-64 mpn_addmul_1 and mpn_submul_1 optimised for Intel Sandy Bridge.
 
-dnl  Copyright 2003, 2004, 2005, 2007, 2008, 2011, 2012 Free Software
+dnl  Copyright 2003, 2004, 2005, 2007, 2008, 2011, 2012, 2013 Free Software
 dnl  Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
@@ -59,12 +59,13 @@
 
 MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
 
-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', ``rbx'')	') dnl
+IFDOS(`	define(`up',     ``%rsi'')') dnl
+IFDOS(`	define(`rp',     ``%rcx'')') dnl
+IFDOS(`	define(`v0',     ``%r9'')') dnl
+IFDOS(`	define(`r9',     ``rdi'')') dnl
+IFDOS(`	define(`n_param',``%r8'')') dnl
+IFDOS(`	define(`n',      ``%r8'')') dnl
+IFDOS(`	define(`r8',     ``rbx'')') dnl
 
 ASM_START()
 	TEXT
@@ -77,11 +78,10 @@
 
 	mov	(up), %rax
 	push	%rbx
-IFSTD(`	mov	R32(n_param), R32(%rdx)	')
-IFDOS(`	mov	n, %rdx			')
-IFSTD(`	mov	R32(n_param), R32(n)	')
+	mov	R32(`n_param'), R32(%rdx)
+IFSTD(`	mov	n_param, n		')
 
-	lea	-8(up,n,8), up
+	lea	-8(up,n_param,8), up
 	and	$3, R32(%rdx)
 	jz	L(b0)
 	cmp	$2, R32(%rdx)
diff -r 19a0318df6f4 -r ea101cedad37 mpn/x86_64/coreisbr/mul_1.asm
--- a/mpn/x86_64/coreisbr/mul_1.asm	Fri May 10 18:01:39 2013 +0200
+++ b/mpn/x86_64/coreisbr/mul_1.asm	Sat May 11 18:00:39 2013 +0200
@@ -1,6 +1,6 @@
 dnl  X86-64 mpn_mul_1 optimised for Intel Sandy Bridge.
 
-dnl  Copyright 2003, 2004, 2005, 2007, 2008, 2011, 2012 Free Software
+dnl  Copyright 2003, 2004, 2005, 2007, 2008, 2011, 2012, 2013 Free Software
 dnl  Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
@@ -49,26 +49,26 @@
 ABI_SUPPORT(DOS64)
 ABI_SUPPORT(STD64)
 
-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
+IFDOS(`	define(`up',     ``%rsi'')') dnl
+IFDOS(`	define(`rp',     ``%rcx'')') dnl
+IFDOS(`	define(`v0',     ``%r9'')') dnl
+IFDOS(`	define(`r9',     ``rdi'')') dnl
+IFDOS(`	define(`n_param',``%r8'')') dnl
+IFDOS(`	define(`n',      ``%r8'')') dnl
+IFDOS(`	define(`r8',     ``r11'')') dnl
 
 ASM_START()
 	TEXT
 	ALIGN(16)
+PROLOGUE(mpn_mul_1)
 
-PROLOGUE(mpn_mul_1)
 IFDOS(``push	%rsi		'')
 IFDOS(``push	%rdi		'')
 IFDOS(``mov	%rdx, %rsi	'')
 
 	mov	(up), %rax
-IFSTD(`	mov	R32(n_param), R32(%r10)	')
-IFDOS(`	mov	n, %r10			')
-IFSTD(`	mov	R32(n_param), R32(n)	')
+	mov	R32(`n_param'), R32(%r10)
+IFSTD(`	mov	n_param, n		')
 
 	lea	(up,n_param,8), up
 	lea	-8(rp,n_param,8), rp
@@ -92,6 +92,8 @@
 	jnc	L(L1)
 	mov	%rax, (rp)
 	mov	%rdx, %rax
+IFDOS(``pop	%rdi		'')
+IFDOS(``pop	%rsi		'')
 	ret
 
 L(b2):	add	$-2, n


More information about the gmp-commit mailing list