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

mercurial at gmplib.org mercurial at gmplib.org
Mon Mar 7 22:23:59 CET 2011


details:   /var/hg/gmp/rev/478e72290673
changeset: 14009:478e72290673
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 07 21:33:45 2011 +0100
description:
Workaround Oracle assembler bug.

details:   /var/hg/gmp/rev/1481da82a92b
changeset: 14010:1481da82a92b
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 07 22:23:55 2011 +0100
description:
Trivial merge.

diffstat:

 ChangeLog                          |   4 ++
 mpn/x86/atom/sse2/sqr_basecase.asm |  59 +++++++++++++++++--------------------
 mpn/x86_64/gcd_1.asm               |   2 +-
 3 files changed, 32 insertions(+), 33 deletions(-)

diffs (158 lines):

diff -r 23aac43a7ddc -r 1481da82a92b ChangeLog
--- a/ChangeLog	Mon Mar 07 17:11:10 2011 +0100
+++ b/ChangeLog	Mon Mar 07 22:23:55 2011 +0100
@@ -1,3 +1,7 @@
+2011-03-07 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* mpn/x86/atom/sse2/sqr_basecase.asm: Small code cleanup.
+
 2011-03-07  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/x86/atom/sse2/mul_basecase.asm: Replace addmul_1 loops.
diff -r 23aac43a7ddc -r 1481da82a92b mpn/x86/atom/sse2/sqr_basecase.asm
--- a/mpn/x86/atom/sse2/sqr_basecase.asm	Mon Mar 07 17:11:10 2011 +0100
+++ b/mpn/x86/atom/sse2/sqr_basecase.asm	Mon Mar 07 22:23:55 2011 +0100
@@ -60,19 +60,18 @@
 	mov	28(%esp), n
 
 	lea	4(rp), rp	C write triangular product starting at rp[1]
-	lea	-1(n), %eax
-	neg	n
+	dec	n
 	movd	(up), %mm7
 
-	test	%eax, %eax
 	jz	L(one)
+	lea	4(up), up
+	mov	n, %eax
 
-	movd	4(up), %mm0
-	lea	4(up), up
+	movd	(up), %mm0
+	neg	n
 	pmuludq	%mm7, %mm0
 	pxor	%mm6, %mm6
-	lea	1(n), un	C decr ABSOLUTE value
-	lea	1(n), n		C decr ABSOLUTE value
+	mov	n, un
 
 	and	$3, %eax
 	jz	L(of0)
@@ -246,9 +245,6 @@
 L(eq1):
 	psrlq	$32, %mm1
 	movd	%mm1, %eax
-	add	%ebx, 4(rp)
-	adc	un, %eax
-	mov	%eax, 8(rp)
 	jmp	L(cj1)
 
 L(la1):	adc	$0, %edx
@@ -303,10 +299,11 @@
 	adc	%edx, %ebx
 	movd	%mm1, %eax
 	adc	un, %eax
+L(cj1):
 	add	%ebx, 4(rp)
 	adc	un, %eax
 	mov	%eax, 8(rp)
-L(cj1):
+
 	inc	n
 	jz	L(done)
 
@@ -537,38 +534,36 @@
 
 C ================================================================
 
-L(done):
+L(done):			C n is zero here
 	mov	24(%esp), up
 	mov	28(%esp), %eax
 
 	movd	(up), %mm0
-	xor	%ebp, %ebp
+	inc	%eax
 	pmuludq	%mm0, %mm0
+	lea	4(up), up
 	mov	20(%esp), rp
 	shr	%eax
 	movd	%mm0, (rp)
 	psrlq	$32, %mm0
+	lea	-12(rp), rp
 	mov	%eax, 28(%esp)
-	jc	L(odd)
+	jnc	L(odd)
 
-	movd	%mm0, %ecx
-	movd	4(up), %mm0
-	lea	-4(rp), rp
+	movd	%mm0, %ebp
+	movd	(up), %mm0
+	lea	8(rp), rp
 	pmuludq	%mm0, %mm0
-	add	8(rp), %ecx
+	lea	-4(up), up
+	add	8(rp), %ebp
 	movd	%mm0, %edx
 	adc	12(rp), %edx
-	rcr	%ebp
+	rcr	n
 	jmp	L(ent)
 
-L(odd):	clc			C clear carry  FIXME: use test/and
-	lea	4(rp), rp
-C	jz	L(end)
-	lea	4(up), up
-
 C	ALIGN(16)		C alignment seems irrelevant
 L(top):	movd	(up), %mm1
-	adc	%ebp, %ebp
+	adc	n, n
 	movd	%mm0, %eax
 	pmuludq	%mm1, %mm1
 	movd	4(up), %mm0
@@ -577,24 +572,24 @@
 	pmuludq	%mm0, %mm0
 	psrlq	$32, %mm1
 	adc	4(rp), %ebx
-	movd	%mm1, %ecx
+	movd	%mm1, %ebp
 	movd	%mm0, %edx
-	adc	8(rp), %ecx
+	adc	8(rp), %ebp
 	adc	12(rp), %edx
-	rcr	%ebp		C FIXME: isn't this awfully slow on atom???
+	rcr	n		C FIXME: isn't this awfully slow on atom???
 	adc	%eax, (rp)
 	adc	%ebx, 4(rp)
 L(ent):	lea	8(up), up
-	adc	%ecx, 8(rp)
+	adc	%ebp, 8(rp)
 	psrlq	$32, %mm0
 	adc	%edx, 12(rp)
-	decl	28(%esp)
+L(odd):	decl	28(%esp)
 	lea	16(rp), rp
 	jnz	L(top)
 
-L(end):	adc	%ebp, %ebp
+L(end):	adc	n, n
 	movd	%mm0, %eax
-	adc	%ebp, %eax
+	adc	n, %eax
 	mov	%eax, (rp)
 
 L(rtn):	emms
diff -r 23aac43a7ddc -r 1481da82a92b mpn/x86_64/gcd_1.asm
--- a/mpn/x86_64/gcd_1.asm	Mon Mar 07 17:11:10 2011 +0100
+++ b/mpn/x86_64/gcd_1.asm	Mon Mar 07 22:23:55 2011 +0100
@@ -112,7 +112,7 @@
 	mov	%rcx, %rax		C				1
 	and	$MASK, R32(%rcx)	C				1
 
-	movzb	(%r9,%rcx), R32(%rcx)	C				2
+	movzbl	(%r9,%rcx), R32(%rcx)	C use this insn form to placate Oracle
 
 	shr	R8(%rcx), %rax		C				4
 	cmp	$MAXSHIFT, R8(%rcx)	C				4


More information about the gmp-commit mailing list