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

dgemv_n_atom.S 16 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. /*********************************************************************/
  2. /* Copyright 2009, 2010 The University of Texas at Austin. */
  3. /* All rights reserved. */
  4. /* */
  5. /* Redistribution and use in source and binary forms, with or */
  6. /* without modification, are permitted provided that the following */
  7. /* conditions are met: */
  8. /* */
  9. /* 1. Redistributions of source code must retain the above */
  10. /* copyright notice, this list of conditions and the following */
  11. /* disclaimer. */
  12. /* */
  13. /* 2. Redistributions in binary form must reproduce the above */
  14. /* copyright notice, this list of conditions and the following */
  15. /* disclaimer in the documentation and/or other materials */
  16. /* provided with the distribution. */
  17. /* */
  18. /* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
  19. /* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */
  20. /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
  21. /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
  22. /* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */
  23. /* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
  24. /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
  25. /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
  26. /* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
  27. /* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
  28. /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
  29. /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
  30. /* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
  31. /* POSSIBILITY OF SUCH DAMAGE. */
  32. /* */
  33. /* The views and conclusions contained in the software and */
  34. /* documentation are those of the authors and should not be */
  35. /* interpreted as representing official policies, either expressed */
  36. /* or implied, of The University of Texas at Austin. */
  37. /*********************************************************************/
  38. #define ASSEMBLER
  39. #include "common.h"
  40. #include "l2param.h"
  41. #define PREFETCH prefetchnta
  42. #define PREFETCHW prefetcht0
  43. #define PREFETCH_SIZE (8 * 6)
  44. #ifndef WINDOWS_ABI
  45. #define STACKSIZE 64
  46. #define OLD_INCX 8 + STACKSIZE(%rsp)
  47. #define OLD_Y 16 + STACKSIZE(%rsp)
  48. #define OLD_INCY 24 + STACKSIZE(%rsp)
  49. #define OLD_BUFFER 32 + STACKSIZE(%rsp)
  50. #define STACK_ALPHA 48 (%rsp)
  51. #define M %rdi
  52. #define N %rsi
  53. #define A %rcx
  54. #define LDA %r8
  55. #define X %r9
  56. #define INCX %rdx
  57. #define Y %rbp
  58. #define INCY %r10
  59. #else
  60. #define STACKSIZE 256
  61. #define OLD_A 40 + STACKSIZE(%rsp)
  62. #define OLD_LDA 48 + STACKSIZE(%rsp)
  63. #define OLD_X 56 + STACKSIZE(%rsp)
  64. #define OLD_INCX 64 + STACKSIZE(%rsp)
  65. #define OLD_Y 72 + STACKSIZE(%rsp)
  66. #define OLD_INCY 80 + STACKSIZE(%rsp)
  67. #define OLD_BUFFER 88 + STACKSIZE(%rsp)
  68. #define STACK_ALPHA 224 (%rsp)
  69. #define M %rcx
  70. #define N %rdx
  71. #define A %r8
  72. #define LDA %r9
  73. #define X %rdi
  74. #define INCX %rsi
  75. #define Y %rbp
  76. #define INCY %r10
  77. #endif
  78. #define I %rax
  79. #define J %r11
  80. #define A1 %r12
  81. #define A2 %r13
  82. #define Y1 %r14
  83. #define BUFFER %r15
  84. #define MM %rbx
  85. #define ALPHA %xmm15
  86. PROLOGUE
  87. PROFCODE
  88. subq $STACKSIZE, %rsp
  89. movq %rbx, 0(%rsp)
  90. movq %rbp, 8(%rsp)
  91. movq %r12, 16(%rsp)
  92. movq %r13, 24(%rsp)
  93. movq %r14, 32(%rsp)
  94. movq %r15, 40(%rsp)
  95. #ifdef WINDOWS_ABI
  96. movq %rdi, 48(%rsp)
  97. movq %rsi, 56(%rsp)
  98. movups %xmm6, 64(%rsp)
  99. movups %xmm7, 80(%rsp)
  100. movups %xmm8, 96(%rsp)
  101. movups %xmm9, 112(%rsp)
  102. movups %xmm10, 128(%rsp)
  103. movups %xmm11, 144(%rsp)
  104. movups %xmm12, 160(%rsp)
  105. movups %xmm13, 176(%rsp)
  106. movups %xmm14, 192(%rsp)
  107. movups %xmm15, 208(%rsp)
  108. movq OLD_A, A
  109. movq OLD_LDA, LDA
  110. movq OLD_X, X
  111. #endif
  112. movq OLD_INCX, INCX
  113. movq OLD_Y, Y
  114. movq OLD_INCY, INCY
  115. movq OLD_BUFFER, BUFFER
  116. #ifndef WINDOWS_ABI
  117. movsd %xmm0, STACK_ALPHA
  118. #else
  119. movsd %xmm3, STACK_ALPHA
  120. #endif
  121. leaq (,INCX, SIZE), INCX
  122. leaq (,INCY, SIZE), INCY
  123. leaq (,LDA, SIZE), LDA
  124. testq N, N
  125. jle .L999
  126. testq M, M
  127. jle .L999
  128. cmpq $SIZE, INCY
  129. cmoveq Y, BUFFER
  130. je .L10
  131. movq BUFFER, Y1
  132. xorps %xmm4, %xmm4
  133. movq M, %rax
  134. addq $7, %rax
  135. sarq $3, %rax
  136. ALIGN_3
  137. .L01:
  138. movsd %xmm4, 0 * SIZE(Y1)
  139. movsd %xmm4, 1 * SIZE(Y1)
  140. movsd %xmm4, 2 * SIZE(Y1)
  141. movsd %xmm4, 3 * SIZE(Y1)
  142. movsd %xmm4, 4 * SIZE(Y1)
  143. movsd %xmm4, 5 * SIZE(Y1)
  144. movsd %xmm4, 6 * SIZE(Y1)
  145. movsd %xmm4, 7 * SIZE(Y1)
  146. addq $8 * SIZE, Y1
  147. decq %rax
  148. jg .L01
  149. ALIGN_3
  150. .L10:
  151. movq N, J
  152. sarq $1, J
  153. jle .L20
  154. ALIGN_3
  155. .L11:
  156. movq BUFFER, Y1
  157. movq A, A1
  158. leaq (A, LDA, 1), A2
  159. leaq (A, LDA, 2), A
  160. movsd STACK_ALPHA, %xmm0
  161. movsd (X), %xmm14
  162. addq INCX, X
  163. movsd (X), %xmm15
  164. addq INCX, X
  165. mulsd %xmm0, %xmm14
  166. mulsd %xmm0, %xmm15
  167. movq M, I
  168. sarq $3, I
  169. jle .L15
  170. movsd 0 * SIZE(A1), %xmm0
  171. movsd 1 * SIZE(A1), %xmm1
  172. movsd 2 * SIZE(A1), %xmm2
  173. movsd 3 * SIZE(A1), %xmm3
  174. movsd 0 * SIZE(A2), %xmm4
  175. movsd 1 * SIZE(A2), %xmm5
  176. movsd 2 * SIZE(A2), %xmm6
  177. movsd 3 * SIZE(A2), %xmm7
  178. movsd 0 * SIZE(Y1), %xmm8
  179. mulsd %xmm14, %xmm0
  180. movsd 1 * SIZE(Y1), %xmm9
  181. mulsd %xmm14, %xmm1
  182. movsd 2 * SIZE(Y1), %xmm10
  183. mulsd %xmm14, %xmm2
  184. movsd 3 * SIZE(Y1), %xmm11
  185. mulsd %xmm14, %xmm3
  186. decq I
  187. jle .L14
  188. ALIGN_3
  189. .L13:
  190. PREFETCH PREFETCH_SIZE * SIZE(A1)
  191. mulsd %xmm15, %xmm4
  192. PREFETCH PREFETCH_SIZE * SIZE(A2)
  193. addsd %xmm0, %xmm8
  194. movsd 4 * SIZE(A1), %xmm0
  195. mulsd %xmm15, %xmm5
  196. addsd %xmm1, %xmm9
  197. movsd 5 * SIZE(A1), %xmm1
  198. mulsd %xmm15, %xmm6
  199. addsd %xmm2, %xmm10
  200. movsd 6 * SIZE(A1), %xmm2
  201. mulsd %xmm15, %xmm7
  202. addsd %xmm3, %xmm11
  203. movsd 7 * SIZE(A1), %xmm3
  204. addsd %xmm4, %xmm8
  205. mulsd %xmm14, %xmm0
  206. movsd 4 * SIZE(A2), %xmm4
  207. addsd %xmm5, %xmm9
  208. mulsd %xmm14, %xmm1
  209. movsd 5 * SIZE(A2), %xmm5
  210. addsd %xmm6, %xmm10
  211. mulsd %xmm14, %xmm2
  212. movsd 6 * SIZE(A2), %xmm6
  213. addsd %xmm7, %xmm11
  214. mulsd %xmm14, %xmm3
  215. movsd 7 * SIZE(A2), %xmm7
  216. movsd %xmm8, 0 * SIZE(Y1)
  217. movsd 4 * SIZE(Y1), %xmm8
  218. movsd %xmm9, 1 * SIZE(Y1)
  219. movsd 5 * SIZE(Y1), %xmm9
  220. movsd %xmm10, 2 * SIZE(Y1)
  221. movsd 6 * SIZE(Y1), %xmm10
  222. movsd %xmm11, 3 * SIZE(Y1)
  223. movsd 7 * SIZE(Y1), %xmm11
  224. mulsd %xmm15, %xmm4
  225. addsd %xmm0, %xmm8
  226. movsd 8 * SIZE(A1), %xmm0
  227. mulsd %xmm15, %xmm5
  228. addsd %xmm1, %xmm9
  229. movsd 9 * SIZE(A1), %xmm1
  230. mulsd %xmm15, %xmm6
  231. addsd %xmm2, %xmm10
  232. movsd 10 * SIZE(A1), %xmm2
  233. mulsd %xmm15, %xmm7
  234. addq $8 * SIZE, A2
  235. addsd %xmm3, %xmm11
  236. movsd 11 * SIZE(A1), %xmm3
  237. mulsd %xmm14, %xmm0
  238. addsd %xmm4, %xmm8
  239. movsd 0 * SIZE(A2), %xmm4
  240. mulsd %xmm14, %xmm1
  241. addq $8 * SIZE, Y1
  242. addsd %xmm5, %xmm9
  243. movsd 1 * SIZE(A2), %xmm5
  244. mulsd %xmm14, %xmm2
  245. addq $8 * SIZE, A1
  246. addsd %xmm6, %xmm10
  247. movsd 2 * SIZE(A2), %xmm6
  248. mulsd %xmm14, %xmm3
  249. decq I
  250. addsd %xmm7, %xmm11
  251. movsd 3 * SIZE(A2), %xmm7
  252. movsd %xmm8, -4 * SIZE(Y1)
  253. movsd 0 * SIZE(Y1), %xmm8
  254. movsd %xmm9, -3 * SIZE(Y1)
  255. movsd 1 * SIZE(Y1), %xmm9
  256. movsd %xmm10,-2 * SIZE(Y1)
  257. movsd 2 * SIZE(Y1), %xmm10
  258. movsd %xmm11,-1 * SIZE(Y1)
  259. movsd 3 * SIZE(Y1), %xmm11
  260. jg .L13
  261. ALIGN_3
  262. .L14:
  263. mulsd %xmm15, %xmm4
  264. addsd %xmm0, %xmm8
  265. movsd 4 * SIZE(A1), %xmm0
  266. mulsd %xmm15, %xmm5
  267. addsd %xmm1, %xmm9
  268. movsd 5 * SIZE(A1), %xmm1
  269. mulsd %xmm15, %xmm6
  270. addsd %xmm2, %xmm10
  271. movsd 6 * SIZE(A1), %xmm2
  272. mulsd %xmm15, %xmm7
  273. addsd %xmm3, %xmm11
  274. movsd 7 * SIZE(A1), %xmm3
  275. addsd %xmm4, %xmm8
  276. mulsd %xmm14, %xmm0
  277. movsd 4 * SIZE(A2), %xmm4
  278. addsd %xmm5, %xmm9
  279. mulsd %xmm14, %xmm1
  280. movsd 5 * SIZE(A2), %xmm5
  281. addsd %xmm6, %xmm10
  282. mulsd %xmm14, %xmm2
  283. movsd 6 * SIZE(A2), %xmm6
  284. addsd %xmm7, %xmm11
  285. mulsd %xmm14, %xmm3
  286. movsd 7 * SIZE(A2), %xmm7
  287. movsd %xmm8, 0 * SIZE(Y1)
  288. movsd 4 * SIZE(Y1), %xmm8
  289. movsd %xmm9, 1 * SIZE(Y1)
  290. movsd 5 * SIZE(Y1), %xmm9
  291. movsd %xmm10, 2 * SIZE(Y1)
  292. movsd 6 * SIZE(Y1), %xmm10
  293. movsd %xmm11, 3 * SIZE(Y1)
  294. movsd 7 * SIZE(Y1), %xmm11
  295. mulsd %xmm15, %xmm4
  296. addsd %xmm0, %xmm8
  297. mulsd %xmm15, %xmm5
  298. addsd %xmm1, %xmm9
  299. mulsd %xmm15, %xmm6
  300. addsd %xmm2, %xmm10
  301. mulsd %xmm15, %xmm7
  302. addq $8 * SIZE, A2
  303. addsd %xmm3, %xmm11
  304. mulsd %xmm14, %xmm0
  305. addsd %xmm4, %xmm8
  306. mulsd %xmm14, %xmm1
  307. addq $8 * SIZE, Y1
  308. addsd %xmm5, %xmm9
  309. mulsd %xmm14, %xmm2
  310. addq $8 * SIZE, A1
  311. addsd %xmm6, %xmm10
  312. mulsd %xmm14, %xmm3
  313. addsd %xmm7, %xmm11
  314. movsd %xmm8, -4 * SIZE(Y1)
  315. movsd %xmm9, -3 * SIZE(Y1)
  316. movsd %xmm10,-2 * SIZE(Y1)
  317. movsd %xmm11,-1 * SIZE(Y1)
  318. ALIGN_3
  319. .L15:
  320. testq $4, M
  321. je .L17
  322. movsd 0 * SIZE(A1), %xmm0
  323. movsd 1 * SIZE(A1), %xmm1
  324. movsd 2 * SIZE(A1), %xmm2
  325. movsd 3 * SIZE(A1), %xmm3
  326. movsd 0 * SIZE(A2), %xmm4
  327. movsd 1 * SIZE(A2), %xmm5
  328. movsd 2 * SIZE(A2), %xmm6
  329. movsd 3 * SIZE(A2), %xmm7
  330. movsd 0 * SIZE(Y1), %xmm8
  331. mulsd %xmm14, %xmm0
  332. movsd 1 * SIZE(Y1), %xmm9
  333. mulsd %xmm14, %xmm1
  334. movsd 2 * SIZE(Y1), %xmm10
  335. mulsd %xmm14, %xmm2
  336. movsd 3 * SIZE(Y1), %xmm11
  337. mulsd %xmm14, %xmm3
  338. mulsd %xmm15, %xmm4
  339. addsd %xmm0, %xmm8
  340. mulsd %xmm15, %xmm5
  341. addsd %xmm1, %xmm9
  342. mulsd %xmm15, %xmm6
  343. addsd %xmm2, %xmm10
  344. mulsd %xmm15, %xmm7
  345. addsd %xmm3, %xmm11
  346. addsd %xmm4, %xmm8
  347. addsd %xmm5, %xmm9
  348. addsd %xmm6, %xmm10
  349. addsd %xmm7, %xmm11
  350. movsd %xmm8, 0 * SIZE(Y1)
  351. movsd %xmm9, 1 * SIZE(Y1)
  352. movsd %xmm10, 2 * SIZE(Y1)
  353. movsd %xmm11, 3 * SIZE(Y1)
  354. addq $4 * SIZE, A1
  355. addq $4 * SIZE, A2
  356. addq $4 * SIZE, Y1
  357. ALIGN_3
  358. .L17:
  359. testq $2, M
  360. je .L18
  361. movsd 0 * SIZE(A1), %xmm0
  362. movsd 1 * SIZE(A1), %xmm1
  363. movsd 0 * SIZE(A2), %xmm4
  364. movsd 1 * SIZE(A2), %xmm5
  365. mulsd %xmm14, %xmm0
  366. movsd 0 * SIZE(Y1), %xmm8
  367. mulsd %xmm14, %xmm1
  368. movsd 1 * SIZE(Y1), %xmm9
  369. mulsd %xmm15, %xmm4
  370. mulsd %xmm15, %xmm5
  371. addsd %xmm0, %xmm8
  372. addsd %xmm1, %xmm9
  373. addsd %xmm4, %xmm8
  374. addsd %xmm5, %xmm9
  375. movsd %xmm8, 0 * SIZE(Y1)
  376. movsd %xmm9, 1 * SIZE(Y1)
  377. addq $2 * SIZE, A1
  378. addq $2 * SIZE, A2
  379. addq $2 * SIZE, Y1
  380. ALIGN_3
  381. .L18:
  382. testq $1, M
  383. je .L19
  384. movsd 0 * SIZE(Y1), %xmm8
  385. movsd 0 * SIZE(A1), %xmm0
  386. movsd 0 * SIZE(A2), %xmm4
  387. mulsd %xmm14, %xmm0
  388. mulsd %xmm15, %xmm4
  389. addsd %xmm0, %xmm8
  390. addsd %xmm4, %xmm8
  391. movsd %xmm8, 0 * SIZE(Y1)
  392. ALIGN_3
  393. .L19:
  394. decq J
  395. jg .L11
  396. ALIGN_3
  397. .L20:
  398. testq $1, N
  399. je .L990
  400. movq BUFFER, Y1
  401. movq A, A1
  402. movsd (X), %xmm14
  403. mulsd STACK_ALPHA, %xmm14
  404. movq M, I
  405. sarq $3, I
  406. jle .L25
  407. movsd 0 * SIZE(A1), %xmm0
  408. movsd 1 * SIZE(A1), %xmm1
  409. movsd 2 * SIZE(A1), %xmm2
  410. movsd 3 * SIZE(A1), %xmm3
  411. movsd 4 * SIZE(A1), %xmm4
  412. movsd 5 * SIZE(A1), %xmm5
  413. movsd 6 * SIZE(A1), %xmm6
  414. movsd 7 * SIZE(A1), %xmm7
  415. movsd 0 * SIZE(Y1), %xmm8
  416. mulsd %xmm14, %xmm0
  417. movsd 1 * SIZE(Y1), %xmm9
  418. mulsd %xmm14, %xmm1
  419. movsd 2 * SIZE(Y1), %xmm10
  420. mulsd %xmm14, %xmm2
  421. movsd 3 * SIZE(Y1), %xmm11
  422. mulsd %xmm14, %xmm3
  423. decq I
  424. jle .L24
  425. ALIGN_3
  426. .L23:
  427. PREFETCH PREFETCH_SIZE * SIZE(A1)
  428. addsd %xmm0, %xmm8
  429. movsd 8 * SIZE(A1), %xmm0
  430. addsd %xmm1, %xmm9
  431. movsd 9 * SIZE(A1), %xmm1
  432. addsd %xmm2, %xmm10
  433. movsd 10 * SIZE(A1), %xmm2
  434. addsd %xmm3, %xmm11
  435. movsd 11 * SIZE(A1), %xmm3
  436. movsd %xmm8, 0 * SIZE(Y1)
  437. movsd 4 * SIZE(Y1), %xmm8
  438. mulsd %xmm14, %xmm4
  439. movsd %xmm9, 1 * SIZE(Y1)
  440. movsd 5 * SIZE(Y1), %xmm9
  441. mulsd %xmm14, %xmm5
  442. movsd %xmm10, 2 * SIZE(Y1)
  443. movsd 6 * SIZE(Y1), %xmm10
  444. mulsd %xmm14, %xmm6
  445. movsd %xmm11, 3 * SIZE(Y1)
  446. movsd 7 * SIZE(Y1), %xmm11
  447. mulsd %xmm14, %xmm7
  448. addsd %xmm4, %xmm8
  449. movsd 12 * SIZE(A1), %xmm4
  450. addsd %xmm5, %xmm9
  451. movsd 13 * SIZE(A1), %xmm5
  452. addsd %xmm6, %xmm10
  453. movsd 14 * SIZE(A1), %xmm6
  454. addsd %xmm7, %xmm11
  455. movsd 15 * SIZE(A1), %xmm7
  456. movsd %xmm8, 4 * SIZE(Y1)
  457. movsd 8 * SIZE(Y1), %xmm8
  458. mulsd %xmm14, %xmm0
  459. movsd %xmm9, 5 * SIZE(Y1)
  460. movsd 9 * SIZE(Y1), %xmm9
  461. mulsd %xmm14, %xmm1
  462. movsd %xmm10, 6 * SIZE(Y1)
  463. movsd 10 * SIZE(Y1), %xmm10
  464. mulsd %xmm14, %xmm2
  465. movsd %xmm11, 7 * SIZE(Y1)
  466. movsd 11 * SIZE(Y1), %xmm11
  467. mulsd %xmm14, %xmm3
  468. addq $8 * SIZE, Y1
  469. addq $8 * SIZE, A1
  470. decq I
  471. jg .L23
  472. ALIGN_3
  473. .L24:
  474. addsd %xmm0, %xmm8
  475. addsd %xmm1, %xmm9
  476. addsd %xmm2, %xmm10
  477. addsd %xmm3, %xmm11
  478. mulsd %xmm14, %xmm4
  479. movsd %xmm8, 0 * SIZE(Y1)
  480. movsd 4 * SIZE(Y1), %xmm8
  481. mulsd %xmm14, %xmm5
  482. movsd %xmm9, 1 * SIZE(Y1)
  483. movsd 5 * SIZE(Y1), %xmm9
  484. mulsd %xmm14, %xmm6
  485. movsd %xmm10, 2 * SIZE(Y1)
  486. movsd 6 * SIZE(Y1), %xmm10
  487. mulsd %xmm14, %xmm7
  488. movsd %xmm11, 3 * SIZE(Y1)
  489. movsd 7 * SIZE(Y1), %xmm11
  490. addsd %xmm4, %xmm8
  491. addsd %xmm5, %xmm9
  492. addsd %xmm6, %xmm10
  493. addsd %xmm7, %xmm11
  494. movsd %xmm8, 4 * SIZE(Y1)
  495. movsd %xmm9, 5 * SIZE(Y1)
  496. movsd %xmm10, 6 * SIZE(Y1)
  497. movsd %xmm11, 7 * SIZE(Y1)
  498. addq $8 * SIZE, Y1
  499. addq $8 * SIZE, A1
  500. ALIGN_3
  501. .L25:
  502. testq $4, M
  503. je .L27
  504. movsd 0 * SIZE(A1), %xmm0
  505. movsd 1 * SIZE(A1), %xmm1
  506. movsd 2 * SIZE(A1), %xmm2
  507. movsd 3 * SIZE(A1), %xmm3
  508. movsd 0 * SIZE(Y1), %xmm8
  509. mulsd %xmm14, %xmm0
  510. movsd 1 * SIZE(Y1), %xmm9
  511. mulsd %xmm14, %xmm1
  512. movsd 2 * SIZE(Y1), %xmm10
  513. mulsd %xmm14, %xmm2
  514. movsd 3 * SIZE(Y1), %xmm11
  515. mulsd %xmm14, %xmm3
  516. addsd %xmm0, %xmm8
  517. addsd %xmm1, %xmm9
  518. addsd %xmm2, %xmm10
  519. addsd %xmm3, %xmm11
  520. movsd %xmm8, 0 * SIZE(Y1)
  521. movsd %xmm9, 1 * SIZE(Y1)
  522. movsd %xmm10, 2 * SIZE(Y1)
  523. movsd %xmm11, 3 * SIZE(Y1)
  524. addq $4 * SIZE, A1
  525. addq $4 * SIZE, A2
  526. addq $4 * SIZE, Y1
  527. ALIGN_3
  528. .L27:
  529. testq $2, M
  530. je .L28
  531. movsd 0 * SIZE(A1), %xmm0
  532. movsd 1 * SIZE(A1), %xmm1
  533. mulsd %xmm14, %xmm0
  534. movsd 0 * SIZE(Y1), %xmm8
  535. mulsd %xmm14, %xmm1
  536. movsd 1 * SIZE(Y1), %xmm9
  537. addsd %xmm0, %xmm8
  538. addsd %xmm1, %xmm9
  539. movsd %xmm8, 0 * SIZE(Y1)
  540. movsd %xmm9, 1 * SIZE(Y1)
  541. addq $2 * SIZE, A1
  542. addq $2 * SIZE, Y1
  543. ALIGN_3
  544. .L28:
  545. testq $1, M
  546. je .L990
  547. movsd 0 * SIZE(Y1), %xmm8
  548. movsd 0 * SIZE(A1), %xmm0
  549. mulsd %xmm14, %xmm0
  550. addsd %xmm0, %xmm8
  551. movsd %xmm8, 0 * SIZE(Y1)
  552. ALIGN_3
  553. .L990:
  554. cmpq $SIZE, INCY
  555. je .L999
  556. movq Y, Y1
  557. movq M, %rax
  558. sarq $2, %rax
  559. jle .L994
  560. ALIGN_3
  561. .L992:
  562. movsd (Y), %xmm0
  563. addq INCY, Y
  564. movsd (Y), %xmm1
  565. addq INCY, Y
  566. movsd (Y), %xmm2
  567. addq INCY, Y
  568. movsd (Y), %xmm3
  569. addq INCY, Y
  570. addsd 0 * SIZE(BUFFER), %xmm0
  571. addsd 1 * SIZE(BUFFER), %xmm1
  572. addsd 2 * SIZE(BUFFER), %xmm2
  573. addsd 3 * SIZE(BUFFER), %xmm3
  574. addq $4 * SIZE, BUFFER
  575. movsd %xmm0, (Y1)
  576. addq INCY, Y1
  577. movsd %xmm1, (Y1)
  578. addq INCY, Y1
  579. movsd %xmm2, (Y1)
  580. addq INCY, Y1
  581. movsd %xmm3, (Y1)
  582. addq INCY, Y1
  583. decq %rax
  584. jg .L992
  585. ALIGN_3
  586. .L994:
  587. testq $2, M
  588. jle .L996
  589. movsd (Y), %xmm0
  590. addq INCY, Y
  591. movsd (Y), %xmm1
  592. addq INCY, Y
  593. addsd 0 * SIZE(BUFFER), %xmm0
  594. addsd 1 * SIZE(BUFFER), %xmm1
  595. addq $2 * SIZE, BUFFER
  596. movsd %xmm0, (Y1)
  597. addq INCY, Y1
  598. movsd %xmm1, (Y1)
  599. addq INCY, Y1
  600. ALIGN_3
  601. .L996:
  602. testq $1, M
  603. jle .L999
  604. movsd (Y), %xmm0
  605. addsd (BUFFER), %xmm0
  606. movsd %xmm0, (Y1)
  607. ALIGN_3
  608. .L999:
  609. movq 0(%rsp), %rbx
  610. movq 8(%rsp), %rbp
  611. movq 16(%rsp), %r12
  612. movq 24(%rsp), %r13
  613. movq 32(%rsp), %r14
  614. movq 40(%rsp), %r15
  615. #ifdef WINDOWS_ABI
  616. movq 48(%rsp), %rdi
  617. movq 56(%rsp), %rsi
  618. movups 64(%rsp), %xmm6
  619. movups 80(%rsp), %xmm7
  620. movups 96(%rsp), %xmm8
  621. movups 112(%rsp), %xmm9
  622. movups 128(%rsp), %xmm10
  623. movups 144(%rsp), %xmm11
  624. movups 160(%rsp), %xmm12
  625. movups 176(%rsp), %xmm13
  626. movups 192(%rsp), %xmm14
  627. movups 208(%rsp), %xmm15
  628. #endif
  629. addq $STACKSIZE, %rsp
  630. ret
  631. EPILOGUE