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