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.

435 lines
16 KiB

  1. #if defined(ED25519_GCC_64BIT_32BIT_CHOOSE)
  2. #define HAVE_GE25519_SCALARMULT_BASE_CHOOSE_NIELS
  3. DONNA_NOINLINE static void
  4. ge25519_scalarmult_base_choose_niels(ge25519_niels *t, const uint8_t table[256][96], uint32_t pos, signed char b) {
  5. int64_t breg = (int64_t)b;
  6. uint64_t sign = (uint64_t)breg >> 63;
  7. uint64_t mask = ~(sign - 1);
  8. uint64_t u = (breg + mask) ^ mask;
  9. __asm__ __volatile__ (
  10. /* ysubx+xaddy+t2d */
  11. "movq %0, %%rax ;\n"
  12. "movd %%rax, %%xmm14 ;\n"
  13. "pshufd $0x00, %%xmm14, %%xmm14 ;\n"
  14. "pxor %%xmm0, %%xmm0 ;\n"
  15. "pxor %%xmm1, %%xmm1 ;\n"
  16. "pxor %%xmm2, %%xmm2 ;\n"
  17. "pxor %%xmm3, %%xmm3 ;\n"
  18. "pxor %%xmm4, %%xmm4 ;\n"
  19. "pxor %%xmm5, %%xmm5 ;\n"
  20. /* 0 */
  21. "movq $0, %%rax ;\n"
  22. "movd %%rax, %%xmm15 ;\n"
  23. "pshufd $0x00, %%xmm15, %%xmm15 ;\n"
  24. "pcmpeqd %%xmm14, %%xmm15 ;\n"
  25. "movq $1, %%rax ;\n"
  26. "movd %%rax, %%xmm6 ;\n"
  27. "pxor %%xmm7, %%xmm7 ;\n"
  28. "pand %%xmm15, %%xmm6 ;\n"
  29. "pand %%xmm15, %%xmm7 ;\n"
  30. "por %%xmm6, %%xmm0 ;\n"
  31. "por %%xmm7, %%xmm1 ;\n"
  32. "por %%xmm6, %%xmm2 ;\n"
  33. "por %%xmm7, %%xmm3 ;\n"
  34. /* 1 */
  35. "movq $1, %%rax ;\n"
  36. "movd %%rax, %%xmm15 ;\n"
  37. "pshufd $0x00, %%xmm15, %%xmm15 ;\n"
  38. "pcmpeqd %%xmm14, %%xmm15 ;\n"
  39. "movdqa 0(%1), %%xmm6 ;\n"
  40. "movdqa 16(%1), %%xmm7 ;\n"
  41. "movdqa 32(%1), %%xmm8 ;\n"
  42. "movdqa 48(%1), %%xmm9 ;\n"
  43. "movdqa 64(%1), %%xmm10 ;\n"
  44. "movdqa 80(%1), %%xmm11 ;\n"
  45. "pand %%xmm15, %%xmm6 ;\n"
  46. "pand %%xmm15, %%xmm7 ;\n"
  47. "pand %%xmm15, %%xmm8 ;\n"
  48. "pand %%xmm15, %%xmm9 ;\n"
  49. "pand %%xmm15, %%xmm10 ;\n"
  50. "pand %%xmm15, %%xmm11 ;\n"
  51. "por %%xmm6, %%xmm0 ;\n"
  52. "por %%xmm7, %%xmm1 ;\n"
  53. "por %%xmm8, %%xmm2 ;\n"
  54. "por %%xmm9, %%xmm3 ;\n"
  55. "por %%xmm10, %%xmm4 ;\n"
  56. "por %%xmm11, %%xmm5 ;\n"
  57. /* 2 */
  58. "movq $2, %%rax ;\n"
  59. "movd %%rax, %%xmm15 ;\n"
  60. "pshufd $0x00, %%xmm15, %%xmm15 ;\n"
  61. "pcmpeqd %%xmm14, %%xmm15 ;\n"
  62. "movdqa 96(%1), %%xmm6 ;\n"
  63. "movdqa 112(%1), %%xmm7 ;\n"
  64. "movdqa 128(%1), %%xmm8 ;\n"
  65. "movdqa 144(%1), %%xmm9 ;\n"
  66. "movdqa 160(%1), %%xmm10 ;\n"
  67. "movdqa 176(%1), %%xmm11 ;\n"
  68. "pand %%xmm15, %%xmm6 ;\n"
  69. "pand %%xmm15, %%xmm7 ;\n"
  70. "pand %%xmm15, %%xmm8 ;\n"
  71. "pand %%xmm15, %%xmm9 ;\n"
  72. "pand %%xmm15, %%xmm10 ;\n"
  73. "pand %%xmm15, %%xmm11 ;\n"
  74. "por %%xmm6, %%xmm0 ;\n"
  75. "por %%xmm7, %%xmm1 ;\n"
  76. "por %%xmm8, %%xmm2 ;\n"
  77. "por %%xmm9, %%xmm3 ;\n"
  78. "por %%xmm10, %%xmm4 ;\n"
  79. "por %%xmm11, %%xmm5 ;\n"
  80. /* 3 */
  81. "movq $3, %%rax ;\n"
  82. "movd %%rax, %%xmm15 ;\n"
  83. "pshufd $0x00, %%xmm15, %%xmm15 ;\n"
  84. "pcmpeqd %%xmm14, %%xmm15 ;\n"
  85. "movdqa 192(%1), %%xmm6 ;\n"
  86. "movdqa 208(%1), %%xmm7 ;\n"
  87. "movdqa 224(%1), %%xmm8 ;\n"
  88. "movdqa 240(%1), %%xmm9 ;\n"
  89. "movdqa 256(%1), %%xmm10 ;\n"
  90. "movdqa 272(%1), %%xmm11 ;\n"
  91. "pand %%xmm15, %%xmm6 ;\n"
  92. "pand %%xmm15, %%xmm7 ;\n"
  93. "pand %%xmm15, %%xmm8 ;\n"
  94. "pand %%xmm15, %%xmm9 ;\n"
  95. "pand %%xmm15, %%xmm10 ;\n"
  96. "pand %%xmm15, %%xmm11 ;\n"
  97. "por %%xmm6, %%xmm0 ;\n"
  98. "por %%xmm7, %%xmm1 ;\n"
  99. "por %%xmm8, %%xmm2 ;\n"
  100. "por %%xmm9, %%xmm3 ;\n"
  101. "por %%xmm10, %%xmm4 ;\n"
  102. "por %%xmm11, %%xmm5 ;\n"
  103. /* 4 */
  104. "movq $4, %%rax ;\n"
  105. "movd %%rax, %%xmm15 ;\n"
  106. "pshufd $0x00, %%xmm15, %%xmm15 ;\n"
  107. "pcmpeqd %%xmm14, %%xmm15 ;\n"
  108. "movdqa 288(%1), %%xmm6 ;\n"
  109. "movdqa 304(%1), %%xmm7 ;\n"
  110. "movdqa 320(%1), %%xmm8 ;\n"
  111. "movdqa 336(%1), %%xmm9 ;\n"
  112. "movdqa 352(%1), %%xmm10 ;\n"
  113. "movdqa 368(%1), %%xmm11 ;\n"
  114. "pand %%xmm15, %%xmm6 ;\n"
  115. "pand %%xmm15, %%xmm7 ;\n"
  116. "pand %%xmm15, %%xmm8 ;\n"
  117. "pand %%xmm15, %%xmm9 ;\n"
  118. "pand %%xmm15, %%xmm10 ;\n"
  119. "pand %%xmm15, %%xmm11 ;\n"
  120. "por %%xmm6, %%xmm0 ;\n"
  121. "por %%xmm7, %%xmm1 ;\n"
  122. "por %%xmm8, %%xmm2 ;\n"
  123. "por %%xmm9, %%xmm3 ;\n"
  124. "por %%xmm10, %%xmm4 ;\n"
  125. "por %%xmm11, %%xmm5 ;\n"
  126. /* 5 */
  127. "movq $5, %%rax ;\n"
  128. "movd %%rax, %%xmm15 ;\n"
  129. "pshufd $0x00, %%xmm15, %%xmm15 ;\n"
  130. "pcmpeqd %%xmm14, %%xmm15 ;\n"
  131. "movdqa 384(%1), %%xmm6 ;\n"
  132. "movdqa 400(%1), %%xmm7 ;\n"
  133. "movdqa 416(%1), %%xmm8 ;\n"
  134. "movdqa 432(%1), %%xmm9 ;\n"
  135. "movdqa 448(%1), %%xmm10 ;\n"
  136. "movdqa 464(%1), %%xmm11 ;\n"
  137. "pand %%xmm15, %%xmm6 ;\n"
  138. "pand %%xmm15, %%xmm7 ;\n"
  139. "pand %%xmm15, %%xmm8 ;\n"
  140. "pand %%xmm15, %%xmm9 ;\n"
  141. "pand %%xmm15, %%xmm10 ;\n"
  142. "pand %%xmm15, %%xmm11 ;\n"
  143. "por %%xmm6, %%xmm0 ;\n"
  144. "por %%xmm7, %%xmm1 ;\n"
  145. "por %%xmm8, %%xmm2 ;\n"
  146. "por %%xmm9, %%xmm3 ;\n"
  147. "por %%xmm10, %%xmm4 ;\n"
  148. "por %%xmm11, %%xmm5 ;\n"
  149. /* 6 */
  150. "movq $6, %%rax ;\n"
  151. "movd %%rax, %%xmm15 ;\n"
  152. "pshufd $0x00, %%xmm15, %%xmm15 ;\n"
  153. "pcmpeqd %%xmm14, %%xmm15 ;\n"
  154. "movdqa 480(%1), %%xmm6 ;\n"
  155. "movdqa 496(%1), %%xmm7 ;\n"
  156. "movdqa 512(%1), %%xmm8 ;\n"
  157. "movdqa 528(%1), %%xmm9 ;\n"
  158. "movdqa 544(%1), %%xmm10 ;\n"
  159. "movdqa 560(%1), %%xmm11 ;\n"
  160. "pand %%xmm15, %%xmm6 ;\n"
  161. "pand %%xmm15, %%xmm7 ;\n"
  162. "pand %%xmm15, %%xmm8 ;\n"
  163. "pand %%xmm15, %%xmm9 ;\n"
  164. "pand %%xmm15, %%xmm10 ;\n"
  165. "pand %%xmm15, %%xmm11 ;\n"
  166. "por %%xmm6, %%xmm0 ;\n"
  167. "por %%xmm7, %%xmm1 ;\n"
  168. "por %%xmm8, %%xmm2 ;\n"
  169. "por %%xmm9, %%xmm3 ;\n"
  170. "por %%xmm10, %%xmm4 ;\n"
  171. "por %%xmm11, %%xmm5 ;\n"
  172. /* 7 */
  173. "movq $7, %%rax ;\n"
  174. "movd %%rax, %%xmm15 ;\n"
  175. "pshufd $0x00, %%xmm15, %%xmm15 ;\n"
  176. "pcmpeqd %%xmm14, %%xmm15 ;\n"
  177. "movdqa 576(%1), %%xmm6 ;\n"
  178. "movdqa 592(%1), %%xmm7 ;\n"
  179. "movdqa 608(%1), %%xmm8 ;\n"
  180. "movdqa 624(%1), %%xmm9 ;\n"
  181. "movdqa 640(%1), %%xmm10 ;\n"
  182. "movdqa 656(%1), %%xmm11 ;\n"
  183. "pand %%xmm15, %%xmm6 ;\n"
  184. "pand %%xmm15, %%xmm7 ;\n"
  185. "pand %%xmm15, %%xmm8 ;\n"
  186. "pand %%xmm15, %%xmm9 ;\n"
  187. "pand %%xmm15, %%xmm10 ;\n"
  188. "pand %%xmm15, %%xmm11 ;\n"
  189. "por %%xmm6, %%xmm0 ;\n"
  190. "por %%xmm7, %%xmm1 ;\n"
  191. "por %%xmm8, %%xmm2 ;\n"
  192. "por %%xmm9, %%xmm3 ;\n"
  193. "por %%xmm10, %%xmm4 ;\n"
  194. "por %%xmm11, %%xmm5 ;\n"
  195. /* 8 */
  196. "movq $8, %%rax ;\n"
  197. "movd %%rax, %%xmm15 ;\n"
  198. "pshufd $0x00, %%xmm15, %%xmm15 ;\n"
  199. "pcmpeqd %%xmm14, %%xmm15 ;\n"
  200. "movdqa 672(%1), %%xmm6 ;\n"
  201. "movdqa 688(%1), %%xmm7 ;\n"
  202. "movdqa 704(%1), %%xmm8 ;\n"
  203. "movdqa 720(%1), %%xmm9 ;\n"
  204. "movdqa 736(%1), %%xmm10 ;\n"
  205. "movdqa 752(%1), %%xmm11 ;\n"
  206. "pand %%xmm15, %%xmm6 ;\n"
  207. "pand %%xmm15, %%xmm7 ;\n"
  208. "pand %%xmm15, %%xmm8 ;\n"
  209. "pand %%xmm15, %%xmm9 ;\n"
  210. "pand %%xmm15, %%xmm10 ;\n"
  211. "pand %%xmm15, %%xmm11 ;\n"
  212. "por %%xmm6, %%xmm0 ;\n"
  213. "por %%xmm7, %%xmm1 ;\n"
  214. "por %%xmm8, %%xmm2 ;\n"
  215. "por %%xmm9, %%xmm3 ;\n"
  216. "por %%xmm10, %%xmm4 ;\n"
  217. "por %%xmm11, %%xmm5 ;\n"
  218. /* conditionally swap ysubx and xaddy */
  219. "movq %3, %%rax ;\n"
  220. "xorq $1, %%rax ;\n"
  221. "movd %%rax, %%xmm14 ;\n"
  222. "pxor %%xmm15, %%xmm15 ;\n"
  223. "pshufd $0x00, %%xmm14, %%xmm14 ;\n"
  224. "pxor %%xmm0, %%xmm2 ;\n"
  225. "pxor %%xmm1, %%xmm3 ;\n"
  226. "pcmpeqd %%xmm14, %%xmm15 ;\n"
  227. "movdqa %%xmm2, %%xmm6 ;\n"
  228. "movdqa %%xmm3, %%xmm7 ;\n"
  229. "pand %%xmm15, %%xmm6 ;\n"
  230. "pand %%xmm15, %%xmm7 ;\n"
  231. "pxor %%xmm6, %%xmm0 ;\n"
  232. "pxor %%xmm7, %%xmm1 ;\n"
  233. "pxor %%xmm0, %%xmm2 ;\n"
  234. "pxor %%xmm1, %%xmm3 ;\n"
  235. /* store ysubx */
  236. "xorq %%rax, %%rax ;\n"
  237. "movd %%xmm0, %%rcx ;\n"
  238. "movd %%xmm0, %%r8 ;\n"
  239. "movd %%xmm1, %%rsi ;\n"
  240. "pshufd $0xee, %%xmm0, %%xmm0 ;\n"
  241. "pshufd $0xee, %%xmm1, %%xmm1 ;\n"
  242. "movd %%xmm0, %%rdx ;\n"
  243. "movd %%xmm1, %%rdi ;\n"
  244. "shrdq $51, %%rdx, %%r8 ;\n"
  245. "shrdq $38, %%rsi, %%rdx ;\n"
  246. "shrdq $25, %%rdi, %%rsi ;\n"
  247. "shrq $12, %%rdi ;\n"
  248. "movq %%rcx, %%r9 ;\n"
  249. "movq %%r8, %%r10 ;\n"
  250. "movq %%rdx, %%r11 ;\n"
  251. "movq %%rsi, %%r12 ;\n"
  252. "movq %%rdi, %%r13 ;\n"
  253. "shrq $26, %%r9 ;\n"
  254. "shrq $26, %%r10 ;\n"
  255. "shrq $26, %%r11 ;\n"
  256. "shrq $26, %%r12 ;\n"
  257. "shrq $26, %%r13 ;\n"
  258. "andl $0x3ffffff, %%ecx ;\n"
  259. "andl $0x1ffffff, %%r9d ;\n"
  260. "andl $0x3ffffff, %%r8d ;\n"
  261. "andl $0x1ffffff, %%r10d ;\n"
  262. "andl $0x3ffffff, %%edx ;\n"
  263. "andl $0x1ffffff, %%r11d ;\n"
  264. "andl $0x3ffffff, %%esi ;\n"
  265. "andl $0x1ffffff, %%r12d ;\n"
  266. "andl $0x3ffffff, %%edi ;\n"
  267. "andl $0x1ffffff, %%r13d ;\n"
  268. "movl %%ecx, 0(%2) ;\n"
  269. "movl %%r9d, 4(%2) ;\n"
  270. "movl %%r8d, 8(%2) ;\n"
  271. "movl %%r10d, 12(%2) ;\n"
  272. "movl %%edx, 16(%2) ;\n"
  273. "movl %%r11d, 20(%2) ;\n"
  274. "movl %%esi, 24(%2) ;\n"
  275. "movl %%r12d, 28(%2) ;\n"
  276. "movl %%edi, 32(%2) ;\n"
  277. "movl %%r13d, 36(%2) ;\n"
  278. /* store xaddy */
  279. "movd %%xmm2, %%rcx ;\n"
  280. "movd %%xmm2, %%r8 ;\n"
  281. "movd %%xmm3, %%rsi ;\n"
  282. "pshufd $0xee, %%xmm2, %%xmm2 ;\n"
  283. "pshufd $0xee, %%xmm3, %%xmm3 ;\n"
  284. "movd %%xmm2, %%rdx ;\n"
  285. "movd %%xmm3, %%rdi ;\n"
  286. "shrdq $51, %%rdx, %%r8 ;\n"
  287. "shrdq $38, %%rsi, %%rdx ;\n"
  288. "shrdq $25, %%rdi, %%rsi ;\n"
  289. "shrq $12, %%rdi ;\n"
  290. "movq %%rcx, %%r9 ;\n"
  291. "movq %%r8, %%r10 ;\n"
  292. "movq %%rdx, %%r11 ;\n"
  293. "movq %%rsi, %%r12 ;\n"
  294. "movq %%rdi, %%r13 ;\n"
  295. "shrq $26, %%r9 ;\n"
  296. "shrq $26, %%r10 ;\n"
  297. "shrq $26, %%r11 ;\n"
  298. "shrq $26, %%r12 ;\n"
  299. "shrq $26, %%r13 ;\n"
  300. "andl $0x3ffffff, %%ecx ;\n"
  301. "andl $0x1ffffff, %%r9d ;\n"
  302. "andl $0x3ffffff, %%r8d ;\n"
  303. "andl $0x1ffffff, %%r10d ;\n"
  304. "andl $0x3ffffff, %%edx ;\n"
  305. "andl $0x1ffffff, %%r11d ;\n"
  306. "andl $0x3ffffff, %%esi ;\n"
  307. "andl $0x1ffffff, %%r12d ;\n"
  308. "andl $0x3ffffff, %%edi ;\n"
  309. "andl $0x1ffffff, %%r13d ;\n"
  310. "movl %%ecx, 40(%2) ;\n"
  311. "movl %%r9d, 44(%2) ;\n"
  312. "movl %%r8d, 48(%2) ;\n"
  313. "movl %%r10d, 52(%2) ;\n"
  314. "movl %%edx, 56(%2) ;\n"
  315. "movl %%r11d, 60(%2) ;\n"
  316. "movl %%esi, 64(%2) ;\n"
  317. "movl %%r12d, 68(%2) ;\n"
  318. "movl %%edi, 72(%2) ;\n"
  319. "movl %%r13d, 76(%2) ;\n"
  320. /* extract t2d */
  321. "xorq %%rax, %%rax ;\n"
  322. "movd %%xmm4, %%rcx ;\n"
  323. "movd %%xmm4, %%r8 ;\n"
  324. "movd %%xmm5, %%rsi ;\n"
  325. "pshufd $0xee, %%xmm4, %%xmm4 ;\n"
  326. "pshufd $0xee, %%xmm5, %%xmm5 ;\n"
  327. "movd %%xmm4, %%rdx ;\n"
  328. "movd %%xmm5, %%rdi ;\n"
  329. "shrdq $51, %%rdx, %%r8 ;\n"
  330. "shrdq $38, %%rsi, %%rdx ;\n"
  331. "shrdq $25, %%rdi, %%rsi ;\n"
  332. "shrq $12, %%rdi ;\n"
  333. "movq %%rcx, %%r9 ;\n"
  334. "movq %%r8, %%r10 ;\n"
  335. "movq %%rdx, %%r11 ;\n"
  336. "movq %%rsi, %%r12 ;\n"
  337. "movq %%rdi, %%r13 ;\n"
  338. "shrq $26, %%r9 ;\n"
  339. "shrq $26, %%r10 ;\n"
  340. "shrq $26, %%r11 ;\n"
  341. "shrq $26, %%r12 ;\n"
  342. "shrq $26, %%r13 ;\n"
  343. "andl $0x3ffffff, %%ecx ;\n"
  344. "andl $0x1ffffff, %%r9d ;\n"
  345. "andl $0x3ffffff, %%r8d ;\n"
  346. "andl $0x1ffffff, %%r10d ;\n"
  347. "andl $0x3ffffff, %%edx ;\n"
  348. "andl $0x1ffffff, %%r11d ;\n"
  349. "andl $0x3ffffff, %%esi ;\n"
  350. "andl $0x1ffffff, %%r12d ;\n"
  351. "andl $0x3ffffff, %%edi ;\n"
  352. "andl $0x1ffffff, %%r13d ;\n"
  353. "movd %%ecx, %%xmm0 ;\n"
  354. "movd %%r9d, %%xmm4 ;\n"
  355. "movd %%r8d, %%xmm8 ;\n"
  356. "movd %%r10d, %%xmm3 ;\n"
  357. "movd %%edx, %%xmm1 ;\n"
  358. "movd %%r11d, %%xmm5 ;\n"
  359. "movd %%esi, %%xmm6 ;\n"
  360. "movd %%r12d, %%xmm7 ;\n"
  361. "movd %%edi, %%xmm2 ;\n"
  362. "movd %%r13d, %%xmm9 ;\n"
  363. "punpckldq %%xmm4, %%xmm0 ;\n"
  364. "punpckldq %%xmm3, %%xmm8 ;\n"
  365. "punpckldq %%xmm5, %%xmm1 ;\n"
  366. "punpckldq %%xmm7, %%xmm6 ;\n"
  367. "punpckldq %%xmm9, %%xmm2 ;\n"
  368. "punpcklqdq %%xmm8, %%xmm0 ;\n"
  369. "punpcklqdq %%xmm6, %%xmm1 ;\n"
  370. /* set up 2p in to 3/4 */
  371. "movl $0x7ffffda, %%ecx ;\n"
  372. "movl $0x3fffffe, %%edx ;\n"
  373. "movl $0x7fffffe, %%eax ;\n"
  374. "movd %%ecx, %%xmm3 ;\n"
  375. "movd %%edx, %%xmm5 ;\n"
  376. "movd %%eax, %%xmm4 ;\n"
  377. "punpckldq %%xmm5, %%xmm3 ;\n"
  378. "punpckldq %%xmm5, %%xmm4 ;\n"
  379. "punpcklqdq %%xmm4, %%xmm3 ;\n"
  380. "movdqa %%xmm4, %%xmm5 ;\n"
  381. "punpcklqdq %%xmm4, %%xmm4 ;\n"
  382. /* subtract and conditionally move */
  383. "movl %3, %%ecx ;\n"
  384. "sub $1, %%ecx ;\n"
  385. "movd %%ecx, %%xmm6 ;\n"
  386. "pshufd $0x00, %%xmm6, %%xmm6 ;\n"
  387. "movdqa %%xmm6, %%xmm7 ;\n"
  388. "psubd %%xmm0, %%xmm3 ;\n"
  389. "psubd %%xmm1, %%xmm4 ;\n"
  390. "psubd %%xmm2, %%xmm5 ;\n"
  391. "pand %%xmm6, %%xmm0 ;\n"
  392. "pand %%xmm6, %%xmm1 ;\n"
  393. "pand %%xmm6, %%xmm2 ;\n"
  394. "pandn %%xmm3, %%xmm6 ;\n"
  395. "movdqa %%xmm7, %%xmm3 ;\n"
  396. "pandn %%xmm4, %%xmm7 ;\n"
  397. "pandn %%xmm5, %%xmm3 ;\n"
  398. "por %%xmm6, %%xmm0 ;\n"
  399. "por %%xmm7, %%xmm1 ;\n"
  400. "por %%xmm3, %%xmm2 ;\n"
  401. /* store t2d */
  402. "movdqa %%xmm0, 80(%2) ;\n"
  403. "movdqa %%xmm1, 96(%2) ;\n"
  404. "movd %%xmm2, %%rax ;\n"
  405. "movq %%rax, 112(%2) ;\n"
  406. :
  407. : "m"(u), "r"(&table[pos * 8]), "r"(t), "m"(sign) /* %0 = u, %1 = table, %2 = t, %3 = sign */
  408. :
  409. "%rax", "%rcx", "%rdx", "%rdi", "%rsi", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13",
  410. "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm14", "%xmm14",
  411. "cc", "memory"
  412. );
  413. }
  414. #endif /* defined(ED25519_GCC_64BIT_32BIT_CHOOSE) */