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

mercurial at gmplib.org mercurial at gmplib.org
Thu Aug 22 20:43:03 UTC 2019


details:   /var/hg/gmp/rev/a4a15aefb42d
changeset: 17837:a4a15aefb42d
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Aug 22 22:32:14 2019 +0200
description:
(TCALL): Define, for tail calls.

details:   /var/hg/gmp/rev/c9a8cea1d06d
changeset: 17838:c9a8cea1d06d
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Aug 22 22:32:45 2019 +0200
description:
Use TCALL for gcd_11 calls. Suppress DOS64 support claims.

diffstat:

 mpn/x86_64/atom/gcd_22.asm     |   2 +-
 mpn/x86_64/bd4/gcd_22.asm      |   2 +-
 mpn/x86_64/bt1/gcd_22.asm      |   4 ++--
 mpn/x86_64/core2/gcd_22.asm    |   4 ++--
 mpn/x86_64/coreihwl/gcd_22.asm |   4 ++--
 mpn/x86_64/darwin.m4           |   1 +
 mpn/x86_64/dos64.m4            |   1 +
 mpn/x86_64/k10/gcd_22.asm      |   4 ++--
 mpn/x86_64/k8/gcd_22.asm       |  34 +++++++++++++++++-----------------
 mpn/x86_64/x86_64-defs.m4      |   7 +++++++
 mpn/x86_64/zen/gcd_22.asm      |   2 +-
 11 files changed, 37 insertions(+), 28 deletions(-)

diffs (221 lines):

diff -r 643c931da9bd -r c9a8cea1d06d mpn/x86_64/atom/gcd_22.asm
--- a/mpn/x86_64/atom/gcd_22.asm	Thu Aug 22 15:14:09 2019 +0200
+++ b/mpn/x86_64/atom/gcd_22.asm	Thu Aug 22 22:32:45 2019 +0200
@@ -30,7 +30,7 @@
 
 include(`../config.m4')
 
-ABI_SUPPORT(DOS64)
+dnl ABI_SUPPORT(DOS64)	C returns mp_double_limb_t in memory
 ABI_SUPPORT(STD64)
 
 MULFUNC_PROLOGUE(mpn_gcd_22)
diff -r 643c931da9bd -r c9a8cea1d06d mpn/x86_64/bd4/gcd_22.asm
--- a/mpn/x86_64/bd4/gcd_22.asm	Thu Aug 22 15:14:09 2019 +0200
+++ b/mpn/x86_64/bd4/gcd_22.asm	Thu Aug 22 22:32:45 2019 +0200
@@ -30,7 +30,7 @@
 
 include(`../config.m4')
 
-ABI_SUPPORT(DOS64)
+dnl ABI_SUPPORT(DOS64)	C returns mp_double_limb_t in memory
 ABI_SUPPORT(STD64)
 
 MULFUNC_PROLOGUE(mpn_gcd_22)
diff -r 643c931da9bd -r c9a8cea1d06d mpn/x86_64/bt1/gcd_22.asm
--- a/mpn/x86_64/bt1/gcd_22.asm	Thu Aug 22 15:14:09 2019 +0200
+++ b/mpn/x86_64/bt1/gcd_22.asm	Thu Aug 22 22:32:45 2019 +0200
@@ -86,7 +86,7 @@
 define(`t0',    `%r10')
 define(`t1',    `%r11')
 
-ABI_SUPPORT(DOS64)
+dnl ABI_SUPPORT(DOS64)	C returns mp_double_limb_t in memory
 ABI_SUPPORT(STD64)
 
 ASM_START()
@@ -138,7 +138,7 @@
 	mov	u0, %rsi
 	xor	R32(%rdx), R32(%rdx)
 	pop	%r12
-	jmp	mpn_gcd_11
+	TCALL(	mpn_gcd_11)
 
 L(count_better):
 	rep;bsf	u0, cnt		C tzcnt!
diff -r 643c931da9bd -r c9a8cea1d06d mpn/x86_64/core2/gcd_22.asm
--- a/mpn/x86_64/core2/gcd_22.asm	Thu Aug 22 15:14:09 2019 +0200
+++ b/mpn/x86_64/core2/gcd_22.asm	Thu Aug 22 22:32:45 2019 +0200
@@ -72,7 +72,7 @@
 define(`t0',    `%r10')
 define(`t1',    `%r11')
 
-ABI_SUPPORT(DOS64)
+dnl ABI_SUPPORT(DOS64)	C returns mp_double_limb_t in memory
 ABI_SUPPORT(STD64)
 
 ASM_START()
@@ -113,7 +113,7 @@
 	mov	v0, %rdi
 	mov	u0, %rsi
 	xor	R32(%rdx), R32(%rdx)
-	jmp	mpn_gcd_11
+	TCALL(	mpn_gcd_11)
 
 L(lowz):C We come here when v0 - u0 = 0
 	C 1. If v1 - u1 = 0, then gcd is u = v.
diff -r 643c931da9bd -r c9a8cea1d06d mpn/x86_64/coreihwl/gcd_22.asm
--- a/mpn/x86_64/coreihwl/gcd_22.asm	Thu Aug 22 15:14:09 2019 +0200
+++ b/mpn/x86_64/coreihwl/gcd_22.asm	Thu Aug 22 22:32:45 2019 +0200
@@ -72,7 +72,7 @@
 define(`t0',    `%r10')
 define(`t1',    `%r11')
 
-ABI_SUPPORT(DOS64)
+dnl ABI_SUPPORT(DOS64)	C returns mp_double_limb_t in memory
 ABI_SUPPORT(STD64)
 
 ASM_START()
@@ -117,7 +117,7 @@
 	mov	v0, %rdi
 	mov	u0, %rsi
 	xor	R32(%rdx), R32(%rdx)
-	jmp	mpn_gcd_11
+	TCALL(	mpn_gcd_11)
 
 L(lowz):C We come here when v0 - u0 = 0
 	C 1. If v1 - u1 = 0, then gcd is u = v.
diff -r 643c931da9bd -r c9a8cea1d06d mpn/x86_64/darwin.m4
--- a/mpn/x86_64/darwin.m4	Thu Aug 22 15:14:09 2019 +0200
+++ b/mpn/x86_64/darwin.m4	Thu Aug 22 22:32:45 2019 +0200
@@ -41,6 +41,7 @@
 dnl  Simply override the definition in x86_64-defs.m4.
 
 define(`CALL',`call	GSYM_PREFIX`'$1')
+define(`TCALL',`jmp	GSYM_PREFIX`'$1')
 
 
 dnl  Usage: JUMPTABSECT
diff -r 643c931da9bd -r c9a8cea1d06d mpn/x86_64/dos64.m4
--- a/mpn/x86_64/dos64.m4	Thu Aug 22 15:14:09 2019 +0200
+++ b/mpn/x86_64/dos64.m4	Thu Aug 22 22:32:45 2019 +0200
@@ -46,6 +46,7 @@
 dnl  Simply override the definition in x86_64-defs.m4.
 
 define(`CALL',`call	GSYM_PREFIX`'$1')
+define(`TCALL',`jmp	GSYM_PREFIX`'$1')
 
 
 dnl  Usage: JUMPTABSECT
diff -r 643c931da9bd -r c9a8cea1d06d mpn/x86_64/k10/gcd_22.asm
--- a/mpn/x86_64/k10/gcd_22.asm	Thu Aug 22 15:14:09 2019 +0200
+++ b/mpn/x86_64/k10/gcd_22.asm	Thu Aug 22 22:32:45 2019 +0200
@@ -72,7 +72,7 @@
 define(`t0',    `%r10')
 define(`t1',    `%r11')
 
-ABI_SUPPORT(DOS64)
+dnl ABI_SUPPORT(DOS64)	C returns mp_double_limb_t in memory
 ABI_SUPPORT(STD64)
 
 ASM_START()
@@ -118,7 +118,7 @@
 	mov	v0, %rdi
 	mov	u0, %rsi
 	xor	R32(%rdx), R32(%rdx)
-	jmp	mpn_gcd_11
+	TCALL(	mpn_gcd_11)
 
 L(lowz):C We come here when v0 - u0 = 0
 	C 1. If v1 - u1 = 0, then gcd is u = v.
diff -r 643c931da9bd -r c9a8cea1d06d mpn/x86_64/k8/gcd_22.asm
--- a/mpn/x86_64/k8/gcd_22.asm	Thu Aug 22 15:14:09 2019 +0200
+++ b/mpn/x86_64/k8/gcd_22.asm	Thu Aug 22 22:32:45 2019 +0200
@@ -33,25 +33,25 @@
 
 C	     cycles/bit
 C AMD K8,K9	 9.0
-C AMD K10	 ?
-C AMD bd1	 ?
-C AMD bd2	 ?
+C AMD K10	 8.9
+C AMD bd1	10.1
+C AMD bd2	 9.5
 C AMD bd3	 ?
-C AMD bd4	 ?
+C AMD bd4	 7.6
 C AMD bt1	 ?
-C AMD bt2	 ?
-C AMD zn1	 ?
-C AMD zn2	 ?
+C AMD bt2	 9.6
+C AMD zn1	 7.7
+C AMD zn2	 7.6
 C Intel P4	 ?
-C Intel CNR	 ?
-C Intel PNR	 ?
-C Intel NHM	 ?
-C Intel WSM	 ?
-C Intel SBR	 ?
+C Intel CNR	10.1
+C Intel PNR	10.1
+C Intel NHM	10.1
+C Intel WSM	10.1
+C Intel SBR	11.8
 C Intel IBR	 ?
-C Intel HWL	 ?
-C Intel BWL	 ?
-C Intel SKL	 ?
+C Intel HWL	10.6
+C Intel BWL	10.2
+C Intel SKL	10.1
 C Intel atom	19.0
 C Intel SLM	14.0
 C Intel GLM	 9.9
@@ -86,7 +86,7 @@
 define(`t0',    `%r10')
 define(`t1',    `%r11')
 
-ABI_SUPPORT(DOS64)
+dnl ABI_SUPPORT(DOS64)	C returns mp_double_limb_t in memory
 ABI_SUPPORT(STD64)
 
 ASM_START()
@@ -138,7 +138,7 @@
 	mov	u0, %rsi
 	xor	R32(%rdx), R32(%rdx)
 	pop	%r12
-	jmp	mpn_gcd_11
+	TCALL(	mpn_gcd_11)
 
 L(count_better):
 	bsf	u0, cnt
diff -r 643c931da9bd -r c9a8cea1d06d mpn/x86_64/x86_64-defs.m4
--- a/mpn/x86_64/x86_64-defs.m4	Thu Aug 22 15:14:09 2019 +0200
+++ b/mpn/x86_64/x86_64-defs.m4	Thu Aug 22 22:32:45 2019 +0200
@@ -206,6 +206,13 @@
 	`call	GSYM_PREFIX`'$1'
 )')
 
+define(`TCALL',`dnl
+ifdef(`PIC',
+	`jmp	GSYM_PREFIX`'$1 at PLT'
+,
+	`jmp	GSYM_PREFIX`'$1'
+)')
+
 
 define(`JUMPTABSECT', `.section	.data.rel.ro.local,"a", at progbits')
 
diff -r 643c931da9bd -r c9a8cea1d06d mpn/x86_64/zen/gcd_22.asm
--- a/mpn/x86_64/zen/gcd_22.asm	Thu Aug 22 15:14:09 2019 +0200
+++ b/mpn/x86_64/zen/gcd_22.asm	Thu Aug 22 22:32:45 2019 +0200
@@ -30,7 +30,7 @@
 
 include(`../config.m4')
 
-ABI_SUPPORT(DOS64)
+dnl ABI_SUPPORT(DOS64)	C returns mp_double_limb_t in memory
 ABI_SUPPORT(STD64)
 
 MULFUNC_PROLOGUE(mpn_gcd_22)


More information about the gmp-commit mailing list