dnl Copyright 2001, 2003 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 INPUT PARAMETERS
C rp i0
C up i1
C n i2
C Thiscode uses a very deep software pipeline, due to the need for moving data
C forth and back between the integer registers and floating-point registers.
C
C A VIS variant of thiscode would make the pipeline less deep, since the
C masking now done in the integer unit could take place in the floating-point
C unit using the FAND instruction. It would be possible to save several cycles
C too.
C
C On UltraSPARC 1 and 2, thiscode runs at 11 cycles/limb from the Dcache and
C not much slower from the Ecache. It would perhaps be possible to shave off
C one cycle, but not easily. We cannot do better than 10 cycles/limb with the
C used instructions, since we have 10 memory operations per limb. But a VIS
C variant could run three cycles faster than the corresponding non-VIS code.
C This is non-pipelined code showing the algorithm:
C
C .Loop:
C lduw [up+0],%g4 C 00000000hhhhllll
C sllx %g4,16,%g3 C 0000hhhhllll0000
C or %g3,%g4,%g2 C 0000hhhhXXXXllll
C andn %g2,%g5,%g2 C 0000hhhh0000llll
C stx %g2,[%fp+80]
C ldd [%fp+80],%f0
C fitod %f0,%f4 C hi16
C fitod %f1,%f6 C lo16
C ld [up+0],%f9
C fxtod %f8,%f2
C fmuld %f2,%f4,%f4
C fmuld %f2,%f6,%f6
C fdtox %f4,%f4
C fdtox %f6,%f6
C std %f4,[%fp-24]
C std %f6,[%fp-16]
C ldx [%fp-24],%g2
C ldx [%fp-16],%g1
C sllx %g2,16,%g2
C add %g2,%g1,%g1
C stw %g1,[rp+0]
C srlx %g1,32,%l0
C stw %l0,[rp+4]
C add up,4,up
C subcc n,1,n
C bne,pt %icc,.Loop
C add rp,8,rp
define(`fanop',`fitod %f12,%f10') dnl A quasi nop running in the FA pipe
lduw [%i1+8],%g4 add %i1,4,%i1 C s1_ptr++
sllx %g4,16,%g3 C 0000hhhhllll0000 or %g3,%g4,%g2 C 0000hhhhXXXXllll
subcc %i2,1,%i2
bne,pt %icc,.L_grt_1
andn %g2,%g5,%g2 C 0000hhhh0000llll
.L_grt_1:
stx %g2,[%fp+80]
lduw [%i1+8],%g4 add %i1,4,%i1 C s1_ptr++
sllx %g4,16,%g3 C 0000hhhhllll0000 or %g3,%g4,%g2 C 0000hhhhXXXXllll
subcc %i2,1,%i2
bne,pt %icc,.L_grt_2
andn %g2,%g5,%g2 C 0000hhhh0000llll
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.