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

数学计算

开发平台:

Unix_Linux

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