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.

qgemm_kernel_2x2.S 14 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  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. #define M ARG1
  41. #define N ARG2
  42. #define K ARG3
  43. #define A ARG4
  44. #define B ARG5
  45. #define C ARG6
  46. #define LDC %r10
  47. #define I %r12
  48. #define J %r13
  49. #define AO %r14
  50. #define BO %r15
  51. #define CO %rbp
  52. #define KK %r11
  53. #define KKK 48(%rsp)
  54. #define STACKSIZE 64
  55. #define ALPHA 8 + STACKSIZE(%rsp)
  56. #define OFFSET 32 + STACKSIZE(%rsp)
  57. #ifdef OPTERON
  58. #define PREFETCH prefetch
  59. #define PREFETCHW prefetchw
  60. #else
  61. #define PREFETCH prefetcht0
  62. #define PREFETCHW prefetcht0
  63. #endif
  64. #define PREFETCHSIZE (5 + 4 * 10)
  65. PROLOGUE
  66. PROFCODE
  67. subq $STACKSIZE, %rsp
  68. movq %rbx, 0(%rsp)
  69. movq %rbp, 8(%rsp)
  70. movq %r12, 16(%rsp)
  71. movq %r13, 24(%rsp)
  72. movq %r14, 32(%rsp)
  73. movq %r15, 40(%rsp)
  74. movq 24 + STACKSIZE(%rsp), LDC
  75. #if defined(TRMMKERNEL) && !defined(LEFT)
  76. movq OFFSET, %rax
  77. negq %rax
  78. movq %rax, KK
  79. #endif
  80. addq $8 * SIZE, A
  81. addq $8 * SIZE, B
  82. salq $BASE_SHIFT, LDC
  83. movq N, %rax
  84. sarq $1, %rax
  85. movq %rax, J
  86. je .L30
  87. ALIGN_4
  88. .L01:
  89. #if defined(TRMMKERNEL) && defined(LEFT)
  90. movq OFFSET, %rax
  91. movq %rax, KK
  92. #endif
  93. movq A, AO
  94. movq C, CO
  95. leaq (, LDC, 2), %rax
  96. addq %rax, C
  97. movq M, I
  98. sarq $1, I
  99. je .L20
  100. ALIGN_4
  101. .L11:
  102. #if !defined(TRMMKERNEL) || \
  103. (defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \
  104. (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
  105. movq B, BO
  106. #else
  107. movq KK, %rax
  108. salq $BASE_SHIFT, %rax
  109. leaq (AO, %rax, 2), AO
  110. leaq (B, %rax, 2), BO
  111. #endif
  112. fldz
  113. fldz
  114. fldz
  115. fldz
  116. #if defined(HAVE_3DNOW)
  117. prefetchw 2 * SIZE(CO)
  118. prefetchw 2 * SIZE(CO, LDC, 1)
  119. #elif defined(HAVE_SSE)
  120. prefetchnta 2 * SIZE(CO)
  121. prefetchnta 2 * SIZE(CO, LDC, 1)
  122. #endif
  123. #ifndef TRMMKERNEL
  124. movq K, %rax
  125. #elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
  126. movq K, %rax
  127. subq KK, %rax
  128. movq %rax, KKK
  129. #else
  130. movq KK, %rax
  131. #ifdef LEFT
  132. addq $2, %rax
  133. #else
  134. addq $2, %rax
  135. #endif
  136. movq %rax, KKK
  137. #endif
  138. sarq $2, %rax
  139. je .L15
  140. ALIGN_4
  141. .L12:
  142. PREFETCH (PREFETCHSIZE + 0) * SIZE(AO)
  143. FLD -8 * SIZE(AO)
  144. FLD -8 * SIZE(BO)
  145. fld %st(1)
  146. fmul %st(1), %st
  147. faddp %st, %st(3)
  148. FLD -7 * SIZE(BO)
  149. fmul %st, %st(2)
  150. FLD -7 * SIZE(AO)
  151. fmul %st, %st(2)
  152. fmulp %st, %st(1)
  153. faddp %st, %st(6)
  154. faddp %st, %st(3)
  155. faddp %st, %st(3)
  156. FLD -6 * SIZE(AO)
  157. FLD -6 * SIZE(BO)
  158. fld %st(1)
  159. fmul %st(1), %st
  160. faddp %st, %st(3)
  161. FLD -5 * SIZE(BO)
  162. fmul %st, %st(2)
  163. FLD -5 * SIZE(AO)
  164. fmul %st, %st(2)
  165. fmulp %st, %st(1)
  166. faddp %st, %st(6)
  167. faddp %st, %st(3)
  168. faddp %st, %st(3)
  169. PREFETCH (PREFETCHSIZE + 4) * SIZE(AO)
  170. FLD -4 * SIZE(AO)
  171. FLD -4 * SIZE(BO)
  172. fld %st(1)
  173. fmul %st(1), %st
  174. faddp %st, %st(3)
  175. FLD -3 * SIZE(BO)
  176. fmul %st, %st(2)
  177. FLD -3 * SIZE(AO)
  178. fmul %st, %st(2)
  179. fmulp %st, %st(1)
  180. faddp %st, %st(6)
  181. faddp %st, %st(3)
  182. faddp %st, %st(3)
  183. FLD -2 * SIZE(AO)
  184. FLD -2 * SIZE(BO)
  185. fld %st(1)
  186. fmul %st(1), %st
  187. faddp %st, %st(3)
  188. FLD -1 * SIZE(BO)
  189. fmul %st, %st(2)
  190. FLD -1 * SIZE(AO)
  191. fmul %st, %st(2)
  192. fmulp %st, %st(1)
  193. faddp %st, %st(6)
  194. faddp %st, %st(3)
  195. faddp %st, %st(3)
  196. addq $8 * SIZE,AO
  197. addq $8 * SIZE,BO
  198. decq %rax
  199. jne .L12
  200. ALIGN_4
  201. .L15:
  202. #ifndef TRMMKERNEL
  203. movq K, %rax
  204. #else
  205. movq KKK, %rax
  206. #endif
  207. and $3, %rax
  208. je .L18
  209. ALIGN_4
  210. .L16:
  211. FLD -8 * SIZE(AO)
  212. FLD -8 * SIZE(BO)
  213. fld %st(1)
  214. fmul %st(1), %st
  215. faddp %st, %st(3)
  216. FLD -7 * SIZE(BO)
  217. fmul %st, %st(2)
  218. FLD -7 * SIZE(AO)
  219. fmul %st, %st(2)
  220. fmulp %st, %st(1)
  221. faddp %st, %st(6)
  222. faddp %st, %st(3)
  223. faddp %st, %st(3)
  224. addq $2 * SIZE,AO
  225. addq $2 * SIZE,BO
  226. decq %rax
  227. jne .L16
  228. ALIGN_4
  229. .L18:
  230. #ifndef TRMMKERNEL
  231. FLD ALPHA
  232. fmul %st, %st(1)
  233. fmul %st, %st(2)
  234. fmul %st, %st(3)
  235. fmulp %st, %st(4)
  236. FLD 0 * SIZE(CO)
  237. faddp %st, %st(1)
  238. FST 0 * SIZE(CO)
  239. FLD 1 * SIZE(CO)
  240. faddp %st, %st(1)
  241. FST 1 * SIZE(CO)
  242. FLD 0 * SIZE(CO, LDC)
  243. faddp %st, %st(1)
  244. FST 0 * SIZE(CO, LDC)
  245. FLD 1 * SIZE(CO, LDC)
  246. faddp %st, %st(1)
  247. FST 1 * SIZE(CO, LDC)
  248. #else
  249. FST 0 * SIZE(CO)
  250. FST 1 * SIZE(CO)
  251. FST 0 * SIZE(CO, LDC)
  252. FST 1 * SIZE(CO, LDC)
  253. #endif
  254. #if (defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \
  255. (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
  256. movq K, %rax
  257. subq KKK, %rax
  258. salq $BASE_SHIFT, %rax
  259. leaq (AO, %rax, 2), AO
  260. leaq (BO, %rax, 2), BO
  261. #endif
  262. #if defined(TRMMKERNEL) && defined(LEFT)
  263. addq $2, KK
  264. #endif
  265. addq $2 * SIZE, CO
  266. decq I
  267. jne .L11
  268. ALIGN_4
  269. .L20:
  270. movq M, %rax
  271. andq $1, %rax
  272. je .L29
  273. ALIGN_4
  274. .L21:
  275. #if !defined(TRMMKERNEL) || \
  276. (defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \
  277. (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
  278. movq B, BO
  279. #else
  280. movq KK, %rax
  281. salq $BASE_SHIFT, %rax
  282. leaq (AO, %rax, 1), AO
  283. leaq ( B, %rax, 2), BO
  284. #endif
  285. fldz
  286. fldz
  287. #ifndef TRMMKERNEL
  288. movq K, %rax
  289. #elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
  290. movq K, %rax
  291. subq KK, %rax
  292. movq %rax, KKK
  293. #else
  294. movq KK, %rax
  295. #ifdef LEFT
  296. addq $1, %rax
  297. #else
  298. addq $2, %rax
  299. #endif
  300. movq %rax, KKK
  301. #endif
  302. sarq $2, %rax
  303. je .L25
  304. ALIGN_4
  305. .L22:
  306. PREFETCH (PREFETCHSIZE + 0) * SIZE(AO)
  307. FLD -8 * SIZE(AO)
  308. FLD -8 * SIZE(BO)
  309. fmul %st(1), %st
  310. faddp %st, %st(2)
  311. FLD -7 * SIZE(BO)
  312. fmulp %st, %st(1)
  313. faddp %st, %st(2)
  314. FLD -7 * SIZE(AO)
  315. FLD -6 * SIZE(BO)
  316. fmul %st(1), %st
  317. faddp %st, %st(2)
  318. FLD -5 * SIZE(BO)
  319. fmulp %st, %st(1)
  320. faddp %st, %st(2)
  321. FLD -6 * SIZE(AO)
  322. FLD -4 * SIZE(BO)
  323. fmul %st(1), %st
  324. faddp %st, %st(2)
  325. FLD -3 * SIZE(BO)
  326. fmulp %st, %st(1)
  327. faddp %st, %st(2)
  328. FLD -5 * SIZE(AO)
  329. FLD -2 * SIZE(BO)
  330. fmul %st(1), %st
  331. faddp %st, %st(2)
  332. FLD -1 * SIZE(BO)
  333. fmulp %st, %st(1)
  334. faddp %st, %st(2)
  335. addq $4 * SIZE,AO
  336. addq $8 * SIZE,BO
  337. decq %rax
  338. jne .L22
  339. ALIGN_4
  340. .L25:
  341. #ifndef TRMMKERNEL
  342. movq K, %rax
  343. #else
  344. movq KKK, %rax
  345. #endif
  346. and $3, %rax
  347. je .L28
  348. ALIGN_4
  349. .L26:
  350. FLD -8 * SIZE(AO)
  351. FLD -8 * SIZE(BO)
  352. fmul %st(1), %st
  353. faddp %st, %st(2)
  354. FLD -7 * SIZE(BO)
  355. fmulp %st, %st(1)
  356. faddp %st, %st(2)
  357. addq $1 * SIZE,AO
  358. addq $2 * SIZE,BO
  359. decq %rax
  360. jne .L26
  361. ALIGN_4
  362. .L28:
  363. #ifndef TRMMKERNEL
  364. FLD ALPHA
  365. fmul %st, %st(1)
  366. fmulp %st, %st(2)
  367. FLD 0 * SIZE(CO)
  368. faddp %st, %st(1)
  369. FST 0 * SIZE(CO)
  370. FLD 0 * SIZE(CO, LDC)
  371. faddp %st, %st(1)
  372. FST 0 * SIZE(CO, LDC)
  373. #else
  374. FST 0 * SIZE(CO)
  375. FST 0 * SIZE(CO, LDC)
  376. #endif
  377. #if (defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \
  378. (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
  379. movq K, %rax
  380. subq KKK, %rax
  381. salq $BASE_SHIFT, %rax
  382. leaq (AO, %rax, 1), AO
  383. leaq (BO, %rax, 2), BO
  384. #endif
  385. #if defined(TRMMKERNEL) && defined(LEFT)
  386. addq $1, KK
  387. #endif
  388. addq $1 * SIZE, CO
  389. ALIGN_4
  390. .L29:
  391. #if defined(TRMMKERNEL) && !defined(LEFT)
  392. addq $2, KK
  393. #endif
  394. movq BO, B
  395. decq J
  396. jne .L01
  397. ALIGN_4
  398. .L30:
  399. movq N, %rax
  400. testq $1, %rax
  401. je .L999
  402. #if defined(TRMMKERNEL) && defined(LEFT)
  403. movq OFFSET, %rax
  404. movq %rax, KK
  405. #endif
  406. movq A, AO
  407. movq C, CO
  408. addq LDC, C
  409. movq M, I
  410. sarq $1, I
  411. je .L40
  412. ALIGN_4
  413. .L31:
  414. #if !defined(TRMMKERNEL) || \
  415. (defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \
  416. (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
  417. movq B, BO
  418. #else
  419. movq KK, %rax
  420. salq $BASE_SHIFT, %rax
  421. leaq (AO, %rax, 2), AO
  422. leaq ( B, %rax, 1), BO
  423. #endif
  424. fldz
  425. fldz
  426. #if defined(HAVE_3DNOW)
  427. prefetchw 2 * SIZE(CO)
  428. #elif defined(HAVE_SSE)
  429. prefetchnta 2 * SIZE(CO)
  430. #endif
  431. #ifndef TRMMKERNEL
  432. movq K, %rax
  433. #elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
  434. movq K, %rax
  435. subq KK, %rax
  436. movq %rax, KKK
  437. #else
  438. movq KK, %rax
  439. #ifdef LEFT
  440. addq $2, %rax
  441. #else
  442. addq $1, %rax
  443. #endif
  444. movq %rax, KKK
  445. #endif
  446. sarq $2, %rax
  447. je .L35
  448. ALIGN_4
  449. .L32:
  450. PREFETCH (PREFETCHSIZE + 0) * SIZE(AO)
  451. FLD -8 * SIZE(BO)
  452. FLD -8 * SIZE(AO)
  453. fmul %st(1), %st
  454. faddp %st, %st(2)
  455. FLD -7 * SIZE(AO)
  456. fmulp %st, %st(1)
  457. faddp %st, %st(2)
  458. FLD -7 * SIZE(BO)
  459. FLD -6 * SIZE(AO)
  460. fmul %st(1), %st
  461. faddp %st, %st(2)
  462. FLD -5 * SIZE(AO)
  463. fmulp %st, %st(1)
  464. faddp %st, %st(2)
  465. FLD -6 * SIZE(BO)
  466. FLD -4 * SIZE(AO)
  467. fmul %st(1), %st
  468. faddp %st, %st(2)
  469. FLD -3 * SIZE(AO)
  470. fmulp %st, %st(1)
  471. faddp %st, %st(2)
  472. FLD -5 * SIZE(BO)
  473. FLD -2 * SIZE(AO)
  474. fmul %st(1), %st
  475. faddp %st, %st(2)
  476. FLD -1 * SIZE(AO)
  477. fmulp %st, %st(1)
  478. faddp %st, %st(2)
  479. addq $8 * SIZE,AO
  480. addq $4 * SIZE,BO
  481. decq %rax
  482. jne .L32
  483. ALIGN_4
  484. .L35:
  485. #ifndef TRMMKERNEL
  486. movq K, %rax
  487. #else
  488. movq KKK, %rax
  489. #endif
  490. and $3, %rax
  491. je .L38
  492. ALIGN_4
  493. .L36:
  494. FLD -8 * SIZE(BO)
  495. FLD -8 * SIZE(AO)
  496. fmul %st(1), %st
  497. faddp %st, %st(2)
  498. FLD -7 * SIZE(AO)
  499. fmulp %st, %st(1)
  500. faddp %st, %st(2)
  501. addq $2 * SIZE,AO
  502. addq $1 * SIZE,BO
  503. decq %rax
  504. jne .L36
  505. ALIGN_4
  506. .L38:
  507. #ifndef TRMMKERNEL
  508. FLD ALPHA
  509. fmul %st, %st(1)
  510. fmulp %st, %st(2)
  511. FLD 0 * SIZE(CO)
  512. faddp %st, %st(1)
  513. FST 0 * SIZE(CO)
  514. FLD 1 * SIZE(CO)
  515. faddp %st, %st(1)
  516. FST 1 * SIZE(CO)
  517. #else
  518. FST 0 * SIZE(CO)
  519. FST 1 * SIZE(CO)
  520. #endif
  521. #if (defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \
  522. (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
  523. movq K, %rax
  524. subq KKK, %rax
  525. salq $BASE_SHIFT, %rax
  526. leaq (AO, %rax, 2), AO
  527. leaq (BO, %rax, 1), BO
  528. #endif
  529. #if defined(TRMMKERNEL) && defined(LEFT)
  530. addq $2, KK
  531. #endif
  532. addq $2 * SIZE, CO
  533. decq I
  534. jne .L31
  535. ALIGN_4
  536. .L40:
  537. movq M, %rax
  538. andq $1, %rax
  539. je .L49
  540. ALIGN_4
  541. .L41:
  542. #if !defined(TRMMKERNEL) || \
  543. (defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \
  544. (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
  545. movq B, BO
  546. #else
  547. movq KK, %rax
  548. salq $BASE_SHIFT, %rax
  549. leaq (AO, %rax, 1), AO
  550. leaq ( B, %rax, 1), BO
  551. #endif
  552. fldz
  553. #ifndef TRMMKERNEL
  554. movq K, %rax
  555. #elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
  556. movq K, %rax
  557. subq KK, %rax
  558. movq %rax, KKK
  559. #else
  560. movq KK, %rax
  561. #ifdef LEFT
  562. addq $1, %rax
  563. #else
  564. addq $1, %rax
  565. #endif
  566. movq %rax, KKK
  567. #endif
  568. sarq $2, %rax
  569. je .L45
  570. ALIGN_4
  571. .L42:
  572. PREFETCH (PREFETCHSIZE + 0) * SIZE(AO)
  573. FLD -8 * SIZE(AO)
  574. FLD -8 * SIZE(BO)
  575. fmulp %st, %st(1)
  576. faddp %st, %st(1)
  577. FLD -7 * SIZE(AO)
  578. FLD -7 * SIZE(BO)
  579. fmulp %st, %st(1)
  580. faddp %st, %st(1)
  581. FLD -6 * SIZE(AO)
  582. FLD -6 * SIZE(BO)
  583. fmulp %st, %st(1)
  584. faddp %st, %st(1)
  585. FLD -5 * SIZE(AO)
  586. FLD -5 * SIZE(BO)
  587. fmulp %st, %st(1)
  588. faddp %st, %st(1)
  589. addq $4 * SIZE,AO
  590. addq $4 * SIZE,BO
  591. decq %rax
  592. jne .L42
  593. ALIGN_4
  594. .L45:
  595. #ifndef TRMMKERNEL
  596. movq K, %rax
  597. #else
  598. movq KKK, %rax
  599. #endif
  600. and $3, %rax
  601. je .L48
  602. ALIGN_4
  603. .L46:
  604. FLD -8 * SIZE(AO)
  605. FLD -8 * SIZE(BO)
  606. fmulp %st, %st(1)
  607. faddp %st, %st(1)
  608. addq $1 * SIZE,AO
  609. addq $1 * SIZE,BO
  610. decq %rax
  611. jne .L46
  612. ALIGN_4
  613. .L48:
  614. #ifndef TRMMKERNEL
  615. FLD ALPHA
  616. fmulp %st, %st(1)
  617. FLD 0 * SIZE(CO)
  618. faddp %st, %st(1)
  619. FST 0 * SIZE(CO)
  620. #else
  621. FST 0 * SIZE(CO)
  622. #endif
  623. #if (defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \
  624. (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
  625. movq K, %rax
  626. subq KKK, %rax
  627. salq $BASE_SHIFT, %rax
  628. leaq (AO, %rax, 1), AO
  629. leaq (BO, %rax, 1), BO
  630. #endif
  631. #if defined(TRMMKERNEL) && defined(LEFT)
  632. addq $1, KK
  633. #endif
  634. addq $1 * SIZE, CO
  635. ALIGN_4
  636. .L49:
  637. #if defined(TRMMKERNEL) && !defined(LEFT)
  638. addq $1, KK
  639. #endif
  640. movq BO, B
  641. ALIGN_4
  642. .L999:
  643. EMMS
  644. movq 0(%rsp), %rbx
  645. movq 8(%rsp), %rbp
  646. movq 16(%rsp), %r12
  647. movq 24(%rsp), %r13
  648. movq 32(%rsp), %r14
  649. movq 40(%rsp), %r15
  650. addq $STACKSIZE, %rsp
  651. ret
  652. EPILOGUE