[Gmp-commit] /var/hg/gmp: Make it work for DOS64 again.

mercurial at gmplib.org mercurial at gmplib.org
Thu Feb 23 16:20:31 CET 2012


details:   /var/hg/gmp/rev/ee26fb8c4a3d
changeset: 14663:ee26fb8c4a3d
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Feb 23 16:20:25 2012 +0100
description:
Make it work for DOS64 again.

diffstat:

 ChangeLog             |   4 ++++
 mpn/x86_64/redc_1.asm |  29 +++++++++++++++++------------
 2 files changed, 21 insertions(+), 12 deletions(-)

diffs (57 lines):

diff -r 872770d4ed80 -r ee26fb8c4a3d ChangeLog
--- a/ChangeLog	Tue Feb 21 15:35:32 2012 +0100
+++ b/ChangeLog	Thu Feb 23 16:20:25 2012 +0100
@@ -1,3 +1,7 @@
+2012-02-23  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/x86_64/redc_1.asm: Make it work for DOS64 (broken in last edit).
+
 2012-02-20 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mpn/generic/toom_interpolate_8pts.c: Compute carry iif non-trivial.
diff -r 872770d4ed80 -r ee26fb8c4a3d mpn/x86_64/redc_1.asm
--- a/mpn/x86_64/redc_1.asm	Tue Feb 21 15:35:32 2012 +0100
+++ b/mpn/x86_64/redc_1.asm	Thu Feb 23 16:20:25 2012 +0100
@@ -41,11 +41,11 @@
 C  * Make a tail call to mpn_add_n.
 
 C INPUT PARAMETERS
-define(`rp',	  `%rdi')
-define(`up',	  `%rsi')
-define(`mp_param',`%rdx')
-define(`n',	  `%rcx')
-define(`invm',	  `%r8')
+define(`rp',	  `%rdi')	C rcx
+define(`up',	  `%rsi')	C rdx
+define(`mp_param',`%rdx')	C r8
+define(`n',	  `%rcx')	C r9
+define(`invm',	  `%r8')	C stack
 
 define(`mp',	  `%r13')
 define(`i',	  `%r11')
@@ -302,13 +302,18 @@
 L(common):
 
 C   cy = mpn_add_n (rp, up, up - n, n);
-C		    rdi rsi  rdx    rcx
-C	lea	(up,nneg,8), up		C up -= n
-	lea	(up,nneg,8), %rdx	C rdx = up - n [up entry value]
-	mov	nneg, %rcx
-	neg	%rcx
-C	mov	rp, %rdi		C rp already in place
-	CALL(	mpn_add_n)
+C		    rdi rsi  rdx    rcx		STD
+C		    rcx rdx  r8     r9		DOS
+
+IFSTD(` lea	(up,nneg,8), %rdx	') C rdx = up - n [up entry value]
+IFSTD(` mov	nneg, %rcx		')
+IFSTD(` neg	%rcx			') C rcx = -nneg = n
+
+IFDOS(` lea	(up,nneg,8), %r8	') C r8 = up - n
+IFDOS(` mov	up, %rdx		') C rdx = up
+IFDOS(` mov	nneg, %r9		')
+IFDOS(` neg	%r9			') C r9 = -nneg = n
+IFDOS(` mov	rp, %rcx		') C rcx = rp
 
 	pop	%r14
 	pop	%r13


More information about the gmp-commit mailing list