glibc/sysdeps/alpha/alphaev5/rshift.S

171 lines
3.1 KiB
ArmAsm
Raw Normal View History

1995-10-16 01:18:40 +00:00
# Alpha EV5 __mpn_rshift --
# Copyright (C) 1994-2022 Free Software Foundation, Inc.
1995-10-16 01:18:40 +00:00
# This file is part of the GNU MP Library.
# The GNU MP Library is free software; you can redistribute it and/or modify
2001-07-07 10:13:33 +00:00
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or (at your
1995-10-16 01:18:40 +00:00
# option) any later version.
# The GNU MP Library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
2001-07-07 10:13:33 +00:00
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
1995-10-16 01:18:40 +00:00
# License for more details.
2001-07-07 10:13:33 +00:00
# You should have received a copy of the GNU Lesser General Public License
Prefer https to http for gnu.org and fsf.org URLs Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
2019-09-07 05:40:42 +00:00
# along with the GNU MP Library. If not, see <https://www.gnu.org/licenses/>.
1995-10-16 01:18:40 +00:00
# INPUT PARAMETERS
# res_ptr r16
# s1_ptr r17
# size r18
# cnt r19
1996-03-01 18:43:45 +00:00
# This code runs at 3.25 cycles/limb on the EV5.
1995-10-16 01:18:40 +00:00
.set noreorder
.set noat
.text
.align 3
.globl __mpn_rshift
.ent __mpn_rshift
__mpn_rshift:
.frame $30,0,$26,0
ldq $4,0($17) # load first limb
subq $31,$19,$20
subq $18,1,$18
and $18,4-1,$28 # number of limbs in first loop
sll $4,$20,$0 # compute function result
1996-03-01 18:43:45 +00:00
beq $28,.L0
1995-10-16 01:18:40 +00:00
subq $18,$28,$18
.align 3
1996-03-01 18:43:45 +00:00
.Loop0: ldq $3,8($17)
1995-10-16 01:18:40 +00:00
addq $16,8,$16
srl $4,$19,$5
addq $17,8,$17
subq $28,1,$28
sll $3,$20,$6
or $3,$3,$4
or $5,$6,$8
stq $8,-8($16)
1996-03-01 18:43:45 +00:00
bne $28,.Loop0
1995-10-16 01:18:40 +00:00
1996-03-01 18:43:45 +00:00
.L0: srl $4,$19,$24
beq $18,.Lend
1995-10-16 01:18:40 +00:00
# warm up phase 1
ldq $1,8($17)
subq $18,4,$18
ldq $2,16($17)
ldq $3,24($17)
ldq $4,32($17)
1996-03-01 18:43:45 +00:00
beq $18,.Lend1
1995-10-16 01:18:40 +00:00
# warm up phase 2
sll $1,$20,$7
srl $1,$19,$21
sll $2,$20,$8
ldq $1,40($17)
srl $2,$19,$22
ldq $2,48($17)
sll $3,$20,$5
or $7,$24,$7
srl $3,$19,$23
or $8,$21,$8
sll $4,$20,$6
ldq $3,56($17)
srl $4,$19,$24
ldq $4,64($17)
subq $18,4,$18
1996-03-01 18:43:45 +00:00
beq $18,.Lend2
1995-10-16 01:18:40 +00:00
.align 4
# main loop
1996-03-01 18:43:45 +00:00
.Loop: stq $7,0($16)
1995-10-16 01:18:40 +00:00
or $5,$22,$5
stq $8,8($16)
or $6,$23,$6
sll $1,$20,$7
subq $18,4,$18
srl $1,$19,$21
unop # ldq $31,-96($17)
sll $2,$20,$8
ldq $1,72($17)
srl $2,$19,$22
ldq $2,80($17)
stq $5,16($16)
or $7,$24,$7
stq $6,24($16)
or $8,$21,$8
sll $3,$20,$5
unop # ldq $31,-96($17)
srl $3,$19,$23
addq $16,32,$16
sll $4,$20,$6
ldq $3,88($17)
srl $4,$19,$24
ldq $4,96($17)
addq $17,32,$17
1996-03-01 18:43:45 +00:00
bne $18,.Loop
1995-10-16 01:18:40 +00:00
# cool down phase 2/1
1996-03-01 18:43:45 +00:00
.Lend2: stq $7,0($16)
1995-10-16 01:18:40 +00:00
or $5,$22,$5
stq $8,8($16)
or $6,$23,$6
sll $1,$20,$7
srl $1,$19,$21
sll $2,$20,$8
srl $2,$19,$22
stq $5,16($16)
or $7,$24,$7
stq $6,24($16)
or $8,$21,$8
sll $3,$20,$5
srl $3,$19,$23
sll $4,$20,$6
srl $4,$19,$24
# cool down phase 2/2
stq $7,32($16)
or $5,$22,$5
stq $8,40($16)
or $6,$23,$6
stq $5,48($16)
stq $6,56($16)
# cool down phase 2/3
stq $24,64($16)
ret $31,($26),1
# cool down phase 1/1
1996-03-01 18:43:45 +00:00
.Lend1: sll $1,$20,$7
1995-10-16 01:18:40 +00:00
srl $1,$19,$21
sll $2,$20,$8
srl $2,$19,$22
sll $3,$20,$5
or $7,$24,$7
srl $3,$19,$23
or $8,$21,$8
sll $4,$20,$6
srl $4,$19,$24
# cool down phase 1/2
stq $7,0($16)
or $5,$22,$5
stq $8,8($16)
or $6,$23,$6
stq $5,16($16)
stq $6,24($16)
stq $24,32($16)
ret $31,($26),1
1996-03-01 18:43:45 +00:00
.Lend: stq $24,0($16)
1995-10-16 01:18:40 +00:00
ret $31,($26),1
.end __mpn_rshift