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

数学计算

开发平台:

Unix_Linux

  1. dnl  MIPS32 mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
  2. dnl  store difference in a third limb vector.
  3. dnl  Copyright 1995, 2000, 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_sub_n)
  23. lw $10,0($5)
  24. lw $11,0($6)
  25. addiu $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. subu $7,$7,$9
  30. .Loop0: addiu $9,$9,-1
  31. lw $12,4($5)
  32. addu $11,$11,$2
  33. lw $13,4($6)
  34. sltu $8,$11,$2
  35. subu $11,$10,$11
  36. sltu $2,$10,$11
  37. sw $11,0($4)
  38. or $2,$2,$8
  39. addiu $5,$5,4
  40. addiu $6,$6,4
  41. move $10,$12
  42. move $11,$13
  43. bne $9,$0,.Loop0
  44.  addiu $4,$4,4
  45. .L0: beq $7,$0,.Lend
  46.  nop
  47. .Loop: addiu $7,$7,-4
  48. lw $12,4($5)
  49. addu $11,$11,$2
  50. lw $13,4($6)
  51. sltu $8,$11,$2
  52. subu $11,$10,$11
  53. sltu $2,$10,$11
  54. sw $11,0($4)
  55. or $2,$2,$8
  56. lw $10,8($5)
  57. addu $13,$13,$2
  58. lw $11,8($6)
  59. sltu $8,$13,$2
  60. subu $13,$12,$13
  61. sltu $2,$12,$13
  62. sw $13,4($4)
  63. or $2,$2,$8
  64. lw $12,12($5)
  65. addu $11,$11,$2
  66. lw $13,12($6)
  67. sltu $8,$11,$2
  68. subu $11,$10,$11
  69. sltu $2,$10,$11
  70. sw $11,8($4)
  71. or $2,$2,$8
  72. lw $10,16($5)
  73. addu $13,$13,$2
  74. lw $11,16($6)
  75. sltu $8,$13,$2
  76. subu $13,$12,$13
  77. sltu $2,$12,$13
  78. sw $13,12($4)
  79. or $2,$2,$8
  80. addiu $5,$5,16
  81. addiu $6,$6,16
  82. bne $7,$0,.Loop
  83.  addiu $4,$4,16
  84. .Lend: addu $11,$11,$2
  85. sltu $8,$11,$2
  86. subu $11,$10,$11
  87. sltu $2,$10,$11
  88. sw $11,0($4)
  89. j $31
  90. or $2,$2,$8
  91. EPILOGUE(mpn_sub_n)