dnl Contributed to the GNU project by Torbjorn Granlund.
dnl Copyright 2003-2005, 2010 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 Itanium: ?
C Itanium 2: 1
C INPUT PARAMETERS
define(`up', `r32')
define(`n', `r33')
C Some useful aliases for registers we use
define(`u0',`r14') define(`u1',`r15') define(`u2',`r16')
define(`a0',`r17') define(`a1',`r18') define(`a2',`r19')
define(`c0',`r20') define(`c1',`r21') define(`c2',`r22')
C This is a fairly simple-minded implementation. One could approach 0.67 c/l
C with a more sophisticated implementation. If we're really crazy, we could
C super-unroll, storing carries just in predicate registers, then copy them to
C a general register, and population count them from there. That'd bring us
C close to 3 insn/limb, for nearly 0.5 c/l.
C Computing n/3 needs 16 cycles, which is a lot of startup overhead.
C We therefore use a plain while-style loop:
C add n = -3, n
C cmp.le p9, p0 = 3, n
C (p9) br.cond .Loop
C Alternatively, we could table n/3 for, say, n < 256, and predicate the
C 16-cycle code.
C The summing-up code at the end was written quickly, and could surely be
C vastly improved.
ASM_START()
PROLOGUE(mpn_mod_34lsub1)
.prologue
.save ar.lc, r2
.body ifdef(`HAVE_ABI_32',`
addp4 up = 0, up C M I nop.m 0
zxt4 n = n C I ;; ')
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.