1
0

fe25519_square.S 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. # qhasm: int64 rp
  2. # qhasm: int64 xp
  3. # qhasm: input rp
  4. # qhasm: input xp
  5. # qhasm: int64 r0
  6. # qhasm: int64 r1
  7. # qhasm: int64 r2
  8. # qhasm: int64 r3
  9. # qhasm: int64 caller1
  10. # qhasm: int64 caller2
  11. # qhasm: int64 caller3
  12. # qhasm: int64 caller4
  13. # qhasm: int64 caller5
  14. # qhasm: int64 caller6
  15. # qhasm: int64 caller7
  16. # qhasm: caller caller1
  17. # qhasm: caller caller2
  18. # qhasm: caller caller3
  19. # qhasm: caller caller4
  20. # qhasm: caller caller5
  21. # qhasm: caller caller6
  22. # qhasm: caller caller7
  23. # qhasm: stack64 caller1_stack
  24. # qhasm: stack64 caller2_stack
  25. # qhasm: stack64 caller3_stack
  26. # qhasm: stack64 caller4_stack
  27. # qhasm: stack64 caller5_stack
  28. # qhasm: stack64 caller6_stack
  29. # qhasm: stack64 caller7_stack
  30. # qhasm: int64 squarer4
  31. # qhasm: int64 squarer5
  32. # qhasm: int64 squarer6
  33. # qhasm: int64 squarer7
  34. # qhasm: int64 squarer8
  35. # qhasm: int64 squarerax
  36. # qhasm: int64 squarerdx
  37. # qhasm: int64 squaret1
  38. # qhasm: int64 squaret2
  39. # qhasm: int64 squaret3
  40. # qhasm: int64 squarec
  41. # qhasm: int64 squarezero
  42. # qhasm: int64 squarei38
  43. # qhasm: enter CRYPTO_NAMESPACE(fe25519_square)
  44. .text
  45. .p2align 5
  46. .globl _CRYPTO_NAMESPACE(fe25519_square)
  47. .globl CRYPTO_NAMESPACE(fe25519_square)
  48. _CRYPTO_NAMESPACE(fe25519_square):
  49. CRYPTO_NAMESPACE(fe25519_square):
  50. mov %rsp,%r11
  51. and $31,%r11
  52. add $64,%r11
  53. sub %r11,%rsp
  54. # qhasm: caller1_stack = caller1
  55. # asm 1: movq <caller1=int64#9,>caller1_stack=stack64#1
  56. # asm 2: movq <caller1=%r11,>caller1_stack=0(%rsp)
  57. movq %r11,0(%rsp)
  58. # qhasm: caller2_stack = caller2
  59. # asm 1: movq <caller2=int64#10,>caller2_stack=stack64#2
  60. # asm 2: movq <caller2=%r12,>caller2_stack=8(%rsp)
  61. movq %r12,8(%rsp)
  62. # qhasm: caller3_stack = caller3
  63. # asm 1: movq <caller3=int64#11,>caller3_stack=stack64#3
  64. # asm 2: movq <caller3=%r13,>caller3_stack=16(%rsp)
  65. movq %r13,16(%rsp)
  66. # qhasm: caller4_stack = caller4
  67. # asm 1: movq <caller4=int64#12,>caller4_stack=stack64#4
  68. # asm 2: movq <caller4=%r14,>caller4_stack=24(%rsp)
  69. movq %r14,24(%rsp)
  70. # qhasm: caller5_stack = caller5
  71. # asm 1: movq <caller5=int64#13,>caller5_stack=stack64#5
  72. # asm 2: movq <caller5=%r15,>caller5_stack=32(%rsp)
  73. movq %r15,32(%rsp)
  74. # qhasm: caller6_stack = caller6
  75. # asm 1: movq <caller6=int64#14,>caller6_stack=stack64#6
  76. # asm 2: movq <caller6=%rbx,>caller6_stack=40(%rsp)
  77. movq %rbx,40(%rsp)
  78. # qhasm: caller7_stack = caller7
  79. # asm 1: movq <caller7=int64#15,>caller7_stack=stack64#7
  80. # asm 2: movq <caller7=%rbp,>caller7_stack=48(%rsp)
  81. movq %rbp,48(%rsp)
  82. # qhasm: squarer7 = 0
  83. # asm 1: mov $0,>squarer7=int64#4
  84. # asm 2: mov $0,>squarer7=%rcx
  85. mov $0,%rcx
  86. # qhasm: squarerax = *(uint64 *)(xp + 8)
  87. # asm 1: movq 8(<xp=int64#2),>squarerax=int64#7
  88. # asm 2: movq 8(<xp=%rsi),>squarerax=%rax
  89. movq 8(%rsi),%rax
  90. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 0)
  91. # asm 1: mulq 0(<xp=int64#2)
  92. # asm 2: mulq 0(<xp=%rsi)
  93. mulq 0(%rsi)
  94. # qhasm: r1 = squarerax
  95. # asm 1: mov <squarerax=int64#7,>r1=int64#5
  96. # asm 2: mov <squarerax=%rax,>r1=%r8
  97. mov %rax,%r8
  98. # qhasm: r2 = squarerdx
  99. # asm 1: mov <squarerdx=int64#3,>r2=int64#6
  100. # asm 2: mov <squarerdx=%rdx,>r2=%r9
  101. mov %rdx,%r9
  102. # qhasm: squarerax = *(uint64 *)(xp + 16)
  103. # asm 1: movq 16(<xp=int64#2),>squarerax=int64#7
  104. # asm 2: movq 16(<xp=%rsi),>squarerax=%rax
  105. movq 16(%rsi),%rax
  106. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 8)
  107. # asm 1: mulq 8(<xp=int64#2)
  108. # asm 2: mulq 8(<xp=%rsi)
  109. mulq 8(%rsi)
  110. # qhasm: r3 = squarerax
  111. # asm 1: mov <squarerax=int64#7,>r3=int64#8
  112. # asm 2: mov <squarerax=%rax,>r3=%r10
  113. mov %rax,%r10
  114. # qhasm: squarer4 = squarerdx
  115. # asm 1: mov <squarerdx=int64#3,>squarer4=int64#9
  116. # asm 2: mov <squarerdx=%rdx,>squarer4=%r11
  117. mov %rdx,%r11
  118. # qhasm: squarerax = *(uint64 *)(xp + 24)
  119. # asm 1: movq 24(<xp=int64#2),>squarerax=int64#7
  120. # asm 2: movq 24(<xp=%rsi),>squarerax=%rax
  121. movq 24(%rsi),%rax
  122. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 16)
  123. # asm 1: mulq 16(<xp=int64#2)
  124. # asm 2: mulq 16(<xp=%rsi)
  125. mulq 16(%rsi)
  126. # qhasm: squarer5 = squarerax
  127. # asm 1: mov <squarerax=int64#7,>squarer5=int64#10
  128. # asm 2: mov <squarerax=%rax,>squarer5=%r12
  129. mov %rax,%r12
  130. # qhasm: squarer6 = squarerdx
  131. # asm 1: mov <squarerdx=int64#3,>squarer6=int64#11
  132. # asm 2: mov <squarerdx=%rdx,>squarer6=%r13
  133. mov %rdx,%r13
  134. # qhasm: squarerax = *(uint64 *)(xp + 16)
  135. # asm 1: movq 16(<xp=int64#2),>squarerax=int64#7
  136. # asm 2: movq 16(<xp=%rsi),>squarerax=%rax
  137. movq 16(%rsi),%rax
  138. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 0)
  139. # asm 1: mulq 0(<xp=int64#2)
  140. # asm 2: mulq 0(<xp=%rsi)
  141. mulq 0(%rsi)
  142. # qhasm: carry? r2 += squarerax
  143. # asm 1: add <squarerax=int64#7,<r2=int64#6
  144. # asm 2: add <squarerax=%rax,<r2=%r9
  145. add %rax,%r9
  146. # qhasm: carry? r3 += squarerdx + carry
  147. # asm 1: adc <squarerdx=int64#3,<r3=int64#8
  148. # asm 2: adc <squarerdx=%rdx,<r3=%r10
  149. adc %rdx,%r10
  150. # qhasm: squarer4 += 0 + carry
  151. # asm 1: adc $0,<squarer4=int64#9
  152. # asm 2: adc $0,<squarer4=%r11
  153. adc $0,%r11
  154. # qhasm: squarerax = *(uint64 *)(xp + 24)
  155. # asm 1: movq 24(<xp=int64#2),>squarerax=int64#7
  156. # asm 2: movq 24(<xp=%rsi),>squarerax=%rax
  157. movq 24(%rsi),%rax
  158. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 8)
  159. # asm 1: mulq 8(<xp=int64#2)
  160. # asm 2: mulq 8(<xp=%rsi)
  161. mulq 8(%rsi)
  162. # qhasm: carry? squarer4 += squarerax
  163. # asm 1: add <squarerax=int64#7,<squarer4=int64#9
  164. # asm 2: add <squarerax=%rax,<squarer4=%r11
  165. add %rax,%r11
  166. # qhasm: carry? squarer5 += squarerdx + carry
  167. # asm 1: adc <squarerdx=int64#3,<squarer5=int64#10
  168. # asm 2: adc <squarerdx=%rdx,<squarer5=%r12
  169. adc %rdx,%r12
  170. # qhasm: squarer6 += 0 + carry
  171. # asm 1: adc $0,<squarer6=int64#11
  172. # asm 2: adc $0,<squarer6=%r13
  173. adc $0,%r13
  174. # qhasm: squarerax = *(uint64 *)(xp + 24)
  175. # asm 1: movq 24(<xp=int64#2),>squarerax=int64#7
  176. # asm 2: movq 24(<xp=%rsi),>squarerax=%rax
  177. movq 24(%rsi),%rax
  178. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 0)
  179. # asm 1: mulq 0(<xp=int64#2)
  180. # asm 2: mulq 0(<xp=%rsi)
  181. mulq 0(%rsi)
  182. # qhasm: carry? r3 += squarerax
  183. # asm 1: add <squarerax=int64#7,<r3=int64#8
  184. # asm 2: add <squarerax=%rax,<r3=%r10
  185. add %rax,%r10
  186. # qhasm: carry? squarer4 += squarerdx + carry
  187. # asm 1: adc <squarerdx=int64#3,<squarer4=int64#9
  188. # asm 2: adc <squarerdx=%rdx,<squarer4=%r11
  189. adc %rdx,%r11
  190. # qhasm: carry? squarer5 += 0 + carry
  191. # asm 1: adc $0,<squarer5=int64#10
  192. # asm 2: adc $0,<squarer5=%r12
  193. adc $0,%r12
  194. # qhasm: carry? squarer6 += 0 + carry
  195. # asm 1: adc $0,<squarer6=int64#11
  196. # asm 2: adc $0,<squarer6=%r13
  197. adc $0,%r13
  198. # qhasm: squarer7 += 0 + carry
  199. # asm 1: adc $0,<squarer7=int64#4
  200. # asm 2: adc $0,<squarer7=%rcx
  201. adc $0,%rcx
  202. # qhasm: carry? r1 += r1
  203. # asm 1: add <r1=int64#5,<r1=int64#5
  204. # asm 2: add <r1=%r8,<r1=%r8
  205. add %r8,%r8
  206. # qhasm: carry? r2 += r2 + carry
  207. # asm 1: adc <r2=int64#6,<r2=int64#6
  208. # asm 2: adc <r2=%r9,<r2=%r9
  209. adc %r9,%r9
  210. # qhasm: carry? r3 += r3 + carry
  211. # asm 1: adc <r3=int64#8,<r3=int64#8
  212. # asm 2: adc <r3=%r10,<r3=%r10
  213. adc %r10,%r10
  214. # qhasm: carry? squarer4 += squarer4 + carry
  215. # asm 1: adc <squarer4=int64#9,<squarer4=int64#9
  216. # asm 2: adc <squarer4=%r11,<squarer4=%r11
  217. adc %r11,%r11
  218. # qhasm: carry? squarer5 += squarer5 + carry
  219. # asm 1: adc <squarer5=int64#10,<squarer5=int64#10
  220. # asm 2: adc <squarer5=%r12,<squarer5=%r12
  221. adc %r12,%r12
  222. # qhasm: carry? squarer6 += squarer6 + carry
  223. # asm 1: adc <squarer6=int64#11,<squarer6=int64#11
  224. # asm 2: adc <squarer6=%r13,<squarer6=%r13
  225. adc %r13,%r13
  226. # qhasm: squarer7 += squarer7 + carry
  227. # asm 1: adc <squarer7=int64#4,<squarer7=int64#4
  228. # asm 2: adc <squarer7=%rcx,<squarer7=%rcx
  229. adc %rcx,%rcx
  230. # qhasm: squarerax = *(uint64 *)(xp + 0)
  231. # asm 1: movq 0(<xp=int64#2),>squarerax=int64#7
  232. # asm 2: movq 0(<xp=%rsi),>squarerax=%rax
  233. movq 0(%rsi),%rax
  234. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 0)
  235. # asm 1: mulq 0(<xp=int64#2)
  236. # asm 2: mulq 0(<xp=%rsi)
  237. mulq 0(%rsi)
  238. # qhasm: r0 = squarerax
  239. # asm 1: mov <squarerax=int64#7,>r0=int64#12
  240. # asm 2: mov <squarerax=%rax,>r0=%r14
  241. mov %rax,%r14
  242. # qhasm: squaret1 = squarerdx
  243. # asm 1: mov <squarerdx=int64#3,>squaret1=int64#13
  244. # asm 2: mov <squarerdx=%rdx,>squaret1=%r15
  245. mov %rdx,%r15
  246. # qhasm: squarerax = *(uint64 *)(xp + 8)
  247. # asm 1: movq 8(<xp=int64#2),>squarerax=int64#7
  248. # asm 2: movq 8(<xp=%rsi),>squarerax=%rax
  249. movq 8(%rsi),%rax
  250. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 8)
  251. # asm 1: mulq 8(<xp=int64#2)
  252. # asm 2: mulq 8(<xp=%rsi)
  253. mulq 8(%rsi)
  254. # qhasm: squaret2 = squarerax
  255. # asm 1: mov <squarerax=int64#7,>squaret2=int64#14
  256. # asm 2: mov <squarerax=%rax,>squaret2=%rbx
  257. mov %rax,%rbx
  258. # qhasm: squaret3 = squarerdx
  259. # asm 1: mov <squarerdx=int64#3,>squaret3=int64#15
  260. # asm 2: mov <squarerdx=%rdx,>squaret3=%rbp
  261. mov %rdx,%rbp
  262. # qhasm: squarerax = *(uint64 *)(xp + 16)
  263. # asm 1: movq 16(<xp=int64#2),>squarerax=int64#7
  264. # asm 2: movq 16(<xp=%rsi),>squarerax=%rax
  265. movq 16(%rsi),%rax
  266. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 16)
  267. # asm 1: mulq 16(<xp=int64#2)
  268. # asm 2: mulq 16(<xp=%rsi)
  269. mulq 16(%rsi)
  270. # qhasm: carry? r1 += squaret1
  271. # asm 1: add <squaret1=int64#13,<r1=int64#5
  272. # asm 2: add <squaret1=%r15,<r1=%r8
  273. add %r15,%r8
  274. # qhasm: carry? r2 += squaret2 + carry
  275. # asm 1: adc <squaret2=int64#14,<r2=int64#6
  276. # asm 2: adc <squaret2=%rbx,<r2=%r9
  277. adc %rbx,%r9
  278. # qhasm: carry? r3 += squaret3 + carry
  279. # asm 1: adc <squaret3=int64#15,<r3=int64#8
  280. # asm 2: adc <squaret3=%rbp,<r3=%r10
  281. adc %rbp,%r10
  282. # qhasm: carry? squarer4 += squarerax + carry
  283. # asm 1: adc <squarerax=int64#7,<squarer4=int64#9
  284. # asm 2: adc <squarerax=%rax,<squarer4=%r11
  285. adc %rax,%r11
  286. # qhasm: carry? squarer5 += squarerdx + carry
  287. # asm 1: adc <squarerdx=int64#3,<squarer5=int64#10
  288. # asm 2: adc <squarerdx=%rdx,<squarer5=%r12
  289. adc %rdx,%r12
  290. # qhasm: carry? squarer6 += 0 + carry
  291. # asm 1: adc $0,<squarer6=int64#11
  292. # asm 2: adc $0,<squarer6=%r13
  293. adc $0,%r13
  294. # qhasm: squarer7 += 0 + carry
  295. # asm 1: adc $0,<squarer7=int64#4
  296. # asm 2: adc $0,<squarer7=%rcx
  297. adc $0,%rcx
  298. # qhasm: squarerax = *(uint64 *)(xp + 24)
  299. # asm 1: movq 24(<xp=int64#2),>squarerax=int64#7
  300. # asm 2: movq 24(<xp=%rsi),>squarerax=%rax
  301. movq 24(%rsi),%rax
  302. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 24)
  303. # asm 1: mulq 24(<xp=int64#2)
  304. # asm 2: mulq 24(<xp=%rsi)
  305. mulq 24(%rsi)
  306. # qhasm: carry? squarer6 += squarerax
  307. # asm 1: add <squarerax=int64#7,<squarer6=int64#11
  308. # asm 2: add <squarerax=%rax,<squarer6=%r13
  309. add %rax,%r13
  310. # qhasm: squarer7 += squarerdx + carry
  311. # asm 1: adc <squarerdx=int64#3,<squarer7=int64#4
  312. # asm 2: adc <squarerdx=%rdx,<squarer7=%rcx
  313. adc %rdx,%rcx
  314. # qhasm: squarerax = squarer4
  315. # asm 1: mov <squarer4=int64#9,>squarerax=int64#7
  316. # asm 2: mov <squarer4=%r11,>squarerax=%rax
  317. mov %r11,%rax
  318. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)&CRYPTO_NAMESPACE(38)
  319. mulq CRYPTO_NAMESPACE(38)(%rip)
  320. # qhasm: squarer4 = squarerax
  321. # asm 1: mov <squarerax=int64#7,>squarer4=int64#2
  322. # asm 2: mov <squarerax=%rax,>squarer4=%rsi
  323. mov %rax,%rsi
  324. # qhasm: squarerax = squarer5
  325. # asm 1: mov <squarer5=int64#10,>squarerax=int64#7
  326. # asm 2: mov <squarer5=%r12,>squarerax=%rax
  327. mov %r12,%rax
  328. # qhasm: squarer5 = squarerdx
  329. # asm 1: mov <squarerdx=int64#3,>squarer5=int64#9
  330. # asm 2: mov <squarerdx=%rdx,>squarer5=%r11
  331. mov %rdx,%r11
  332. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)&CRYPTO_NAMESPACE(38)
  333. mulq CRYPTO_NAMESPACE(38)(%rip)
  334. # qhasm: carry? squarer5 += squarerax
  335. # asm 1: add <squarerax=int64#7,<squarer5=int64#9
  336. # asm 2: add <squarerax=%rax,<squarer5=%r11
  337. add %rax,%r11
  338. # qhasm: squarerax = squarer6
  339. # asm 1: mov <squarer6=int64#11,>squarerax=int64#7
  340. # asm 2: mov <squarer6=%r13,>squarerax=%rax
  341. mov %r13,%rax
  342. # qhasm: squarer6 = 0
  343. # asm 1: mov $0,>squarer6=int64#10
  344. # asm 2: mov $0,>squarer6=%r12
  345. mov $0,%r12
  346. # qhasm: squarer6 += squarerdx + carry
  347. # asm 1: adc <squarerdx=int64#3,<squarer6=int64#10
  348. # asm 2: adc <squarerdx=%rdx,<squarer6=%r12
  349. adc %rdx,%r12
  350. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)&CRYPTO_NAMESPACE(38)
  351. mulq CRYPTO_NAMESPACE(38)(%rip)
  352. # qhasm: carry? squarer6 += squarerax
  353. # asm 1: add <squarerax=int64#7,<squarer6=int64#10
  354. # asm 2: add <squarerax=%rax,<squarer6=%r12
  355. add %rax,%r12
  356. # qhasm: squarerax = squarer7
  357. # asm 1: mov <squarer7=int64#4,>squarerax=int64#7
  358. # asm 2: mov <squarer7=%rcx,>squarerax=%rax
  359. mov %rcx,%rax
  360. # qhasm: squarer7 = 0
  361. # asm 1: mov $0,>squarer7=int64#4
  362. # asm 2: mov $0,>squarer7=%rcx
  363. mov $0,%rcx
  364. # qhasm: squarer7 += squarerdx + carry
  365. # asm 1: adc <squarerdx=int64#3,<squarer7=int64#4
  366. # asm 2: adc <squarerdx=%rdx,<squarer7=%rcx
  367. adc %rdx,%rcx
  368. # qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)&CRYPTO_NAMESPACE(38)
  369. mulq CRYPTO_NAMESPACE(38)(%rip)
  370. # qhasm: carry? squarer7 += squarerax
  371. # asm 1: add <squarerax=int64#7,<squarer7=int64#4
  372. # asm 2: add <squarerax=%rax,<squarer7=%rcx
  373. add %rax,%rcx
  374. # qhasm: squarer8 = 0
  375. # asm 1: mov $0,>squarer8=int64#7
  376. # asm 2: mov $0,>squarer8=%rax
  377. mov $0,%rax
  378. # qhasm: squarer8 += squarerdx + carry
  379. # asm 1: adc <squarerdx=int64#3,<squarer8=int64#7
  380. # asm 2: adc <squarerdx=%rdx,<squarer8=%rax
  381. adc %rdx,%rax
  382. # qhasm: carry? r0 += squarer4
  383. # asm 1: add <squarer4=int64#2,<r0=int64#12
  384. # asm 2: add <squarer4=%rsi,<r0=%r14
  385. add %rsi,%r14
  386. # qhasm: carry? r1 += squarer5 + carry
  387. # asm 1: adc <squarer5=int64#9,<r1=int64#5
  388. # asm 2: adc <squarer5=%r11,<r1=%r8
  389. adc %r11,%r8
  390. # qhasm: carry? r2 += squarer6 + carry
  391. # asm 1: adc <squarer6=int64#10,<r2=int64#6
  392. # asm 2: adc <squarer6=%r12,<r2=%r9
  393. adc %r12,%r9
  394. # qhasm: carry? r3 += squarer7 + carry
  395. # asm 1: adc <squarer7=int64#4,<r3=int64#8
  396. # asm 2: adc <squarer7=%rcx,<r3=%r10
  397. adc %rcx,%r10
  398. # qhasm: squarezero = 0
  399. # asm 1: mov $0,>squarezero=int64#2
  400. # asm 2: mov $0,>squarezero=%rsi
  401. mov $0,%rsi
  402. # qhasm: squarer8 += squarezero + carry
  403. # asm 1: adc <squarezero=int64#2,<squarer8=int64#7
  404. # asm 2: adc <squarezero=%rsi,<squarer8=%rax
  405. adc %rsi,%rax
  406. # qhasm: squarer8 *= 38
  407. # asm 1: imulq $38,<squarer8=int64#7,>squarer8=int64#3
  408. # asm 2: imulq $38,<squarer8=%rax,>squarer8=%rdx
  409. imulq $38,%rax,%rdx
  410. # qhasm: carry? r0 += squarer8
  411. # asm 1: add <squarer8=int64#3,<r0=int64#12
  412. # asm 2: add <squarer8=%rdx,<r0=%r14
  413. add %rdx,%r14
  414. # qhasm: carry? r1 += squarezero + carry
  415. # asm 1: adc <squarezero=int64#2,<r1=int64#5
  416. # asm 2: adc <squarezero=%rsi,<r1=%r8
  417. adc %rsi,%r8
  418. # qhasm: carry? r2 += squarezero + carry
  419. # asm 1: adc <squarezero=int64#2,<r2=int64#6
  420. # asm 2: adc <squarezero=%rsi,<r2=%r9
  421. adc %rsi,%r9
  422. # qhasm: carry? r3 += squarezero + carry
  423. # asm 1: adc <squarezero=int64#2,<r3=int64#8
  424. # asm 2: adc <squarezero=%rsi,<r3=%r10
  425. adc %rsi,%r10
  426. # qhasm: squarezero += squarezero + carry
  427. # asm 1: adc <squarezero=int64#2,<squarezero=int64#2
  428. # asm 2: adc <squarezero=%rsi,<squarezero=%rsi
  429. adc %rsi,%rsi
  430. # qhasm: squarezero *= 38
  431. # asm 1: imulq $38,<squarezero=int64#2,>squarezero=int64#2
  432. # asm 2: imulq $38,<squarezero=%rsi,>squarezero=%rsi
  433. imulq $38,%rsi,%rsi
  434. # qhasm: r0 += squarezero
  435. # asm 1: add <squarezero=int64#2,<r0=int64#12
  436. # asm 2: add <squarezero=%rsi,<r0=%r14
  437. add %rsi,%r14
  438. # qhasm: *(uint64 *)(rp + 8) = r1
  439. # asm 1: movq <r1=int64#5,8(<rp=int64#1)
  440. # asm 2: movq <r1=%r8,8(<rp=%rdi)
  441. movq %r8,8(%rdi)
  442. # qhasm: *(uint64 *)(rp + 16) = r2
  443. # asm 1: movq <r2=int64#6,16(<rp=int64#1)
  444. # asm 2: movq <r2=%r9,16(<rp=%rdi)
  445. movq %r9,16(%rdi)
  446. # qhasm: *(uint64 *)(rp + 24) = r3
  447. # asm 1: movq <r3=int64#8,24(<rp=int64#1)
  448. # asm 2: movq <r3=%r10,24(<rp=%rdi)
  449. movq %r10,24(%rdi)
  450. # qhasm: *(uint64 *)(rp + 0) = r0
  451. # asm 1: movq <r0=int64#12,0(<rp=int64#1)
  452. # asm 2: movq <r0=%r14,0(<rp=%rdi)
  453. movq %r14,0(%rdi)
  454. # qhasm: caller1 = caller1_stack
  455. # asm 1: movq <caller1_stack=stack64#1,>caller1=int64#9
  456. # asm 2: movq <caller1_stack=0(%rsp),>caller1=%r11
  457. movq 0(%rsp),%r11
  458. # qhasm: caller2 = caller2_stack
  459. # asm 1: movq <caller2_stack=stack64#2,>caller2=int64#10
  460. # asm 2: movq <caller2_stack=8(%rsp),>caller2=%r12
  461. movq 8(%rsp),%r12
  462. # qhasm: caller3 = caller3_stack
  463. # asm 1: movq <caller3_stack=stack64#3,>caller3=int64#11
  464. # asm 2: movq <caller3_stack=16(%rsp),>caller3=%r13
  465. movq 16(%rsp),%r13
  466. # qhasm: caller4 = caller4_stack
  467. # asm 1: movq <caller4_stack=stack64#4,>caller4=int64#12
  468. # asm 2: movq <caller4_stack=24(%rsp),>caller4=%r14
  469. movq 24(%rsp),%r14
  470. # qhasm: caller5 = caller5_stack
  471. # asm 1: movq <caller5_stack=stack64#5,>caller5=int64#13
  472. # asm 2: movq <caller5_stack=32(%rsp),>caller5=%r15
  473. movq 32(%rsp),%r15
  474. # qhasm: caller6 = caller6_stack
  475. # asm 1: movq <caller6_stack=stack64#6,>caller6=int64#14
  476. # asm 2: movq <caller6_stack=40(%rsp),>caller6=%rbx
  477. movq 40(%rsp),%rbx
  478. # qhasm: caller7 = caller7_stack
  479. # asm 1: movq <caller7_stack=stack64#7,>caller7=int64#15
  480. # asm 2: movq <caller7_stack=48(%rsp),>caller7=%rbp
  481. movq 48(%rsp),%rbp
  482. # qhasm: leave
  483. add %r11,%rsp
  484. mov %rdi,%rax
  485. mov %rsi,%rdx
  486. ret