|
Packit Service |
82fcde |
/* MIPS2 __mpn_lshift --
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
Copyright (C) 1995-2018 Free Software Foundation, Inc.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
This file is part of the GNU MP Library.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU MP Library is free software; you can redistribute it and/or modify
|
|
Packit Service |
82fcde |
it under the terms of the GNU Lesser General Public License as published by
|
|
Packit Service |
82fcde |
the Free Software Foundation; either version 2.1 of the License, or (at your
|
|
Packit Service |
82fcde |
option) any later version.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU MP Library is distributed in the hope that it will be useful, but
|
|
Packit Service |
82fcde |
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
Packit Service |
82fcde |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License for more details.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
You should have received a copy of the GNU Lesser General Public License
|
|
Packit Service |
82fcde |
along with the GNU MP Library. If not, see
|
|
Packit Service |
82fcde |
<http://www.gnu.org/licenses/>. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include <sysdep.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* INPUT PARAMETERS
|
|
Packit Service |
82fcde |
res_ptr $4
|
|
Packit Service |
82fcde |
src_ptr $5
|
|
Packit Service |
82fcde |
size $6
|
|
Packit Service |
82fcde |
cnt $7
|
|
Packit Service |
82fcde |
*/
|
|
Packit Service |
82fcde |
#ifdef __PIC__
|
|
Packit Service |
82fcde |
.option pic2
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
ENTRY (__mpn_lshift)
|
|
Packit Service |
82fcde |
.set noreorder
|
|
Packit Service |
82fcde |
#ifdef __PIC__
|
|
Packit Service |
82fcde |
.cpload t9
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
.set nomacro
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
sll $2,$6,2
|
|
Packit Service |
82fcde |
addu $5,$5,$2 /* make r5 point at end of src */
|
|
Packit Service |
82fcde |
lw $10,-4($5) /* load first limb */
|
|
Packit Service |
82fcde |
subu $13,$0,$7
|
|
Packit Service |
82fcde |
addu $4,$4,$2 /* make r4 point at end of res */
|
|
Packit Service |
82fcde |
addiu $6,$6,-1
|
|
Packit Service |
82fcde |
and $9,$6,4-1 /* number of limbs in first loop */
|
|
Packit Service |
82fcde |
beq $9,$0,L(L0) /* if multiple of 4 limbs, skip first loop */
|
|
Packit Service |
82fcde |
srl $2,$10,$13 /* compute function result */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
subu $6,$6,$9
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
L(Loop0): lw $3,-8($5)
|
|
Packit Service |
82fcde |
addiu $4,$4,-4
|
|
Packit Service |
82fcde |
addiu $5,$5,-4
|
|
Packit Service |
82fcde |
addiu $9,$9,-1
|
|
Packit Service |
82fcde |
sll $11,$10,$7
|
|
Packit Service |
82fcde |
srl $12,$3,$13
|
|
Packit Service |
82fcde |
move $10,$3
|
|
Packit Service |
82fcde |
or $8,$11,$12
|
|
Packit Service |
82fcde |
bne $9,$0,L(Loop0)
|
|
Packit Service |
82fcde |
sw $8,0($4)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
L(L0): beq $6,$0,L(Lend)
|
|
Packit Service |
82fcde |
nop
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
L(Loop): lw $3,-8($5)
|
|
Packit Service |
82fcde |
addiu $4,$4,-16
|
|
Packit Service |
82fcde |
addiu $6,$6,-4
|
|
Packit Service |
82fcde |
sll $11,$10,$7
|
|
Packit Service |
82fcde |
srl $12,$3,$13
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
lw $10,-12($5)
|
|
Packit Service |
82fcde |
sll $14,$3,$7
|
|
Packit Service |
82fcde |
or $8,$11,$12
|
|
Packit Service |
82fcde |
sw $8,12($4)
|
|
Packit Service |
82fcde |
srl $9,$10,$13
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
lw $3,-16($5)
|
|
Packit Service |
82fcde |
sll $11,$10,$7
|
|
Packit Service |
82fcde |
or $8,$14,$9
|
|
Packit Service |
82fcde |
sw $8,8($4)
|
|
Packit Service |
82fcde |
srl $12,$3,$13
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
lw $10,-20($5)
|
|
Packit Service |
82fcde |
sll $14,$3,$7
|
|
Packit Service |
82fcde |
or $8,$11,$12
|
|
Packit Service |
82fcde |
sw $8,4($4)
|
|
Packit Service |
82fcde |
srl $9,$10,$13
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
addiu $5,$5,-16
|
|
Packit Service |
82fcde |
or $8,$14,$9
|
|
Packit Service |
82fcde |
bgtz $6,L(Loop)
|
|
Packit Service |
82fcde |
sw $8,0($4)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
L(Lend): sll $8,$10,$7
|
|
Packit Service |
82fcde |
j $31
|
|
Packit Service |
82fcde |
sw $8,-4($4)
|
|
Packit Service |
82fcde |
END (__mpn_lshift)
|