[PATCH 0/3] Resubmit of Sparc T3/T4 patches.
David Miller
davem at davemloft.net
Wed Mar 6 00:16:32 CET 2013
From: Torbjorn Granlund <tg at gmplib.org>
Date: Wed, 06 Mar 2013 00:08:09 +0100
> The addmul code could be simularly improved.
Grumble... and I did this work already, I sent older versions
of my T3/T4 changes, let me go see how I screwed this up:
dnl SPARC v9 mpn_addmul_1 for T3/T4.
dnl Copyright 2013 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 UltraSPARC T3: 28
C UltraSPARC T4: 5.5
C INPUT PARAMETERS
define(`rp', `%i0')
define(`up', `%i1')
define(`n', `%i2')
define(`v0', `%i3')
ASM_START()
REGISTER(%g2,#scratch)
REGISTER(%g3,#scratch)
ALIGN(32)
PROLOGUE(mpn_addmul_1)
save %sp, -176, %sp
subcc n, 1, n
be L(final_one)
subcc %g0, %g0, %o5
L(top):
ldx [up+0], %l0
ldx [up+8], %l1
ldx [rp+0], %l2
ldx [rp+8], %l3
mulx %l0, v0, %o0
add up, 16, up
umulxhi %l0, v0, %o1
add rp, 16, rp
mulx %l1, v0, %o2
sub n, 2, n
umulxhi %l1, v0, %o3
addxccc %o0, %o5, %o0
addxccc %o2, %o1, %o2
addxc %g0, %o3, %o5
addcc %o0, %l2, %o0
stx %o0, [rp-16]
addxccc %o2, %l3, %o2
brgz n, L(top)
stx %o2, [rp-8]
brlz,pt n, L(done)
nop
L(final_one):
ldx [up+0], %l0
ldx [rp+0], %l2
mulx %l0, v0, %o0
umulxhi %l0, v0, %o1
addxccc %o5, %o0, %o0
addxc %g0, %o1, %o5
addcc %l2, %o0, %o0
stx %o0, [rp+0]
L(done):
addxc %g0, %o5, %o5
ret
restore %o5, 0, %o0
EPILOGUE()
More information about the gmp-devel
mailing list