|
Packit |
5c3484 |
dnl MIPS32 mpn_lshift -- Left shift.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl Copyright 1995, 2000, 2002 Free Software Foundation, Inc.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl This file is part of the GNU MP Library.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl The GNU MP Library is free software; you can redistribute it and/or modify
|
|
Packit |
5c3484 |
dnl it under the terms of either:
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl * the GNU Lesser General Public License as published by the Free
|
|
Packit |
5c3484 |
dnl Software Foundation; either version 3 of the License, or (at your
|
|
Packit |
5c3484 |
dnl option) any later version.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl or
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl * the GNU General Public License as published by the Free Software
|
|
Packit |
5c3484 |
dnl Foundation; either version 2 of the License, or (at your option) any
|
|
Packit |
5c3484 |
dnl later version.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl or both in parallel, as here.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl The GNU MP Library is distributed in the hope that it will be useful, but
|
|
Packit |
5c3484 |
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
Packit |
5c3484 |
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
Packit |
5c3484 |
dnl for more details.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl You should have received copies of the GNU General Public License and the
|
|
Packit |
5c3484 |
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
|
|
Packit |
5c3484 |
dnl see https://www.gnu.org/licenses/.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
include(`../config.m4')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C INPUT PARAMETERS
|
|
Packit |
5c3484 |
C res_ptr $4
|
|
Packit |
5c3484 |
C src_ptr $5
|
|
Packit |
5c3484 |
C size $6
|
|
Packit |
5c3484 |
C cnt $7
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
ASM_START()
|
|
Packit |
5c3484 |
PROLOGUE(mpn_lshift)
|
|
Packit |
5c3484 |
sll $2,$6,2
|
|
Packit |
5c3484 |
addu $5,$5,$2 C make r5 point at end of src
|
|
Packit |
5c3484 |
lw $10,-4($5) C load first limb
|
|
Packit |
5c3484 |
subu $13,$0,$7
|
|
Packit |
5c3484 |
addu $4,$4,$2 C make r4 point at end of res
|
|
Packit |
5c3484 |
addiu $6,$6,-1
|
|
Packit |
5c3484 |
and $9,$6,4-1 C number of limbs in first loop
|
|
Packit |
5c3484 |
beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
|
|
Packit |
5c3484 |
srl $2,$10,$13 C compute function result
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
subu $6,$6,$9
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
.Loop0: lw $3,-8($5)
|
|
Packit |
5c3484 |
addiu $4,$4,-4
|
|
Packit |
5c3484 |
addiu $5,$5,-4
|
|
Packit |
5c3484 |
addiu $9,$9,-1
|
|
Packit |
5c3484 |
sll $11,$10,$7
|
|
Packit |
5c3484 |
srl $12,$3,$13
|
|
Packit |
5c3484 |
move $10,$3
|
|
Packit |
5c3484 |
or $8,$11,$12
|
|
Packit |
5c3484 |
bne $9,$0,.Loop0
|
|
Packit |
5c3484 |
sw $8,0($4)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
.L0: beq $6,$0,.Lend
|
|
Packit |
5c3484 |
nop
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
.Loop: lw $3,-8($5)
|
|
Packit |
5c3484 |
addiu $4,$4,-16
|
|
Packit |
5c3484 |
addiu $6,$6,-4
|
|
Packit |
5c3484 |
sll $11,$10,$7
|
|
Packit |
5c3484 |
srl $12,$3,$13
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
lw $10,-12($5)
|
|
Packit |
5c3484 |
sll $14,$3,$7
|
|
Packit |
5c3484 |
or $8,$11,$12
|
|
Packit |
5c3484 |
sw $8,12($4)
|
|
Packit |
5c3484 |
srl $9,$10,$13
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
lw $3,-16($5)
|
|
Packit |
5c3484 |
sll $11,$10,$7
|
|
Packit |
5c3484 |
or $8,$14,$9
|
|
Packit |
5c3484 |
sw $8,8($4)
|
|
Packit |
5c3484 |
srl $12,$3,$13
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
lw $10,-20($5)
|
|
Packit |
5c3484 |
sll $14,$3,$7
|
|
Packit |
5c3484 |
or $8,$11,$12
|
|
Packit |
5c3484 |
sw $8,4($4)
|
|
Packit |
5c3484 |
srl $9,$10,$13
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
addiu $5,$5,-16
|
|
Packit |
5c3484 |
or $8,$14,$9
|
|
Packit |
5c3484 |
bgtz $6,.Loop
|
|
Packit |
5c3484 |
sw $8,0($4)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
.Lend: sll $8,$10,$7
|
|
Packit |
5c3484 |
j $31
|
|
Packit |
5c3484 |
sw $8,-4($4)
|
|
Packit |
5c3484 |
EPILOGUE(mpn_lshift)
|