1dnl MIPS64 mpn_rshift -- Right 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_rshift) 41 ld $10,0($5) C load first limb 42 dsubu $13,$0,$7 43 daddiu $6,$6,-1 44 and $9,$6,4-1 C number of limbs in first loop 45 beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop 46 dsll $2,$10,$13 C compute function result 47 48 dsubu $6,$6,$9 49 50.Loop0: ld $3,8($5) 51 daddiu $4,$4,8 52 daddiu $5,$5,8 53 daddiu $9,$9,-1 54 dsrl $11,$10,$7 55 dsll $12,$3,$13 56 move $10,$3 57 or $8,$11,$12 58 bne $9,$0,.Loop0 59 sd $8,-8($4) 60 61.L0: beq $6,$0,.Lend 62 nop 63 64.Loop: ld $3,8($5) 65 daddiu $4,$4,32 66 daddiu $6,$6,-4 67 dsrl $11,$10,$7 68 dsll $12,$3,$13 69 70 ld $10,16($5) 71 dsrl $14,$3,$7 72 or $8,$11,$12 73 sd $8,-32($4) 74 dsll $9,$10,$13 75 76 ld $3,24($5) 77 dsrl $11,$10,$7 78 or $8,$14,$9 79 sd $8,-24($4) 80 dsll $12,$3,$13 81 82 ld $10,32($5) 83 dsrl $14,$3,$7 84 or $8,$11,$12 85 sd $8,-16($4) 86 dsll $9,$10,$13 87 88 daddiu $5,$5,32 89 or $8,$14,$9 90 bgtz $6,.Loop 91 sd $8,-8($4) 92 93.Lend: dsrl $8,$10,$7 94 j $31 95 sd $8,0($4) 96EPILOGUE(mpn_rshift) 97