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

数学计算

开发平台:

Unix_Linux

  1. dnl  MIPS64 mpn_lshift -- Left 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_lshift)
  22. dsll $2,$6,3
  23. daddu $5,$5,$2 C make r5 point at end of src
  24. ld $10,-8($5) C load first limb
  25. dsubu $13,$0,$7
  26. daddu $4,$4,$2 C make r4 point at end of res
  27. daddiu $6,$6,-1
  28. and $9,$6,4-1 C number of limbs in first loop
  29. beq $9,$0,.L0 C if multiple of 4 limbs, skip first loop
  30.  dsrl $2,$10,$13 C compute function result
  31. dsubu $6,$6,$9
  32. .Loop0: ld $3,-16($5)
  33. daddiu $4,$4,-8
  34. daddiu $5,$5,-8
  35. daddiu $9,$9,-1
  36. dsll $11,$10,$7
  37. dsrl $12,$3,$13
  38. move $10,$3
  39. or $8,$11,$12
  40. bne $9,$0,.Loop0
  41.  sd $8,0($4)
  42. .L0: beq $6,$0,.Lend
  43.  nop
  44. .Loop: ld $3,-16($5)
  45. daddiu $4,$4,-32
  46. daddiu $6,$6,-4
  47. dsll $11,$10,$7
  48. dsrl $12,$3,$13
  49. ld $10,-24($5)
  50. dsll $14,$3,$7
  51. or $8,$11,$12
  52. sd $8,24($4)
  53. dsrl $9,$10,$13
  54. ld $3,-32($5)
  55. dsll $11,$10,$7
  56. or $8,$14,$9
  57. sd $8,16($4)
  58. dsrl $12,$3,$13
  59. ld $10,-40($5)
  60. dsll $14,$3,$7
  61. or $8,$11,$12
  62. sd $8,8($4)
  63. dsrl $9,$10,$13
  64. daddiu $5,$5,-32
  65. or $8,$14,$9
  66. bgtz $6,.Loop
  67.  sd $8,0($4)
  68. .Lend: dsll $8,$10,$7
  69. j $31
  70. sd $8,-8($4)
  71. EPILOGUE(mpn_lshift)