[Gmp-commit] /var/hg/gmp: 4 new changesets
mercurial at gmplib.org
mercurial at gmplib.org
Sat Oct 22 22:05:52 CEST 2011
details: /var/hg/gmp/rev/63758c9587d8
changeset: 14365:63758c9587d8
user: Torbjorn Granlund <tege at gmplib.org>
date: Thu Oct 20 17:39:40 2011 +0200
description:
Add cycle count.
details: /var/hg/gmp/rev/220d5ac8937d
changeset: 14366:220d5ac8937d
user: Torbjorn Granlund <tege at gmplib.org>
date: Thu Oct 20 17:41:14 2011 +0200
description:
Fix naming typo and minsize typo from last change.
details: /var/hg/gmp/rev/079d17523740
changeset: 14367:079d17523740
user: Torbjorn Granlund <tege at gmplib.org>
date: Sat Oct 22 19:24:58 2011 +0200
description:
Rewrite s390_64 add/sub code, move result to aors_n.asm.
details: /var/hg/gmp/rev/f67fd2d23588
changeset: 14368:f67fd2d23588
user: Torbjorn Granlund <tege at gmplib.org>
date: Sat Oct 22 19:29:24 2011 +0200
description:
New file.
diffstat:
ChangeLog | 4 +
mpn/s390_32/esame/sqr_diag_addlsh1.asm | 4 +-
mpn/s390_64/add_n.asm | 102 -------------
mpn/s390_64/aors_n.asm | 124 +++++++++++++++
mpn/s390_64/logops_n.asm | 257 +++++++++++++++++++++++++++++++++
mpn/s390_64/sqr_diag_addlsh1.asm | 4 +-
mpn/s390_64/sub_n.asm | 105 -------------
tune/common.c | 4 +-
tune/speed.h | 4 +-
9 files changed, 392 insertions(+), 216 deletions(-)
diffs (truncated from 691 to 300 lines):
diff -r 3a8bda046088 -r f67fd2d23588 ChangeLog
--- a/ChangeLog Thu Oct 20 09:08:57 2011 +0200
+++ b/ChangeLog Sat Oct 22 19:29:24 2011 +0200
@@ -1,3 +1,7 @@
+2011-10-22 Torbjorn Granlund <tege at gmplib.org>
+
+ * mpn/s390_64/aors_n.asm: New file, with rewritten add/sub code.
+
2011-10-20 Torbjorn Granlund <tege at gmplib.org>
* tune/speed.h (SPEED_ROUTINE_MPN_SQR_DIAL_ADDLSH1_CALL): New macro.
diff -r 3a8bda046088 -r f67fd2d23588 mpn/s390_32/esame/sqr_diag_addlsh1.asm
--- a/mpn/s390_32/esame/sqr_diag_addlsh1.asm Thu Oct 20 09:08:57 2011 +0200
+++ b/mpn/s390_32/esame/sqr_diag_addlsh1.asm Sat Oct 22 19:29:24 2011 +0200
@@ -20,7 +20,7 @@
include(`../config.m4')
C cycles/limb
-C z900 ?
+C z900 13
C z990 8
C z9 ?
C z10 ?
@@ -36,7 +36,7 @@
PROLOGUE(mpn_sqr_diag_addlsh1)
stm %r6, %r9, 24(%r15)
- lhi %r9, -1 C save non-carry state
+ lhi %r9, -1 C set non-carry state
l %r1, 0(up)
mlr %r0, %r1
diff -r 3a8bda046088 -r f67fd2d23588 mpn/s390_64/add_n.asm
--- a/mpn/s390_64/add_n.asm Thu Oct 20 09:08:57 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-dnl S/390-64 mpn_add_n
-
-dnl Copyright 2011 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU Lesser General Public License as published
-dnl by the Free Software Foundation; either version 3 of the License, or (at
-dnl your option) any later version.
-
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-dnl License for more details.
-
-dnl You should have received a copy of the GNU Lesser General Public License
-dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-C cycles/limb
-C z900 6.5
-C z990 3.5
-C z9 ?
-C z10 ?
-C z196 ?
-
-C TODO
-C * Optimise for small n
-C * Use r0 and save/restore one less register
-
-C INPUT PARAMETERS
-define(`rp', `%r2')
-define(`up', `%r3')
-define(`vp', `%r4')
-define(`n', `%r5')
-
-ASM_START()
-PROLOGUE(mpn_add_n)
- stmg %r6, %r12, 48(%r15)
-
- la %r1, 3(n)
- lghi %r7, 3
- srlg %r1, %r1, 2
- ngr %r7, n C n mod 4
- je L(top) C The C flag is clear
- cghi %r7, 2
- jl L(b1)
- je L(b2)
-
-L(b3): lmg %r5, %r7, 0(up)
- la up, 24(up)
- lmg %r9, %r11, 0(vp)
- la vp, 24(vp)
- algr %r5, %r9
- alcgr %r6, %r10
- alcgr %r7, %r11
- stmg %r5, %r7, 0(rp)
- la rp, 24(rp)
- brctg %r1, L(top)
- j L(end)
-
-L(b1): lg %r5, 0(up)
- la up, 8(up)
- lg %r9, 0(vp)
- la vp, 8(vp)
- algr %r5, %r9
- stg %r5, 0(rp)
- la rp, 8(rp)
- brctg %r1, L(top)
- j L(end)
-
-L(b2): lmg %r5, %r6, 0(up)
- la up, 16(up)
- lmg %r9, %r10, 0(vp)
- la vp, 16(vp)
- algr %r5, %r9
- alcgr %r6, %r10
- stmg %r5, %r6, 0(rp)
- la rp, 16(rp)
- brctg %r1, L(top)
- j L(end)
-
-L(top): lmg %r5, %r8, 0(up)
- la up, 32(up)
- lmg %r9, %r12, 0(vp)
- la vp, 32(vp)
- alcgr %r5, %r9
- alcgr %r6, %r10
- alcgr %r7, %r11
- alcgr %r8, %r12
- stmg %r5, %r8, 0(rp)
- la rp, 32(rp)
- brctg %r1, L(top)
-
-L(end): lghi %r2, 0
- alcgr %r2, %r2
-
- lmg %r6, %r12, 48(%r15)
- br %r14
-EPILOGUE()
diff -r 3a8bda046088 -r f67fd2d23588 mpn/s390_64/aors_n.asm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/s390_64/aors_n.asm Sat Oct 22 19:29:24 2011 +0200
@@ -0,0 +1,124 @@
+dnl S/390-64 mpn_add_n and mpn_sub_n.
+
+dnl Copyright 2011 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU Lesser General Public License as published
+dnl by the Free Software Foundation; either version 3 of the License, or (at
+dnl your option) any later version.
+
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+dnl License for more details.
+
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C z900 5.5
+C z990 3
+C z9 ?
+C z10 ?
+C z196 ?
+
+C TODO
+C * Optimise for small n
+C * Use r0 and save/restore one less register
+
+C INPUT PARAMETERS
+define(`rp', `%r2')
+define(`up', `%r3')
+define(`vp', `%r4')
+define(`n', `%r5')
+
+ifdef(`OPERATION_add_n', `
+ define(ADSB, alg)
+ define(ADSBCR, alcgr)
+ define(ADSBC, alcg)
+ define(RETVAL,`
+ lghi %r2, 0
+ alcgr %r2, %r2')
+ define(func, mpn_add_n)
+ define(func_nc, mpn_add_nc)')
+ifdef(`OPERATION_sub_n', `
+ define(ADSB, slg)
+ define(ADSBCR, slbgr)
+ define(ADSBC, slbg)
+ define(RETVAL,`
+ slbgr %r2, %r2
+ lcgr %r2, %r2')
+ define(func, mpn_sub_n)
+ define(func_nc, mpn_sub_nc)')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ stmg %r6, %r12, 48(%r15)
+
+ aghi n, 3
+ lghi %r7, 3
+ srlg %r1, n, 2
+ ngr %r7, n C n mod 4
+ je L(b1)
+ cghi %r7, 2
+ jl L(b2)
+ jne L(b0)
+
+L(b3): lmg %r5, %r7, 0(up)
+ la up, 24(up)
+ ADSB %r5, 0(vp)
+ ADSBC %r6, 8(vp)
+ ADSBC %r7, 16(vp)
+ la vp, 24(vp)
+ stmg %r5, %r7, 0(rp)
+ la rp, 24(rp)
+ brctg %r1, L(top)
+ j L(end)
+
+L(b0): lmg %r5, %r8, 0(up) C This redundant insns is no mistake,
+ la up, 32(up) C it is needed to make main loop run
+ ADSB %r5, 0(vp) C fast for n = 0 (mod 4).
+ ADSBC %r6, 8(vp)
+ j L(m0)
+
+L(b1): lg %r5, 0(up)
+ la up, 8(up)
+ ADSB %r5, 0(vp)
+ la vp, 8(vp)
+ stg %r5, 0(rp)
+ la rp, 8(rp)
+ brctg %r1, L(top)
+ j L(end)
+
+L(b2): lmg %r5, %r6, 0(up)
+ la up, 16(up)
+ ADSB %r5, 0(vp)
+ ADSBC %r6, 8(vp)
+ la vp, 16(vp)
+ stmg %r5, %r6, 0(rp)
+ la rp, 16(rp)
+ brctg %r1, L(top)
+ j L(end)
+
+L(top): lmg %r5, %r8, 0(up)
+ la up, 32(up)
+ ADSBC %r5, 0(vp)
+ ADSBC %r6, 8(vp)
+L(m0): ADSBC %r7, 16(vp)
+ ADSBC %r8, 24(vp)
+ la vp, 32(vp)
+ stmg %r5, %r8, 0(rp)
+ la rp, 32(rp)
+ brctg %r1, L(top)
+
+L(end): RETVAL
+
+ lmg %r6, %r12, 48(%r15)
+ br %r14
+EPILOGUE()
diff -r 3a8bda046088 -r f67fd2d23588 mpn/s390_64/logops_n.asm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/s390_64/logops_n.asm Sat Oct 22 19:29:24 2011 +0200
@@ -0,0 +1,257 @@
+dnl S/390-64 logops.
+
+dnl Copyright 2011 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU Lesser General Public License as published
+dnl by the Free Software Foundation; either version 3 of the License, or (at
+dnl your option) any later version.
+
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+dnl License for more details.
+
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
+
+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 INPUT PARAMETERS
More information about the gmp-commit
mailing list