[Gmp-commit] /var/hg/gmp: 4 new changesets
mercurial at gmplib.org
mercurial at gmplib.org
Sun Feb 12 20:57:01 UTC 2017
details: /var/hg/gmp/rev/b7c07428536a
changeset: 17262:b7c07428536a
user: Torbjorn Granlund <tg at gmplib.org>
date: Sun Feb 12 21:52:53 2017 +0100
description:
(LEA): Put code in lea_list instead of in EPILOGUE_cpu.
(EPILOGUE_cpu): Output lea_list, the zap it.
details: /var/hg/gmp/rev/0b3806252384
changeset: 17263:0b3806252384
user: Torbjorn Granlund <tg at gmplib.org>
date: Sun Feb 12 21:55:15 2017 +0100
description:
For AIX, don't jump from mpn_bdiv_q_1 to middle of mpn_pi1_bdiv_q_1.
Streamline.
details: /var/hg/gmp/rev/5ad2179a66f0
changeset: 17264:5ad2179a66f0
user: Torbjorn Granlund <tg at gmplib.org>
date: Sun Feb 12 21:56:26 2017 +0100
description:
(AIX): New define.
details: /var/hg/gmp/rev/2ab28c0b9c4a
changeset: 17265:2ab28c0b9c4a
user: Torbjorn Granlund <tg at gmplib.org>
date: Sun Feb 12 21:56:48 2017 +0100
description:
ChangeLog
diffstat:
ChangeLog | 10 +++++++++-
mpn/powerpc64/aix.m4 | 2 ++
mpn/powerpc64/darwin.m4 | 13 ++++++++-----
mpn/powerpc64/mode64/bdiv_q_1.asm | 30 ++++++++++++++++--------------
4 files changed, 35 insertions(+), 20 deletions(-)
diffs (152 lines):
diff -r df28d12d9692 -r 2ab28c0b9c4a ChangeLog
--- a/ChangeLog Sun Feb 12 13:43:16 2017 +0100
+++ b/ChangeLog Sun Feb 12 21:56:48 2017 +0100
@@ -1,5 +1,14 @@
2017-02-12 Torbjörn Granlund <tg at gmplib.org>
+ * mpn/powerpc64/aix.m4 (AIX): New define.
+
+ * mpn/powerpc64/mode64/bdiv_q_1.asm: For AIX, don't jump from
+ mpn_bdiv_q_1 to middle of mpn_pi1_bdiv_q_1. Streamline.
+
+ * mpn/powerpc64/darwin.m4 (LEA): Put code in lea_list instead of in
+ EPILOGUE_cpu.
+ (EPILOGUE_cpu): Output lea_list, the zap it.
+
* mpn/sparc64/ultrasparct3/bdiv_q_1.asm: New file, based on dive_1.asm.
2017-02-11 Torbjörn Granlund <tg at gmplib.org>
@@ -23,7 +32,6 @@
2017-02-10 Torbjörn Granlund <tg at gmplib.org>
-
* mpn/arm/arm-defs.m4 (EPILOGUE_cpu): Zap lea_list to avoid repetition.
* mpn/x86_64/bdiv_q_1.asm: Rewrite, base on atom/dive_1.asm.
diff -r df28d12d9692 -r 2ab28c0b9c4a mpn/powerpc64/aix.m4
--- a/mpn/powerpc64/aix.m4 Sun Feb 12 13:43:16 2017 +0100
+++ b/mpn/powerpc64/aix.m4 Sun Feb 12 21:56:48 2017 +0100
@@ -29,6 +29,8 @@
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
+define(`AIX')
+
define(`ASM_START',
`.machine "any"
.toc')
diff -r df28d12d9692 -r 2ab28c0b9c4a mpn/powerpc64/darwin.m4
--- a/mpn/powerpc64/darwin.m4 Sun Feb 12 13:43:16 2017 +0100
+++ b/mpn/powerpc64/darwin.m4 Sun Feb 12 21:56:48 2017 +0100
@@ -29,14 +29,14 @@
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
+define(`DARWIN')
+
define(`ASM_START',`')
dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,toc])
dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
dnl
-define(`DARWIN')
-
define(`PROLOGUE_cpu',
m4_assert_numargs_range(1,2)
`ifelse(`$2',toc,,
@@ -46,8 +46,7 @@
.align 5
$1:')
-define(`EPILOGUE_cpu',
-m4_assert_numargs(1))
+define(`lea_list', `')
dnl LEAL -- Load Effective Address Local. This is to be used for symbols
dnl defined in the same file. It will not work for externally defined
@@ -74,7 +73,7 @@
define(`LEA',
m4_assert_numargs(2)
`ifdef(`PIC',
-`define(`EPILOGUE_cpu',
+`define(`lea_list',
` .non_lazy_symbol_pointer
`L'$2`'$non_lazy_ptr:
.indirect_symbol $2
@@ -112,6 +111,10 @@
define(`CALL',
`bl GSYM_PREFIX`'$1')
+define(`EPILOGUE_cpu',
+`lea_list'
+`define(`lea_list', `')')
+
define(`ASM_END', `dnl')
define(`EXTRA_REGISTER', r2)
diff -r df28d12d9692 -r 2ab28c0b9c4a mpn/powerpc64/mode64/bdiv_q_1.asm
--- a/mpn/powerpc64/mode64/bdiv_q_1.asm Sun Feb 12 13:43:16 2017 +0100
+++ b/mpn/powerpc64/mode64/bdiv_q_1.asm Sun Feb 12 21:56:48 2017 +0100
@@ -55,44 +55,46 @@
EXTERN(binvert_limb_table)
PROLOGUE(mpn_bdiv_q_1,toc)
- addic r7, n, -1
+ addi r7, n, -1
cmpi cr1, n, 1
ld r12, 0(up)
- rldicl. r0, d, 0, 63
li cnt, 0
- bne cr0, L(7)
neg r0, d
and r0, d, r0
cntlzd r0, r0
- subfic r0, r0, 63
- rldicl cnt, r0, 0, 32
- srd d, d, r0
+ subfic cnt, r0, 63
+ srd d, d, cnt
L(7):
mtctr r7
- LEA( r5, binvert_limb_table)
+ LEA( r10, binvert_limb_table)
rldicl r11, d, 63, 57
- lbzx r0, r5, r11
+ lbzx r0, r10, r11
mulld r9, r0, r0
sldi r0, r0, 1
mulld r9, d, r9
subf r0, r9, r0
- mulld r5, r0, r0
+ mulld r10, r0, r0
sldi r0, r0, 1
- mulld r5, d, r5
- subf r0, r5, r0
+ mulld r10, d, r10
+ subf r0, r10, r0
mulld r9, r0, r0
sldi r0, r0, 1
mulld r9, d, r9
subf di, r9, r0 C di = 1/d mod 2^64
-
+ifdef(`AIX',
+` C For AIX it is not clear how to jump into another function.
+ b .mpn_pi1_bdiv_q_1
+',`
+ C For non-AIX, dispatch into the pi1 variant.
bne cr0, L(norm)
b L(unorm)
+')
EPILOGUE()
-PROLOGUE(mpn_pi1_bdiv_q_1,toc)
+PROLOGUE(mpn_pi1_bdiv_q_1)
cmpi cr0, cnt, 0
ld r12, 0(up)
- addic r0, n, -1
+ addic r0, n, -1 C set carry as side effect
cmpi cr1, n, 1
mtctr r0
beq cr0, L(norm)
More information about the gmp-commit
mailing list