本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

192 lines
2.8KB

  1. // Copyright 2012 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // This code was translated into a form compatible with 6a from the public
  5. // domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html
  6. // +build amd64,!gccgo,!appengine
  7. // func mul(dest, a, b *[5]uint64)
  8. TEXT ·mul(SB),0,$128-24
  9. MOVQ dest+0(FP), DI
  10. MOVQ a+8(FP), SI
  11. MOVQ b+16(FP), DX
  12. MOVQ SP,R11
  13. MOVQ $31,CX
  14. NOTQ CX
  15. ANDQ CX,SP
  16. ADDQ $32,SP
  17. MOVQ R11,0(SP)
  18. MOVQ R12,8(SP)
  19. MOVQ R13,16(SP)
  20. MOVQ R14,24(SP)
  21. MOVQ R15,32(SP)
  22. MOVQ BX,40(SP)
  23. MOVQ BP,48(SP)
  24. MOVQ DI,56(SP)
  25. MOVQ DX,CX
  26. MOVQ 24(SI),DX
  27. IMUL3Q $19,DX,AX
  28. MOVQ AX,64(SP)
  29. MULQ 16(CX)
  30. MOVQ AX,R8
  31. MOVQ DX,R9
  32. MOVQ 32(SI),DX
  33. IMUL3Q $19,DX,AX
  34. MOVQ AX,72(SP)
  35. MULQ 8(CX)
  36. ADDQ AX,R8
  37. ADCQ DX,R9
  38. MOVQ 0(SI),AX
  39. MULQ 0(CX)
  40. ADDQ AX,R8
  41. ADCQ DX,R9
  42. MOVQ 0(SI),AX
  43. MULQ 8(CX)
  44. MOVQ AX,R10
  45. MOVQ DX,R11
  46. MOVQ 0(SI),AX
  47. MULQ 16(CX)
  48. MOVQ AX,R12
  49. MOVQ DX,R13
  50. MOVQ 0(SI),AX
  51. MULQ 24(CX)
  52. MOVQ AX,R14
  53. MOVQ DX,R15
  54. MOVQ 0(SI),AX
  55. MULQ 32(CX)
  56. MOVQ AX,BX
  57. MOVQ DX,BP
  58. MOVQ 8(SI),AX
  59. MULQ 0(CX)
  60. ADDQ AX,R10
  61. ADCQ DX,R11
  62. MOVQ 8(SI),AX
  63. MULQ 8(CX)
  64. ADDQ AX,R12
  65. ADCQ DX,R13
  66. MOVQ 8(SI),AX
  67. MULQ 16(CX)
  68. ADDQ AX,R14
  69. ADCQ DX,R15
  70. MOVQ 8(SI),AX
  71. MULQ 24(CX)
  72. ADDQ AX,BX
  73. ADCQ DX,BP
  74. MOVQ 8(SI),DX
  75. IMUL3Q $19,DX,AX
  76. MULQ 32(CX)
  77. ADDQ AX,R8
  78. ADCQ DX,R9
  79. MOVQ 16(SI),AX
  80. MULQ 0(CX)
  81. ADDQ AX,R12
  82. ADCQ DX,R13
  83. MOVQ 16(SI),AX
  84. MULQ 8(CX)
  85. ADDQ AX,R14
  86. ADCQ DX,R15
  87. MOVQ 16(SI),AX
  88. MULQ 16(CX)
  89. ADDQ AX,BX
  90. ADCQ DX,BP
  91. MOVQ 16(SI),DX
  92. IMUL3Q $19,DX,AX
  93. MULQ 24(CX)
  94. ADDQ AX,R8
  95. ADCQ DX,R9
  96. MOVQ 16(SI),DX
  97. IMUL3Q $19,DX,AX
  98. MULQ 32(CX)
  99. ADDQ AX,R10
  100. ADCQ DX,R11
  101. MOVQ 24(SI),AX
  102. MULQ 0(CX)
  103. ADDQ AX,R14
  104. ADCQ DX,R15
  105. MOVQ 24(SI),AX
  106. MULQ 8(CX)
  107. ADDQ AX,BX
  108. ADCQ DX,BP
  109. MOVQ 64(SP),AX
  110. MULQ 24(CX)
  111. ADDQ AX,R10
  112. ADCQ DX,R11
  113. MOVQ 64(SP),AX
  114. MULQ 32(CX)
  115. ADDQ AX,R12
  116. ADCQ DX,R13
  117. MOVQ 32(SI),AX
  118. MULQ 0(CX)
  119. ADDQ AX,BX
  120. ADCQ DX,BP
  121. MOVQ 72(SP),AX
  122. MULQ 16(CX)
  123. ADDQ AX,R10
  124. ADCQ DX,R11
  125. MOVQ 72(SP),AX
  126. MULQ 24(CX)
  127. ADDQ AX,R12
  128. ADCQ DX,R13
  129. MOVQ 72(SP),AX
  130. MULQ 32(CX)
  131. ADDQ AX,R14
  132. ADCQ DX,R15
  133. MOVQ ·REDMASK51(SB),SI
  134. SHLQ $13,R9:R8
  135. ANDQ SI,R8
  136. SHLQ $13,R11:R10
  137. ANDQ SI,R10
  138. ADDQ R9,R10
  139. SHLQ $13,R13:R12
  140. ANDQ SI,R12
  141. ADDQ R11,R12
  142. SHLQ $13,R15:R14
  143. ANDQ SI,R14
  144. ADDQ R13,R14
  145. SHLQ $13,BP:BX
  146. ANDQ SI,BX
  147. ADDQ R15,BX
  148. IMUL3Q $19,BP,DX
  149. ADDQ DX,R8
  150. MOVQ R8,DX
  151. SHRQ $51,DX
  152. ADDQ R10,DX
  153. MOVQ DX,CX
  154. SHRQ $51,DX
  155. ANDQ SI,R8
  156. ADDQ R12,DX
  157. MOVQ DX,R9
  158. SHRQ $51,DX
  159. ANDQ SI,CX
  160. ADDQ R14,DX
  161. MOVQ DX,AX
  162. SHRQ $51,DX
  163. ANDQ SI,R9
  164. ADDQ BX,DX
  165. MOVQ DX,R10
  166. SHRQ $51,DX
  167. ANDQ SI,AX
  168. IMUL3Q $19,DX,DX
  169. ADDQ DX,R8
  170. ANDQ SI,R10
  171. MOVQ R8,0(DI)
  172. MOVQ CX,8(DI)
  173. MOVQ R9,16(DI)
  174. MOVQ AX,24(DI)
  175. MOVQ R10,32(DI)
  176. MOVQ 0(SP),R11
  177. MOVQ 8(SP),R12
  178. MOVQ 16(SP),R13
  179. MOVQ 24(SP),R14
  180. MOVQ 32(SP),R15
  181. MOVQ 40(SP),BX
  182. MOVQ 48(SP),BP
  183. MOVQ R11,SP
  184. MOVQ DI,AX
  185. MOVQ SI,DX
  186. RET
上海开阖软件有限公司 沪ICP备12045867号-1