github.com/aergoio/aergo@v1.3.1/libtool/src/gmp-6.1.2/mpn/mips64/rshift.asm (about) 1 dnl MIPS64 mpn_rshift -- Right shift. 2 3 dnl Copyright 1995, 2000-2002 Free Software Foundation, Inc. 4 5 dnl This file is part of the GNU MP Library. 6 dnl 7 dnl The GNU MP Library is free software; you can redistribute it and/or modify 8 dnl it under the terms of either: 9 dnl 10 dnl * the GNU Lesser General Public License as published by the Free 11 dnl Software Foundation; either version 3 of the License, or (at your 12 dnl option) any later version. 13 dnl 14 dnl or 15 dnl 16 dnl * the GNU General Public License as published by the Free Software 17 dnl Foundation; either version 2 of the License, or (at your option) any 18 dnl later version. 19 dnl 20 dnl or both in parallel, as here. 21 dnl 22 dnl The GNU MP Library is distributed in the hope that it will be useful, but 23 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 24 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 25 dnl for more details. 26 dnl 27 dnl You should have received copies of the GNU General Public License and the 28 dnl GNU Lesser General Public License along with the GNU MP Library. If not, 29 dnl see https://www.gnu.org/licenses/. 30 31 include(`../config.m4') 32 33 C INPUT PARAMETERS 34 C res_ptr $4 35 C src_ptr $5 36 C size $6 37 C cnt $7 38 39 ASM_START() 40 PROLOGUE(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) 96 EPILOGUE(mpn_rshift)