dnl Alpha mpn_divexact_by3c -- mpn division by 3, expecting no remainder.
dnl Copyright 2004, 2005, 2009 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
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 General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C EV4: 22
C EV5: 11.5
C EV6: 6.3 Note that mpn_bdiv_dbm1c is faster
C TODO
C * Remove the unops, they benefit just ev6, which no longer uses this file.
C * Try prefetch for destination, using lds.
C * Improve feed-in code, by moving initial mulq earlier; make initial load
C to u0/u0 to save some copying.
C * Combine u0 and u2, u1 and u3.
ALIGN(16)
$Ltop:
C 0
cmpult u3, cy, cy C L0
mulq u0, xAAAAAAAAAAAAAAAB, q0 C U1
ldq u1, 16(up) C L1
addq q1, l0, x C U0
C 1
negq cy, cymask C L0
unop C U1
unop C L1
cmpult x5555555555555555, x, p6 C U0
C 2
cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
unop
unop
negq p6, t0 C L0
C 3
negq p7, t1 C L0 and cymask, x5555555555555555, l0 C U1
addq p6, cy, cy and t0, x5555555555555555, t0
C 4 and t1, x5555555555555555, t1
addq p7, cy, cy
unop
addq t0, l0, l0
C 5
addq t1, l0, l0
unop
stq x, 0(rp) C L1
unop
$L01:
C 0
cmpult u0, cy, cy C L0
mulq u1, xAAAAAAAAAAAAAAAB, q1 C U1
ldq u2, 24(up) C L1
addq q0, l0, x C U0
C 1
negq cy, cymask C L0
unop C U1
unop C L1
cmpult x5555555555555555, x, p6 C U0
C 2
cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
unop
unop
negq p6, t0 C L0
C 3
negq p7, t1 C L0 and cymask, x5555555555555555, l0 C U1
addq p6, cy, cy and t0, x5555555555555555, t0
C 4 and t1, x5555555555555555, t1
addq p7, cy, cy
unop
addq t0, l0, l0
C 5
addq t1, l0, l0
unop
stq x, 8(rp) C L1
unop
$L00:
C 0
cmpult u1, cy, cy C L0
mulq u2, xAAAAAAAAAAAAAAAB, q0 C U1
ldq u3, 32(up) C L1
addq q1, l0, x C U0
C 1
negq cy, cymask C L0
unop C U1
unop C L1
cmpult x5555555555555555, x, p6 C U0
C 2
cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
unop
unop
negq p6, t0 C L0
C 3
negq p7, t1 C L0 and cymask, x5555555555555555, l0 C U1
addq p6, cy, cy and t0, x5555555555555555, t0
C 4 and t1, x5555555555555555, t1
addq p7, cy, cy
unop
addq t0, l0, l0
C 5
addq t1, l0, l0
unop
stq x, 16(rp) C L1
unop
$L11:
C 0
cmpult u2, cy, cy C L0
mulq u3, xAAAAAAAAAAAAAAAB, q1 C U1
ldq u0, 40(up) C L1
addq q0, l0, x C U0
C 1
negq cy, cymask C L0
unop C U1
unop C L1
cmpult x5555555555555555, x, p6 C U0
C 2
cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
lda n, -4(n) C L1 bookkeeping
unop
negq p6, t0 C L0
C 3
negq p7, t1 C L0 and cymask, x5555555555555555, l0 C U1
addq p6, cy, cy and t0, x5555555555555555, t0
C 4 and t1, x5555555555555555, t1
addq p7, cy, cy
unop
addq t0, l0, l0
C 5
addq t1, l0, l0
unop
stq x, 24(rp) C L1
lda up, 32(up)
C
ldl r31, 256(up) C prefetch
unop
lda rp, 32(rp)
bge n, $Ltop C U1
C *** MAIN LOOP END ***
$Lend:
cmpult u3, cy, cy C L0
mulq u0, xAAAAAAAAAAAAAAAB, q0 C U1
unop
addq q1, l0, x C U0
C 1
negq cy, cymask C L0
unop C U1
unop C L1
cmpult x5555555555555555, x, p6 C U0
C 2
cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
unop
unop
negq p6, t0 C L0
C 3
negq p7, t1 C L0 and cymask, x5555555555555555, l0 C U1
addq p6, cy, cy and t0, x5555555555555555, t0
C 4 and t1, x5555555555555555, t1
addq p7, cy, cy
unop
addq t0, l0, l0
C 5
addq t1, l0, l0
unop
stq x, 0(rp) C L1
unop
$Lcj1:
cmpult u0, cy, cy C L0
addq q0, l0, x C U0
cmpult x5555555555555555, x, p6 C U0
cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
addq p6, cy, cy
addq p7, cy, r0
stq x, 8(rp) C L1
ret r31,(r26),1
EPILOGUE()
ASM_END()
C This is useful for playing with various schedules.
C Expand as: one(0)one(1)one(2)one(3)
define(`one',`
C 0
cmpult `$'eval(($1+3)%4), cy, cy C L0
mulq `$'$1, xAAAAAAAAAAAAAAAB, `$'eval(4+$1%2) C U1
ldq `$'eval(($1+1)%4), eval($1*8+16)(up) C L1
addq `$'eval(4+($1+1)%2), l0, x C U0
C 1
negq cy, cymask C L0
unop C U1
unop C L1
cmpult x5555555555555555, x, p6 C U0
C 2
cmpult xAAAAAAAAAAAAAAAA, x, p7 C U1
unop
unop
negq p6, t0 C L0
C 3
negq p7, t1 C L0 and cymask, x5555555555555555, l0 C U1
addq p6, cy, cy and t0, x5555555555555555, t0
C 4 and t1, x5555555555555555, t1
addq p7, cy, cy
unop
addq t0, l0, l0
C 5
addq t1, l0, l0
unop
stq x, eval($1*8)(rp) C L1
unop ')
Messung V0.5
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.