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.

zgemv_t_atom.S 19 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  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. #ifdef ATOM
  42. #define PREFETCH prefetchnta
  43. #define PREFETCHW prefetcht0
  44. #define PREFETCHSIZE (8 * 6)
  45. #endif
  46. #ifndef WINDOWS_ABI
  47. #define STACKSIZE 64
  48. #define OLD_INCX 8 + STACKSIZE(%rsp)
  49. #define OLD_Y 16 + STACKSIZE(%rsp)
  50. #define OLD_INCY 24 + STACKSIZE(%rsp)
  51. #define OLD_BUFFER 32 + STACKSIZE(%rsp)
  52. #define M %rdi
  53. #define N %rsi
  54. #define A %rcx
  55. #define LDA %r8
  56. #define X %r9
  57. #define INCX %rdx
  58. #define Y %rbp
  59. #define INCY %r10
  60. #else
  61. #define STACKSIZE 256
  62. #define OLD_ALPHA_I 40 + STACKSIZE(%rsp)
  63. #define OLD_A 48 + STACKSIZE(%rsp)
  64. #define OLD_LDA 56 + STACKSIZE(%rsp)
  65. #define OLD_X 64 + STACKSIZE(%rsp)
  66. #define OLD_INCX 72 + STACKSIZE(%rsp)
  67. #define OLD_Y 80 + STACKSIZE(%rsp)
  68. #define OLD_INCY 88 + STACKSIZE(%rsp)
  69. #define OLD_BUFFER 96 + STACKSIZE(%rsp)
  70. #define M %rcx
  71. #define N %rdx
  72. #define A %r8
  73. #define LDA %r9
  74. #define X %rdi
  75. #define INCX %rsi
  76. #define Y %rbp
  77. #define INCY %r10
  78. #endif
  79. #define I %rax
  80. #define J %rbx
  81. #define A1 %r11
  82. #define A2 %r12
  83. #define X1 %r13
  84. #define Y1 %r14
  85. #define BUFFER %r15
  86. #define ALPHA_R %xmm14
  87. #define ALPHA_I %xmm15
  88. #if !defined(CONJ) && !defined(XCONJ)
  89. #define ADD1 addsd
  90. #define ADD2 addsd
  91. #define ADD3 subsd
  92. #define ADD4 addsd
  93. #endif
  94. #if defined(CONJ) && !defined(XCONJ)
  95. #define ADD1 addsd
  96. #define ADD2 addsd
  97. #define ADD3 addsd
  98. #define ADD4 subsd
  99. #endif
  100. #if !defined(CONJ) && defined(XCONJ)
  101. #define ADD1 addsd
  102. #define ADD2 subsd
  103. #define ADD3 addsd
  104. #define ADD4 addsd
  105. #endif
  106. #if defined(CONJ) && defined(XCONJ)
  107. #define ADD1 addsd
  108. #define ADD2 subsd
  109. #define ADD3 subsd
  110. #define ADD4 subsd
  111. #endif
  112. PROLOGUE
  113. PROFCODE
  114. subq $STACKSIZE, %rsp
  115. movq %rbx, 0(%rsp)
  116. movq %rbp, 8(%rsp)
  117. movq %r12, 16(%rsp)
  118. movq %r13, 24(%rsp)
  119. movq %r14, 32(%rsp)
  120. movq %r15, 40(%rsp)
  121. #ifdef WINDOWS_ABI
  122. movq %rdi, 48(%rsp)
  123. movq %rsi, 56(%rsp)
  124. movups %xmm6, 64(%rsp)
  125. movups %xmm7, 80(%rsp)
  126. movups %xmm8, 96(%rsp)
  127. movups %xmm9, 112(%rsp)
  128. movups %xmm10, 128(%rsp)
  129. movups %xmm11, 144(%rsp)
  130. movups %xmm12, 160(%rsp)
  131. movups %xmm13, 176(%rsp)
  132. movups %xmm14, 192(%rsp)
  133. movups %xmm15, 208(%rsp)
  134. movq OLD_A, A
  135. movq OLD_LDA, LDA
  136. movq OLD_X, X
  137. movaps %xmm3, %xmm0
  138. movss OLD_ALPHA_I, %xmm1
  139. #endif
  140. movq OLD_INCX, INCX
  141. movq OLD_Y, Y
  142. movq OLD_INCY, INCY
  143. movq OLD_BUFFER, BUFFER
  144. salq $ZBASE_SHIFT, LDA
  145. salq $ZBASE_SHIFT, INCX
  146. salq $ZBASE_SHIFT, INCY
  147. movaps %xmm0, ALPHA_R
  148. movaps %xmm1, ALPHA_I
  149. subq $-16 * SIZE, A
  150. testq M, M
  151. jle .L999
  152. testq N, N
  153. jle .L999
  154. ALIGN_3
  155. movq BUFFER, X1
  156. movq Y, Y1
  157. movq M, I
  158. sarq $2, I
  159. jle .L05
  160. ALIGN_4
  161. .L02:
  162. movsd 0 * SIZE(X), %xmm0
  163. movhpd 1 * SIZE(X), %xmm0
  164. addq INCX, X
  165. movsd 0 * SIZE(X), %xmm1
  166. movhpd 1 * SIZE(X), %xmm1
  167. addq INCX, X
  168. movsd 0 * SIZE(X), %xmm2
  169. movhpd 1 * SIZE(X), %xmm2
  170. addq INCX, X
  171. movsd 0 * SIZE(X), %xmm3
  172. movhpd 1 * SIZE(X), %xmm3
  173. addq INCX, X
  174. movapd %xmm0, 0 * SIZE(X1)
  175. movapd %xmm1, 2 * SIZE(X1)
  176. movapd %xmm2, 4 * SIZE(X1)
  177. movapd %xmm3, 6 * SIZE(X1)
  178. addq $8 * SIZE, X1
  179. decq I
  180. jg .L02
  181. ALIGN_4
  182. .L05:
  183. movq M, I
  184. andq $3, I
  185. jle .L10
  186. ALIGN_2
  187. .L06:
  188. movsd 0 * SIZE(X), %xmm0
  189. movhpd 1 * SIZE(X), %xmm0
  190. addq INCX, X
  191. movapd %xmm0, 0 * SIZE(X1)
  192. addq $2 * SIZE, X1
  193. decq I
  194. jg .L06
  195. ALIGN_4
  196. .L10:
  197. movq N, J
  198. sarq $1, J
  199. jle .L20
  200. ALIGN_3
  201. .L11:
  202. leaq 16 * SIZE(BUFFER), X1
  203. movq A, A1
  204. leaq (A1, LDA), A2
  205. leaq (A1, LDA, 2), A
  206. xorpd %xmm0, %xmm0
  207. xorpd %xmm1, %xmm1
  208. xorpd %xmm2, %xmm2
  209. xorpd %xmm3, %xmm3
  210. movsd -16 * SIZE(X1), %xmm4
  211. movsd -15 * SIZE(X1), %xmm5
  212. movsd -14 * SIZE(X1), %xmm6
  213. movsd -13 * SIZE(X1), %xmm7
  214. #ifdef PREFETCHW
  215. PREFETCHW 3 * SIZE(Y1)
  216. #endif
  217. movq M, I
  218. sarq $2, I
  219. jle .L15
  220. movsd -16 * SIZE(A1), %xmm8
  221. movsd -15 * SIZE(A1), %xmm9
  222. movsd -16 * SIZE(A2), %xmm10
  223. movsd -15 * SIZE(A2), %xmm11
  224. movapd %xmm8, %xmm12
  225. mulsd %xmm4, %xmm8
  226. mulsd %xmm5, %xmm12
  227. decq I
  228. jle .L14
  229. ALIGN_3
  230. .L13:
  231. #ifdef PREFETCH
  232. PREFETCH (PREFETCHSIZE + 0) * SIZE(A1)
  233. #endif
  234. movapd %xmm9, %xmm13
  235. mulsd %xmm5, %xmm9
  236. ADD1 %xmm8, %xmm0
  237. movsd -14 * SIZE(A1), %xmm8
  238. mulsd %xmm4, %xmm13
  239. ADD2 %xmm12, %xmm1
  240. movapd %xmm10, %xmm12
  241. mulsd %xmm4, %xmm10
  242. ADD3 %xmm9, %xmm0
  243. movsd -13 * SIZE(A1), %xmm9
  244. mulsd %xmm5, %xmm12
  245. ADD4 %xmm13, %xmm1
  246. movapd %xmm11, %xmm13
  247. mulsd %xmm5, %xmm11
  248. movsd -11 * SIZE(X1), %xmm5
  249. ADD1 %xmm10, %xmm2
  250. movsd -14 * SIZE(A2), %xmm10
  251. mulsd %xmm4, %xmm13
  252. movsd -12 * SIZE(X1), %xmm4
  253. ADD2 %xmm12, %xmm3
  254. movapd %xmm8, %xmm12
  255. mulsd %xmm6, %xmm8
  256. ADD3 %xmm11, %xmm2
  257. movsd -13 * SIZE(A2), %xmm11
  258. mulsd %xmm7, %xmm12
  259. ADD4 %xmm13, %xmm3
  260. movapd %xmm9, %xmm13
  261. mulsd %xmm7, %xmm9
  262. ADD1 %xmm8, %xmm0
  263. movsd -12 * SIZE(A1), %xmm8
  264. mulsd %xmm6, %xmm13
  265. ADD2 %xmm12, %xmm1
  266. movapd %xmm10, %xmm12
  267. mulsd %xmm6, %xmm10
  268. ADD3 %xmm9, %xmm0
  269. movsd -11 * SIZE(A1), %xmm9
  270. mulsd %xmm7, %xmm12
  271. ADD4 %xmm13, %xmm1
  272. movapd %xmm11, %xmm13
  273. mulsd %xmm7, %xmm11
  274. movsd -9 * SIZE(X1), %xmm7
  275. ADD1 %xmm10, %xmm2
  276. movsd -12 * SIZE(A2), %xmm10
  277. mulsd %xmm6, %xmm13
  278. movsd -10 * SIZE(X1), %xmm6
  279. ADD2 %xmm12, %xmm3
  280. movapd %xmm8, %xmm12
  281. mulsd %xmm4, %xmm8
  282. ADD3 %xmm11, %xmm2
  283. movsd -11 * SIZE(A2), %xmm11
  284. mulsd %xmm5, %xmm12
  285. ADD4 %xmm13, %xmm3
  286. #ifdef PREFETCH
  287. PREFETCH (PREFETCHSIZE + 0) * SIZE(A2)
  288. #endif
  289. movapd %xmm9, %xmm13
  290. mulsd %xmm5, %xmm9
  291. ADD1 %xmm8, %xmm0
  292. movsd -10 * SIZE(A1), %xmm8
  293. mulsd %xmm4, %xmm13
  294. ADD2 %xmm12, %xmm1
  295. movapd %xmm10, %xmm12
  296. mulsd %xmm4, %xmm10
  297. ADD3 %xmm9, %xmm0
  298. movsd -9 * SIZE(A1), %xmm9
  299. mulsd %xmm5, %xmm12
  300. ADD4 %xmm13, %xmm1
  301. movapd %xmm11, %xmm13
  302. mulsd %xmm5, %xmm11
  303. movsd -7 * SIZE(X1), %xmm5
  304. ADD1 %xmm10, %xmm2
  305. movsd -10 * SIZE(A2), %xmm10
  306. mulsd %xmm4, %xmm13
  307. movsd -8 * SIZE(X1), %xmm4
  308. ADD2 %xmm12, %xmm3
  309. movapd %xmm8, %xmm12
  310. mulsd %xmm6, %xmm8
  311. ADD3 %xmm11, %xmm2
  312. movsd -9 * SIZE(A2), %xmm11
  313. mulsd %xmm7, %xmm12
  314. ADD4 %xmm13, %xmm3
  315. movapd %xmm9, %xmm13
  316. mulsd %xmm7, %xmm9
  317. ADD1 %xmm8, %xmm0
  318. movsd -8 * SIZE(A1), %xmm8
  319. mulsd %xmm6, %xmm13
  320. ADD2 %xmm12, %xmm1
  321. movapd %xmm10, %xmm12
  322. mulsd %xmm6, %xmm10
  323. ADD3 %xmm9, %xmm0
  324. movsd -7 * SIZE(A1), %xmm9
  325. mulsd %xmm7, %xmm12
  326. ADD4 %xmm13, %xmm1
  327. movapd %xmm11, %xmm13
  328. mulsd %xmm7, %xmm11
  329. movsd -5 * SIZE(X1), %xmm7
  330. ADD1 %xmm10, %xmm2
  331. movsd -8 * SIZE(A2), %xmm10
  332. mulsd %xmm6, %xmm13
  333. movsd -6 * SIZE(X1), %xmm6
  334. ADD2 %xmm12, %xmm3
  335. movapd %xmm8, %xmm12
  336. subq $-8 * SIZE, A1
  337. mulsd %xmm4, %xmm8
  338. subq $-8 * SIZE, X1
  339. ADD3 %xmm11, %xmm2
  340. movsd -7 * SIZE(A2), %xmm11
  341. mulsd %xmm5, %xmm12
  342. subq $-8 * SIZE, A2
  343. ADD4 %xmm13, %xmm3
  344. subq $1, I
  345. BRANCH
  346. jg .L13
  347. ALIGN_3
  348. .L14:
  349. movapd %xmm9, %xmm13
  350. mulsd %xmm5, %xmm9
  351. ADD1 %xmm8, %xmm0
  352. movsd -14 * SIZE(A1), %xmm8
  353. mulsd %xmm4, %xmm13
  354. ADD2 %xmm12, %xmm1
  355. movapd %xmm10, %xmm12
  356. mulsd %xmm4, %xmm10
  357. ADD3 %xmm9, %xmm0
  358. movsd -13 * SIZE(A1), %xmm9
  359. mulsd %xmm5, %xmm12
  360. ADD4 %xmm13, %xmm1
  361. movapd %xmm11, %xmm13
  362. mulsd %xmm5, %xmm11
  363. movsd -11 * SIZE(X1), %xmm5
  364. ADD1 %xmm10, %xmm2
  365. movsd -14 * SIZE(A2), %xmm10
  366. mulsd %xmm4, %xmm13
  367. movsd -12 * SIZE(X1), %xmm4
  368. ADD2 %xmm12, %xmm3
  369. movapd %xmm8, %xmm12
  370. mulsd %xmm6, %xmm8
  371. ADD3 %xmm11, %xmm2
  372. movsd -13 * SIZE(A2), %xmm11
  373. mulsd %xmm7, %xmm12
  374. ADD4 %xmm13, %xmm3
  375. movapd %xmm9, %xmm13
  376. mulsd %xmm7, %xmm9
  377. ADD1 %xmm8, %xmm0
  378. movsd -12 * SIZE(A1), %xmm8
  379. mulsd %xmm6, %xmm13
  380. ADD2 %xmm12, %xmm1
  381. movapd %xmm10, %xmm12
  382. mulsd %xmm6, %xmm10
  383. ADD3 %xmm9, %xmm0
  384. movsd -11 * SIZE(A1), %xmm9
  385. mulsd %xmm7, %xmm12
  386. ADD4 %xmm13, %xmm1
  387. movapd %xmm11, %xmm13
  388. mulsd %xmm7, %xmm11
  389. movsd -9 * SIZE(X1), %xmm7
  390. ADD1 %xmm10, %xmm2
  391. movsd -12 * SIZE(A2), %xmm10
  392. mulsd %xmm6, %xmm13
  393. movsd -10 * SIZE(X1), %xmm6
  394. ADD2 %xmm12, %xmm3
  395. movapd %xmm8, %xmm12
  396. mulsd %xmm4, %xmm8
  397. ADD3 %xmm11, %xmm2
  398. movsd -11 * SIZE(A2), %xmm11
  399. mulsd %xmm5, %xmm12
  400. ADD4 %xmm13, %xmm3
  401. movapd %xmm9, %xmm13
  402. mulsd %xmm5, %xmm9
  403. ADD1 %xmm8, %xmm0
  404. movsd -10 * SIZE(A1), %xmm8
  405. mulsd %xmm4, %xmm13
  406. ADD2 %xmm12, %xmm1
  407. movapd %xmm10, %xmm12
  408. mulsd %xmm4, %xmm10
  409. ADD3 %xmm9, %xmm0
  410. movsd -9 * SIZE(A1), %xmm9
  411. mulsd %xmm5, %xmm12
  412. ADD4 %xmm13, %xmm1
  413. movapd %xmm11, %xmm13
  414. mulsd %xmm5, %xmm11
  415. movsd -7 * SIZE(X1), %xmm5
  416. ADD1 %xmm10, %xmm2
  417. movsd -10 * SIZE(A2), %xmm10
  418. mulsd %xmm4, %xmm13
  419. movsd -8 * SIZE(X1), %xmm4
  420. ADD2 %xmm12, %xmm3
  421. movapd %xmm8, %xmm12
  422. mulsd %xmm6, %xmm8
  423. ADD3 %xmm11, %xmm2
  424. movsd -9 * SIZE(A2), %xmm11
  425. mulsd %xmm7, %xmm12
  426. ADD4 %xmm13, %xmm3
  427. movapd %xmm9, %xmm13
  428. mulsd %xmm7, %xmm9
  429. ADD1 %xmm8, %xmm0
  430. mulsd %xmm6, %xmm13
  431. ADD2 %xmm12, %xmm1
  432. movapd %xmm10, %xmm12
  433. mulsd %xmm6, %xmm10
  434. ADD3 %xmm9, %xmm0
  435. mulsd %xmm7, %xmm12
  436. ADD4 %xmm13, %xmm1
  437. movapd %xmm11, %xmm13
  438. mulsd %xmm7, %xmm11
  439. movsd -5 * SIZE(X1), %xmm7
  440. ADD1 %xmm10, %xmm2
  441. mulsd %xmm6, %xmm13
  442. movsd -6 * SIZE(X1), %xmm6
  443. ADD2 %xmm12, %xmm3
  444. ADD3 %xmm11, %xmm2
  445. ADD4 %xmm13, %xmm3
  446. subq $-8 * SIZE, A1
  447. subq $-8 * SIZE, A2
  448. subq $-8 * SIZE, X1
  449. ALIGN_3
  450. .L15:
  451. testq $2, M
  452. je .L17
  453. movsd -16 * SIZE(A1), %xmm8
  454. movsd -15 * SIZE(A1), %xmm9
  455. movsd -16 * SIZE(A2), %xmm10
  456. movsd -15 * SIZE(A2), %xmm11
  457. movapd %xmm8, %xmm12
  458. mulsd %xmm4, %xmm8
  459. mulsd %xmm5, %xmm12
  460. movapd %xmm9, %xmm13
  461. mulsd %xmm5, %xmm9
  462. ADD1 %xmm8, %xmm0
  463. movsd -14 * SIZE(A1), %xmm8
  464. mulsd %xmm4, %xmm13
  465. ADD2 %xmm12, %xmm1
  466. movapd %xmm10, %xmm12
  467. mulsd %xmm4, %xmm10
  468. ADD3 %xmm9, %xmm0
  469. movsd -13 * SIZE(A1), %xmm9
  470. mulsd %xmm5, %xmm12
  471. ADD4 %xmm13, %xmm1
  472. movapd %xmm11, %xmm13
  473. mulsd %xmm5, %xmm11
  474. movsd -11 * SIZE(X1), %xmm5
  475. ADD1 %xmm10, %xmm2
  476. movsd -14 * SIZE(A2), %xmm10
  477. mulsd %xmm4, %xmm13
  478. movsd -12 * SIZE(X1), %xmm4
  479. ADD2 %xmm12, %xmm3
  480. movapd %xmm8, %xmm12
  481. mulsd %xmm6, %xmm8
  482. ADD3 %xmm11, %xmm2
  483. movsd -13 * SIZE(A2), %xmm11
  484. mulsd %xmm7, %xmm12
  485. ADD4 %xmm13, %xmm3
  486. movapd %xmm9, %xmm13
  487. mulsd %xmm7, %xmm9
  488. ADD1 %xmm8, %xmm0
  489. mulsd %xmm6, %xmm13
  490. ADD2 %xmm12, %xmm1
  491. movapd %xmm10, %xmm12
  492. mulsd %xmm6, %xmm10
  493. ADD3 %xmm9, %xmm0
  494. mulsd %xmm7, %xmm12
  495. ADD4 %xmm13, %xmm1
  496. movapd %xmm11, %xmm13
  497. mulsd %xmm7, %xmm11
  498. ADD1 %xmm10, %xmm2
  499. mulsd %xmm6, %xmm13
  500. ADD2 %xmm12, %xmm3
  501. ADD3 %xmm11, %xmm2
  502. ADD4 %xmm13, %xmm3
  503. addq $4 * SIZE, A1
  504. addq $4 * SIZE, A2
  505. ALIGN_3
  506. .L17:
  507. testq $1, M
  508. je .L19
  509. movsd -16 * SIZE(A1), %xmm8
  510. movsd -15 * SIZE(A1), %xmm9
  511. movsd -16 * SIZE(A2), %xmm10
  512. movsd -15 * SIZE(A2), %xmm11
  513. movapd %xmm8, %xmm12
  514. mulsd %xmm4, %xmm8
  515. mulsd %xmm5, %xmm12
  516. movapd %xmm9, %xmm13
  517. mulsd %xmm5, %xmm9
  518. ADD1 %xmm8, %xmm0
  519. mulsd %xmm4, %xmm13
  520. ADD2 %xmm12, %xmm1
  521. movapd %xmm10, %xmm12
  522. mulsd %xmm4, %xmm10
  523. ADD3 %xmm9, %xmm0
  524. mulsd %xmm5, %xmm12
  525. ADD4 %xmm13, %xmm1
  526. movapd %xmm11, %xmm13
  527. mulsd %xmm5, %xmm11
  528. ADD1 %xmm10, %xmm2
  529. mulsd %xmm4, %xmm13
  530. ADD2 %xmm12, %xmm3
  531. ADD3 %xmm11, %xmm2
  532. ADD4 %xmm13, %xmm3
  533. ALIGN_3
  534. .L19:
  535. movsd 0 * SIZE(Y), %xmm4
  536. movapd %xmm0, %xmm10
  537. mulsd ALPHA_R, %xmm0
  538. movsd 1 * SIZE(Y), %xmm5
  539. movapd %xmm1, %xmm11
  540. mulsd ALPHA_R, %xmm1
  541. addq INCY, Y
  542. movsd 0 * SIZE(Y), %xmm6
  543. movapd %xmm2, %xmm12
  544. mulsd ALPHA_R, %xmm2
  545. movsd 1 * SIZE(Y), %xmm7
  546. movapd %xmm3, %xmm13
  547. mulsd ALPHA_R, %xmm3
  548. addq INCY, Y
  549. mulsd ALPHA_I, %xmm10
  550. mulsd ALPHA_I, %xmm11
  551. mulsd ALPHA_I, %xmm12
  552. mulsd ALPHA_I, %xmm13
  553. addsd %xmm10, %xmm1
  554. subsd %xmm11, %xmm0
  555. addsd %xmm12, %xmm3
  556. subsd %xmm13, %xmm2
  557. addsd %xmm4, %xmm0
  558. addsd %xmm5, %xmm1
  559. addsd %xmm6, %xmm2
  560. addsd %xmm7, %xmm3
  561. movlpd %xmm0, 0 * SIZE(Y1)
  562. movlpd %xmm1, 1 * SIZE(Y1)
  563. addq INCY, Y1
  564. movlpd %xmm2, 0 * SIZE(Y1)
  565. movlpd %xmm3, 1 * SIZE(Y1)
  566. addq INCY, Y1
  567. decq J
  568. jg .L11
  569. ALIGN_3
  570. .L20:
  571. testq $1, N
  572. jle .L999
  573. leaq 16 * SIZE(BUFFER), X1
  574. movq A, A1
  575. xorpd %xmm0, %xmm0
  576. xorpd %xmm1, %xmm1
  577. movsd -16 * SIZE(X1), %xmm4
  578. movsd -15 * SIZE(X1), %xmm5
  579. movsd -14 * SIZE(X1), %xmm6
  580. movsd -13 * SIZE(X1), %xmm7
  581. movq M, I
  582. sarq $2, I
  583. jle .L25
  584. movsd -16 * SIZE(A1), %xmm8
  585. movsd -15 * SIZE(A1), %xmm9
  586. movapd %xmm8, %xmm12
  587. mulsd %xmm4, %xmm8
  588. mulsd %xmm5, %xmm12
  589. decq I
  590. jle .L24
  591. ALIGN_3
  592. .L23:
  593. #ifdef PREFETCH
  594. PREFETCH (PREFETCHSIZE + 0) * SIZE(A1)
  595. #endif
  596. movapd %xmm9, %xmm13
  597. mulsd %xmm5, %xmm9
  598. movsd -11 * SIZE(X1), %xmm5
  599. ADD1 %xmm8, %xmm0
  600. movsd -14 * SIZE(A1), %xmm8
  601. mulsd %xmm4, %xmm13
  602. movsd -12 * SIZE(X1), %xmm4
  603. ADD2 %xmm12, %xmm1
  604. movapd %xmm8, %xmm12
  605. mulsd %xmm6, %xmm8
  606. ADD3 %xmm9, %xmm0
  607. movsd -13 * SIZE(A1), %xmm9
  608. mulsd %xmm7, %xmm12
  609. ADD4 %xmm13, %xmm1
  610. movapd %xmm9, %xmm13
  611. mulsd %xmm7, %xmm9
  612. movsd -9 * SIZE(X1), %xmm7
  613. ADD1 %xmm8, %xmm0
  614. movsd -12 * SIZE(A1), %xmm8
  615. mulsd %xmm6, %xmm13
  616. movsd -10 * SIZE(X1), %xmm6
  617. ADD2 %xmm12, %xmm1
  618. movapd %xmm8, %xmm12
  619. mulsd %xmm4, %xmm8
  620. ADD3 %xmm9, %xmm0
  621. movsd -11 * SIZE(A1), %xmm9
  622. mulsd %xmm5, %xmm12
  623. ADD4 %xmm13, %xmm1
  624. movapd %xmm9, %xmm13
  625. mulsd %xmm5, %xmm9
  626. movsd -7 * SIZE(X1), %xmm5
  627. ADD1 %xmm8, %xmm0
  628. movsd -10 * SIZE(A1), %xmm8
  629. mulsd %xmm4, %xmm13
  630. movsd -8 * SIZE(X1), %xmm4
  631. ADD2 %xmm12, %xmm1
  632. movapd %xmm8, %xmm12
  633. mulsd %xmm6, %xmm8
  634. ADD3 %xmm9, %xmm0
  635. movsd -9 * SIZE(A1), %xmm9
  636. mulsd %xmm7, %xmm12
  637. ADD4 %xmm13, %xmm1
  638. movapd %xmm9, %xmm13
  639. mulsd %xmm7, %xmm9
  640. movsd -5 * SIZE(X1), %xmm7
  641. ADD1 %xmm8, %xmm0
  642. movsd -8 * SIZE(A1), %xmm8
  643. mulsd %xmm6, %xmm13
  644. movsd -6 * SIZE(X1), %xmm6
  645. ADD2 %xmm12, %xmm1
  646. movapd %xmm8, %xmm12
  647. mulsd %xmm4, %xmm8
  648. ADD3 %xmm9, %xmm0
  649. mulsd %xmm5, %xmm12
  650. movsd -7 * SIZE(A1), %xmm9
  651. ADD4 %xmm13, %xmm1
  652. subq $-8 * SIZE, A1
  653. subq $-8 * SIZE, X1
  654. subq $-8 * SIZE, A2
  655. subq $1, I
  656. BRANCH
  657. jg .L23
  658. ALIGN_3
  659. .L24:
  660. movapd %xmm9, %xmm13
  661. mulsd %xmm5, %xmm9
  662. movsd -11 * SIZE(X1), %xmm5
  663. ADD1 %xmm8, %xmm0
  664. movsd -14 * SIZE(A1), %xmm8
  665. mulsd %xmm4, %xmm13
  666. movsd -12 * SIZE(X1), %xmm4
  667. ADD2 %xmm12, %xmm1
  668. movapd %xmm8, %xmm12
  669. mulsd %xmm6, %xmm8
  670. ADD3 %xmm9, %xmm0
  671. movsd -13 * SIZE(A1), %xmm9
  672. mulsd %xmm7, %xmm12
  673. ADD4 %xmm13, %xmm1
  674. movapd %xmm9, %xmm13
  675. mulsd %xmm7, %xmm9
  676. movsd -9 * SIZE(X1), %xmm7
  677. ADD1 %xmm8, %xmm0
  678. movsd -12 * SIZE(A1), %xmm8
  679. mulsd %xmm6, %xmm13
  680. movsd -10 * SIZE(X1), %xmm6
  681. ADD2 %xmm12, %xmm1
  682. movapd %xmm8, %xmm12
  683. mulsd %xmm4, %xmm8
  684. ADD3 %xmm9, %xmm0
  685. movsd -11 * SIZE(A1), %xmm9
  686. mulsd %xmm5, %xmm12
  687. ADD4 %xmm13, %xmm1
  688. movapd %xmm9, %xmm13
  689. mulsd %xmm5, %xmm9
  690. movsd -7 * SIZE(X1), %xmm5
  691. ADD1 %xmm8, %xmm0
  692. movsd -10 * SIZE(A1), %xmm8
  693. mulsd %xmm4, %xmm13
  694. movsd -8 * SIZE(X1), %xmm4
  695. ADD2 %xmm12, %xmm1
  696. movapd %xmm8, %xmm12
  697. mulsd %xmm6, %xmm8
  698. ADD3 %xmm9, %xmm0
  699. movsd -9 * SIZE(A1), %xmm9
  700. mulsd %xmm7, %xmm12
  701. ADD4 %xmm13, %xmm1
  702. movapd %xmm9, %xmm13
  703. mulsd %xmm7, %xmm9
  704. movsd -5 * SIZE(X1), %xmm7
  705. ADD1 %xmm8, %xmm0
  706. mulsd %xmm6, %xmm13
  707. movsd -6 * SIZE(X1), %xmm6
  708. ADD2 %xmm12, %xmm1
  709. ADD3 %xmm9, %xmm0
  710. ADD4 %xmm13, %xmm1
  711. subq $-8 * SIZE, A1
  712. subq $-8 * SIZE, A2
  713. subq $-8 * SIZE, X1
  714. ALIGN_3
  715. .L25:
  716. testq $2, M
  717. je .L27
  718. movsd -16 * SIZE(A1), %xmm8
  719. movsd -15 * SIZE(A1), %xmm9
  720. movapd %xmm8, %xmm12
  721. mulsd %xmm4, %xmm8
  722. mulsd %xmm5, %xmm12
  723. movapd %xmm9, %xmm13
  724. mulsd %xmm5, %xmm9
  725. movsd -11 * SIZE(X1), %xmm5
  726. ADD1 %xmm8, %xmm0
  727. movsd -14 * SIZE(A1), %xmm8
  728. mulsd %xmm4, %xmm13
  729. movsd -12 * SIZE(X1), %xmm4
  730. ADD2 %xmm12, %xmm1
  731. movapd %xmm8, %xmm12
  732. mulsd %xmm6, %xmm8
  733. ADD3 %xmm9, %xmm0
  734. movsd -13 * SIZE(A1), %xmm9
  735. mulsd %xmm7, %xmm12
  736. ADD4 %xmm13, %xmm1
  737. movapd %xmm9, %xmm13
  738. mulsd %xmm7, %xmm9
  739. ADD1 %xmm8, %xmm0
  740. mulsd %xmm6, %xmm13
  741. ADD2 %xmm12, %xmm1
  742. ADD3 %xmm9, %xmm0
  743. ADD4 %xmm13, %xmm1
  744. addq $4 * SIZE, A1
  745. addq $4 * SIZE, A2
  746. ALIGN_3
  747. .L27:
  748. testq $1, M
  749. je .L29
  750. movsd -16 * SIZE(A1), %xmm8
  751. movsd -15 * SIZE(A1), %xmm9
  752. movapd %xmm8, %xmm12
  753. mulsd %xmm4, %xmm8
  754. mulsd %xmm5, %xmm12
  755. movapd %xmm9, %xmm13
  756. mulsd %xmm5, %xmm9
  757. ADD1 %xmm8, %xmm0
  758. mulsd %xmm4, %xmm13
  759. ADD2 %xmm12, %xmm1
  760. ADD3 %xmm9, %xmm0
  761. ADD4 %xmm13, %xmm1
  762. ALIGN_3
  763. .L29:
  764. movsd 0 * SIZE(Y), %xmm4
  765. movapd %xmm0, %xmm10
  766. mulsd ALPHA_R, %xmm0
  767. movsd 1 * SIZE(Y), %xmm5
  768. movapd %xmm1, %xmm11
  769. mulsd ALPHA_R, %xmm1
  770. mulsd ALPHA_I, %xmm10
  771. mulsd ALPHA_I, %xmm11
  772. addsd %xmm10, %xmm1
  773. subsd %xmm11, %xmm0
  774. addsd %xmm4, %xmm0
  775. addsd %xmm5, %xmm1
  776. movlpd %xmm0, 0 * SIZE(Y1)
  777. movlpd %xmm1, 1 * SIZE(Y1)
  778. ALIGN_3
  779. .L999:
  780. movq 0(%rsp), %rbx
  781. movq 8(%rsp), %rbp
  782. movq 16(%rsp), %r12
  783. movq 24(%rsp), %r13
  784. movq 32(%rsp), %r14
  785. movq 40(%rsp), %r15
  786. #ifdef WINDOWS_ABI
  787. movq 48(%rsp), %rdi
  788. movq 56(%rsp), %rsi
  789. movups 64(%rsp), %xmm6
  790. movups 80(%rsp), %xmm7
  791. movups 96(%rsp), %xmm8
  792. movups 112(%rsp), %xmm9
  793. movups 128(%rsp), %xmm10
  794. movups 144(%rsp), %xmm11
  795. movups 160(%rsp), %xmm12
  796. movups 176(%rsp), %xmm13
  797. movups 192(%rsp), %xmm14
  798. movups 208(%rsp), %xmm15
  799. #endif
  800. addq $STACKSIZE, %rsp
  801. ret
  802. EPILOGUE