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

mercurial at gmplib.org mercurial at gmplib.org
Wed Aug 30 23:00:15 UTC 2017


details:   /var/hg/gmp/rev/906a7acf1ec7
changeset: 17496:906a7acf1ec7
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Tue Aug 29 02:49:31 2017 +0200
description:
Disable mul_2 and addmul_2.

details:   /var/hg/gmp/rev/c6b5a116896d
changeset: 17497:c6b5a116896d
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Aug 31 00:53:51 2017 +0200
description:
Allow arbitrary cnd argument.

details:   /var/hg/gmp/rev/20cf1131dc94
changeset: 17498:20cf1131dc94
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Thu Aug 31 01:00:02 2017 +0200
description:
(LEA64): Rewrite for both PIC and non-PIC.

diffstat:

 mpn/sparc32/sparc-defs.m4               |  24 +++++++++++++++++++-----
 mpn/sparc64/ultrasparct3/cnd_aors_n.asm |   8 +++++---
 mpn/x86_64/silvermont/gmp-mparam.h      |   4 ++++
 3 files changed, 28 insertions(+), 8 deletions(-)

diffs (93 lines):

diff -r d9d0e185c1db -r 20cf1131dc94 mpn/sparc32/sparc-defs.m4
--- a/mpn/sparc32/sparc-defs.m4	Mon Aug 28 22:14:53 2017 +0200
+++ b/mpn/sparc32/sparc-defs.m4	Thu Aug 31 01:00:02 2017 +0200
@@ -3,7 +3,7 @@
 dnl  m4 macros for SPARC assembler (32 and 64 bit).
 
 
-dnl  Copyright 2002, 2011, 2013 Free Software Foundation, Inc.
+dnl  Copyright 2002, 2011, 2013, 2017 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 dnl
@@ -62,6 +62,15 @@
 dnl  Use whatever 64-bit code sequence is appropriate to load "symbol" into
 dnl  register "reg", potentially using register "pic_reg" to perform the
 dnl  calculations.
+dnl
+dnl  Caveat: We used to use the setx pseudo insn here, but some GNU/Linux
+dnl  releases causes invalid code or relocs for that.
+dnl
+dnl  Optimisation 1: Use thunk call instead of RDPC which causes pipeline
+dnl  replay for some sparcs.
+dnl
+dnl  Optimisation 2: Do the two symbol building sequences in parallel instead
+dnl  of one after the other.  That might need one more scratch register.
 
 define(LEA64,
 m4_assert_numargs(3)
@@ -71,9 +80,14 @@
 	sethi	%hi(_GLOBAL_OFFSET_TABLE_+4), %`$3'
 	add	%`$3', %lo(_GLOBAL_OFFSET_TABLE_+8), %`$3'
 	add	%`$2', %`$3', %`$3'
-	sethi	%hi(`$1'), %`$2'
-	or	%`$2', %lo(`$1'), %`$2'
-	ldx	[%`$3' + %`$2'], %`$2'',`
-	setx	`$1', %`$3', %`$2'')')
+	sethi	%gdop_hix22(`$1'), %`$2'
+	xor	%`$2', %gdop_lox10(`$1'), %`$2'
+	ldx	[%`$3' + %`$2'], %`$2', %gdop(`$1')
+',`
+	sethi	%h44(`$1'), %`$2'
+	or	%`$2', %m44(`$1'), %`$2'
+	sllx	%`$2', 12, %`$2'
+	or	%`$2', %l44(`$1'), %$2
+')')
 
 divert
diff -r d9d0e185c1db -r 20cf1131dc94 mpn/sparc64/ultrasparct3/cnd_aors_n.asm
--- a/mpn/sparc64/ultrasparct3/cnd_aors_n.asm	Mon Aug 28 22:14:53 2017 +0200
+++ b/mpn/sparc64/ultrasparct3/cnd_aors_n.asm	Thu Aug 31 01:00:02 2017 +0200
@@ -2,7 +2,7 @@
 
 dnl  Contributed to the GNU project by David Miller and Torbjörn Granlund.
 
-dnl  Copyright 2013 Free Software Foundation, Inc.
+dnl  Copyright 2013, 2017 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 dnl
@@ -62,7 +62,8 @@
 ifdef(`OPERATION_cnd_add_n',`
   define(`LOGOP',   `and	$1, $2, $3')
   define(`MAKEMASK',`cmp	%g0, $1
-		     subc	%g0, %g0, $2')
+		     addxc(	%g0, %g0, $2)
+		     neg	$2, $2')
   define(`INITCY',  `addcc	%g0, 0, %g0')
   define(`RETVAL',  `addxc(	%g0, %g0, %i0)')
   define(`func',    `mpn_cnd_add_n')
@@ -70,7 +71,8 @@
 ifdef(`OPERATION_cnd_sub_n',`
   define(`LOGOP',   `orn	$2, $1, $3')
   define(`MAKEMASK',`cmp	$1, 1
-		     subc	%g0, %g0, $2')
+		     addxc(	%g0, %g0, $2)
+		     neg	$2, $2')
   define(`INITCY',  `subcc	%g0, 1, %g0')
   define(`RETVAL',  `addxc(	%g0, %g0, %i0)
 		     xor	%i0, 1, %i0')
diff -r d9d0e185c1db -r 20cf1131dc94 mpn/x86_64/silvermont/gmp-mparam.h
--- a/mpn/x86_64/silvermont/gmp-mparam.h	Mon Aug 28 22:14:53 2017 +0200
+++ b/mpn/x86_64/silvermont/gmp-mparam.h	Thu Aug 31 01:00:02 2017 +0200
@@ -31,6 +31,10 @@
 #define GMP_LIMB_BITS 64
 #define GMP_LIMB_BYTES 8
 
+/* Disable use of slow functions.  FIXME: We should disable lib inclusion.  */
+#undef HAVE_NATIVE_mpn_mul_2
+#undef HAVE_NATIVE_mpn_addmul_2
+
 /* 2400 MHz Rangeley */
 /* Generated by tuneup.c, 2017-06-16, gcc 6.3 */
 


More information about the gmp-commit mailing list