1dnl MIPS64 mpn_lshift -- Left shift. 2 3dnl Copyright 1995, 2000-2002 Free Software Foundation, Inc. 4 5dnl This file is part of the GNU MP Library. 6dnl 7dnl The GNU MP Library is free software; you can redistribute it and/or modify 8dnl it under the terms of either: 9dnl 10dnl * the GNU Lesser General Public License as published by the Free 11dnl Software Foundation; either version 3 of the License, or (at your 12dnl option) any later version. 13dnl 14dnl or 15dnl 16dnl * the GNU General Public License as published by the Free Software 17dnl Foundation; either version 2 of the License, or (at your option) any 18dnl later version. 19dnl 20dnl or both in parallel, as here. 21dnl 22dnl The GNU MP Library is distributed in the hope that it will be useful, but 23dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 24dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 25dnl for more details. 26dnl 27dnl You should have received copies of the GNU General Public License and the 28dnl GNU Lesser General Public License along with the GNU MP Library. If not, 29dnl see https://www.gnu.org/licenses/. 30 31include(`../config.m4') 32 33C INPUT PARAMETERS 34C res_ptr $4 35C src_ptr $5 36C size $6 37C cnt $7 38 39ASM_START() 40PROLOGUE(mpn_lshift) 41 dsll $2,$6,3 42 daddu $5,$5,$2 C make r5 point at end of src 43 ld $10,-8($5) C load first limb 44 dsubu $13,$0,$7 45 daddu $4,$4,$2 C make r4 point at end of res 46 daddiu $6,$6,-1 47 and $9,$6,4-1 C number of limbs in first loop 48 beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop 49 dsrl $2,$10,$13 C compute function result 50 51 dsubu $6,$6,$9 52 53.Loop0: ld $3,-16($5) 54 daddiu $4,$4,-8 55 daddiu $5,$5,-8 56 daddiu $9,$9,-1 57 dsll $11,$10,$7 58 dsrl $12,$3,$13 59 move $10,$3 60 or $8,$11,$12 61 bne $9,$0,.Loop0 62 sd $8,0($4) 63 64.L0: beq $6,$0,.Lend 65 nop 66 67.Loop: ld $3,-16($5) 68 daddiu $4,$4,-32 69 daddiu $6,$6,-4 70 dsll $11,$10,$7 71 dsrl $12,$3,$13 72 73 ld $10,-24($5) 74 dsll $14,$3,$7 75 or $8,$11,$12 76 sd $8,24($4) 77 dsrl $9,$10,$13 78 79 ld $3,-32($5) 80 dsll $11,$10,$7 81 or $8,$14,$9 82 sd $8,16($4) 83 dsrl $12,$3,$13 84 85 ld $10,-40($5) 86 dsll $14,$3,$7 87 or $8,$11,$12 88 sd $8,8($4) 89 dsrl $9,$10,$13 90 91 daddiu $5,$5,-32 92 or $8,$14,$9 93 bgtz $6,.Loop 94 sd $8,0($4) 95 96.Lend: dsll $8,$10,$7 97 j $31 98 sd $8,-8($4) 99EPILOGUE(mpn_lshift) 100