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

mercurial at gmplib.org mercurial at gmplib.org
Wed Jun 24 16:31:45 UTC 2015


details:   /var/hg/gmp/rev/b358347c6508
changeset: 16725:b358347c6508
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Jun 24 18:21:48 2015 +0200
description:
Suppress looping in basecase code.

details:   /var/hg/gmp/rev/6285f349f674
changeset: 16726:6285f349f674
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Jun 24 18:24:25 2015 +0200
description:
Disalllow zero size operands.

details:   /var/hg/gmp/rev/703184c711d0
changeset: 16727:703184c711d0
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Jun 24 18:31:39 2015 +0200
description:
ChangeLog

diffstat:

 ChangeLog                    |   6 ++++++
 mpn/x86_64/fastsse/com.asm   |   3 ---
 mpn/x86_64/fastsse/copyi.asm |  20 +++++++++++---------
 3 files changed, 17 insertions(+), 12 deletions(-)

diffs (74 lines):

diff -r e5ccd9546c7d -r 703184c711d0 ChangeLog
--- a/ChangeLog	Tue Jun 23 23:45:10 2015 +0200
+++ b/ChangeLog	Wed Jun 24 18:31:39 2015 +0200
@@ -1,3 +1,9 @@
+2015-06-24  Torbjörn Granlund  <torbjorng at google.com>
+
+	* mpn/x86_64/fastsse/com.asm: Disalllow zero size operands.
+
+	* mpn/x86_64/fastsse/copyi.asm: Suppress looping in basecase code.
+
 2015-06-23 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mpn/generic/sqrtrem.c (mpn_sqrtrem2): Simplify branches.
diff -r e5ccd9546c7d -r 703184c711d0 mpn/x86_64/fastsse/com.asm
--- a/mpn/x86_64/fastsse/com.asm	Tue Jun 23 23:45:10 2015 +0200
+++ b/mpn/x86_64/fastsse/com.asm	Wed Jun 24 18:31:39 2015 +0200
@@ -78,9 +78,6 @@
 PROLOGUE(mpn_com)
 	FUNC_ENTRY(3)
 
-	test	n, n
-	jz	L(don)
-
 	pcmpeqb	%xmm7, %xmm7		C set to 111...111
 
 	test	$8, R8(rp)		C is rp 16-byte aligned?
diff -r e5ccd9546c7d -r 703184c711d0 mpn/x86_64/fastsse/copyi.asm
--- a/mpn/x86_64/fastsse/copyi.asm	Tue Jun 23 23:45:10 2015 +0200
+++ b/mpn/x86_64/fastsse/copyi.asm	Wed Jun 24 18:31:39 2015 +0200
@@ -80,7 +80,7 @@
 PROLOGUE(mpn_copyi)
 	FUNC_ENTRY(3)
 
-	cmp	$3, n
+	cmp	$3, n			C NB: bc code below assumes this limit
 	jc	L(bc)
 
 	test	$8, R8(rp)		C is rp 16-byte aligned?
@@ -151,25 +151,27 @@
 	FUNC_EXIT()
 	ret
 
-C Basecase code.  Needed for good small operands speed, not for
-C correctness as the above code is currently written.
+C Basecase code.  Needed for good small operands speed, not for correctness as
+C the above code is currently written.  The commented-out lines need to be
+C reinstated if this code is to be used for n > 3, and then the post loop
+C offsets need fixing.
 
 L(bc):	sub	$2, n
 	jc	L(end)
 	ALIGN(16)
 1:	mov	(up), %rax
 	mov	8(up), %rcx
-	lea	16(up), up
+dnl	lea	16(up), up
 	mov	%rax, (rp)
 	mov	%rcx, 8(rp)
-	lea	16(rp), rp
-	sub	$2, n
-	jnc	1b
+dnl	lea	16(rp), rp
+dnl	sub	$2, n
+dnl	jnc	1b
 
 	test	$1, R8(n)
 	jz	L(ret)
-	mov	(up), %rax
-	mov	%rax, (rp)
+	mov	16(up), %rax
+	mov	%rax, 16(rp)
 L(ret):	FUNC_EXIT()
 	ret
 EPILOGUE()


More information about the gmp-commit mailing list