rshift.asm
上传用户:qaz666999
上传日期:2022-08-06
资源大小:2570k
文件大小:2k
源码类别:

数学计算

开发平台:

Unix_Linux

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