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

mercurial at gmplib.org mercurial at gmplib.org
Sun Oct 23 21:57:05 CEST 2011


details:   /var/hg/gmp/rev/5692b50c23ad
changeset: 14378:5692b50c23ad
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Oct 23 21:43:34 2011 +0200
description:
(speed_mpn_and_n, speed_mpn_andn_n, etc): Pass correct input args.

details:   /var/hg/gmp/rev/59ae7cd9650b
changeset: 14379:59ae7cd9650b
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Oct 23 21:43:50 2011 +0200
description:
*** empty log message ***

details:   /var/hg/gmp/rev/61fe14f7b574
changeset: 14380:61fe14f7b574
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Oct 23 21:54:56 2011 +0200
description:
Use nc, oc, xc when possible.

details:   /var/hg/gmp/rev/a7f13a059476
changeset: 14381:a7f13a059476
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Oct 23 21:57:00 2011 +0200
description:
*** empty log message ***

diffstat:

 ChangeLog                |   5 +++++
 mpn/s390_64/logops_n.asm |  38 +++++++++++++++++++++++++++++++-------
 tune/common.c            |  16 ++++++++--------
 3 files changed, 44 insertions(+), 15 deletions(-)

diffs (144 lines):

diff -r a66368f7f3e7 -r a7f13a059476 ChangeLog
--- a/ChangeLog	Sun Oct 23 21:09:15 2011 +0200
+++ b/ChangeLog	Sun Oct 23 21:57:00 2011 +0200
@@ -1,5 +1,10 @@
 2011-10-23  Torbjorn Granlund  <tege at gmplib.org>
 
+	* mpn/s390_64/logops_n.asm: Use nc, oc, xc when possible.
+
+	* tune/common.c (speed_mpn_and_n, speed_mpn_andn_n, etc):
+	Pass correct input args.
+
 	* mpn/s390_64/mod_34lsub1.asm: Use llgfr for zero extensions.
 
 	* mpn/s390_64/mul_basecase.asm: New file.
diff -r a66368f7f3e7 -r a7f13a059476 mpn/s390_64/logops_n.asm
--- a/mpn/s390_64/logops_n.asm	Sun Oct 23 21:09:15 2011 +0200
+++ b/mpn/s390_64/logops_n.asm	Sun Oct 23 21:57:00 2011 +0200
@@ -19,13 +19,13 @@
 
 include(`../config.m4')
 
-C            cycles/limb     cycles/limb     cycles/limb
-C                v1              v2              v3
-C z900		 4.5		 5.5		 5.5
-C z990		 2.75		 3.25		 3.25
-C z9		 ?		 ?		 ?
-C z10		 ?		 ?		 ?
-C z196		 ?		 ?		 ?
+C cycles/limb     variant 1           variant 2       variant 3
+C	        rp!=up  rp=up
+C z900		 4.5	 ?		 5.5		 5.5
+C z990		 2.75	1.75-2		 3.25		 3.25
+C z9		 ?			 ?		 ?
+C z10		 ?			 ?		 ?
+C z196		 ?			 ?		 ?
 
 C INPUT PARAMETERS
 define(`rp',	`%r2')
@@ -36,6 +36,7 @@
 ifdef(`OPERATION_and_n',`
   define(`func',`mpn_and_n')
   define(`VARIANT_1')
+  define(`LOGOPC',`nc')
   define(`LOGOP',`ng')')
 ifdef(`OPERATION_andn_n',`
   define(`func',`mpn_andn_n')
@@ -48,6 +49,7 @@
 ifdef(`OPERATION_ior_n',`
   define(`func',`mpn_ior_n')
   define(`VARIANT_1')
+  define(`LOGOPC',`oc')
   define(`LOGOP',`og')')
 ifdef(`OPERATION_iorn_n',`
   define(`func',`mpn_iorn_n')
@@ -60,6 +62,7 @@
 ifdef(`OPERATION_xor_n',`
   define(`func',`mpn_xor_n')
   define(`VARIANT_1')
+  define(`LOGOPC',`xc')
   define(`LOGOP',`xg')')
 ifdef(`OPERATION_xnor_n',`
   define(`func',`mpn_xnor_n')
@@ -71,6 +74,27 @@
 ASM_START()
 PROLOGUE(func)
 ifdef(`VARIANT_1',`
+	cgr	rp, up
+	jne	L(normal)
+
+	sllg	n, n, 3
+	aghi	n, -1
+	srlg	%r1, n, 8
+	ltgr	%r1, %r1		C < 256 bytes to copy?
+	je	L(1)
+
+L(tp): 	LOGOPC	0(256, rp), 0(vp)
+	la	rp, 256(rp)
+	la	vp, 256(vp)
+	brctg	%r1, L(tp)
+
+L(1):	bras	%r1, L(2)		C make r1 point to mvc insn
+	nc	0(1, rp), 0(vp)
+L(2):	ex	n, 0(%r1)		C execute mvc with length ((n-1) mod 256)+1
+L(rtn):	br	%r14
+
+
+L(normal):
 	stmg	%r6, %r8, 48(%r15)
 	aghi	n, 3
 	lghi	%r7, 3
diff -r a66368f7f3e7 -r a7f13a059476 tune/common.c
--- a/tune/common.c	Sun Oct 23 21:09:15 2011 +0200
+++ b/tune/common.c	Sun Oct 23 21:57:00 2011 +0200
@@ -1112,42 +1112,42 @@
 double
 speed_mpn_and_n (struct speed_params *s)
 {
-  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_and_n (wp, s->xp, s->yp, s->size));
+  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_and_n (wp, xp, yp, s->size));
 }
 double
 speed_mpn_andn_n (struct speed_params *s)
 {
-SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_andn_n (wp, s->xp, s->yp, s->size));
+  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_andn_n (wp, xp, yp, s->size));
 }
 double
 speed_mpn_nand_n (struct speed_params *s)
 {
-  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_nand_n (wp, s->xp, s->yp, s->size));
+  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_nand_n (wp, xp, yp, s->size));
 }
 double
 speed_mpn_ior_n (struct speed_params *s)
 {
-SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_ior_n (wp, s->xp, s->yp, s->size));
+  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_ior_n (wp, xp, yp, s->size));
 }
 double
 speed_mpn_iorn_n (struct speed_params *s)
 {
-  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_iorn_n (wp, s->xp, s->yp, s->size));
+  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_iorn_n (wp, xp, yp, s->size));
 }
 double
 speed_mpn_nior_n (struct speed_params *s)
 {
-  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_nior_n (wp, s->xp, s->yp, s->size));
+  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_nior_n (wp, xp, yp, s->size));
 }
 double
 speed_mpn_xor_n (struct speed_params *s)
 {
-  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_xor_n (wp, s->xp, s->yp, s->size));
+  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_xor_n (wp, xp, yp, s->size));
 }
 double
 speed_mpn_xnor_n (struct speed_params *s)
 {
-  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_xnor_n (wp, s->xp, s->yp, s->size));
+  SPEED_ROUTINE_MPN_BINARY_N_CALL (mpn_xnor_n (wp, xp, yp, s->size));
 }
 
 


More information about the gmp-commit mailing list