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