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.

trsm_kernel_LN_8x2_sse.S 65 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605
  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. #if !defined(HAVE_SSE) || !defined(HAVE_MMX)
  41. #error You have to check your configuration.
  42. #endif
  43. #define STACK 16
  44. #define ARGS 0
  45. #define STACK_M 4 + STACK + ARGS(%esi)
  46. #define STACK_N 8 + STACK + ARGS(%esi)
  47. #define STACK_K 12 + STACK + ARGS(%esi)
  48. #define STACK_A 20 + STACK + ARGS(%esi)
  49. #define STACK_B 24 + STACK + ARGS(%esi)
  50. #define STACK_C 28 + STACK + ARGS(%esi)
  51. #define STACK_LDC 32 + STACK + ARGS(%esi)
  52. #define STACK_OFFT 36 + STACK + ARGS(%esi)
  53. #define TRMASK 0(%esp)
  54. #define K 16(%esp)
  55. #define N 20(%esp)
  56. #define M 24(%esp)
  57. #define A 28(%esp)
  58. #define C 32(%esp)
  59. #define J 36(%esp)
  60. #define OLD_STACK 40(%esp)
  61. #define OFFSET 44(%esp)
  62. #define KK 48(%esp)
  63. #define KKK 52(%esp)
  64. #define AORIG 56(%esp)
  65. #define BORIG 60(%esp)
  66. #define BUFFER 128(%esp)
  67. #ifdef HAVE_3DNOW
  68. #define PREFETCH prefetch
  69. #define PREFETCHW prefetchw
  70. #define PREFETCHSIZE (16 * 10 + 8)
  71. #else
  72. #define PREFETCH prefetcht0
  73. #define PREFETCHW prefetcht0
  74. #define PREFETCHSIZE 96
  75. #endif
  76. #define B %edi
  77. #define AA %edx
  78. #define BB %ecx
  79. #define LDC %ebp
  80. #define CO1 %esi
  81. #define STACK_ALIGN 4096
  82. #define STACK_OFFSET 1024
  83. #if !defined(HAVE_SSE2) || defined(OPTERON)
  84. #define movsd movlps
  85. #endif
  86. #ifdef HAVE_SSE2
  87. #define xorps pxor
  88. #endif
  89. PROLOGUE
  90. pushl %ebp
  91. pushl %edi
  92. pushl %esi
  93. pushl %ebx
  94. PROFCODE
  95. movl %esp, %esi # save old stack
  96. subl $128 + LOCAL_BUFFER_SIZE, %esp
  97. andl $-STACK_ALIGN, %esp
  98. STACK_TOUCHING
  99. movss STACK_M, %xmm0
  100. movl STACK_N, %eax
  101. movss STACK_K, %xmm1
  102. movss STACK_A, %xmm2
  103. movl STACK_B, B
  104. movss STACK_C, %xmm3
  105. movl STACK_LDC, LDC
  106. movss STACK_OFFT, %xmm4
  107. movss %xmm1, K
  108. movl %eax, N
  109. movss %xmm0, M
  110. movss %xmm2, A
  111. movss %xmm3, C
  112. movl %esi, OLD_STACK
  113. movss %xmm4, OFFSET
  114. movss %xmm4, KK
  115. leal (, LDC, SIZE), LDC
  116. #ifdef LN
  117. movl M, %eax
  118. leal (, %eax, SIZE), %eax
  119. addl %eax, C
  120. imull K, %eax
  121. addl %eax, A
  122. #endif
  123. #ifdef RT
  124. movl N, %eax
  125. leal (, %eax, SIZE), %eax
  126. imull K, %eax
  127. addl %eax, B
  128. movl N, %eax
  129. imull LDC, %eax
  130. addl %eax, C
  131. #endif
  132. #ifdef RN
  133. negl KK
  134. #endif
  135. #ifdef RT
  136. movl N, %eax
  137. subl OFFSET, %eax
  138. movl %eax, KK
  139. #endif
  140. #if defined(LN) || defined(LT)
  141. movl $0x3f800000, 0 + TRMASK # 1.0
  142. movl $0x00000000, 4 + TRMASK # 0.0
  143. movl $0x3f800000, 8 + TRMASK # 1.0
  144. movl $0x00000000, 12 + TRMASK # 0.0
  145. #endif
  146. movl N, %eax
  147. sarl $1, %eax # j = (n >> 1)
  148. movl %eax, J
  149. jle .L100
  150. ALIGN_2
  151. .L01:
  152. #ifdef LN
  153. movl OFFSET, %eax
  154. addl M, %eax
  155. movl %eax, KK
  156. #endif
  157. leal BUFFER, BB
  158. #ifdef RT
  159. movl K, %eax
  160. sall $1 + BASE_SHIFT, %eax
  161. subl %eax, B
  162. #endif
  163. #if defined(LN) || defined(RT)
  164. movl KK, %eax
  165. movl B, BORIG
  166. sall $1 + BASE_SHIFT, %eax
  167. leal (B, %eax, 1), B
  168. leal (BB, %eax, 4), BB
  169. #endif
  170. #ifdef LT
  171. movl OFFSET, %eax
  172. movl %eax, KK
  173. #endif
  174. #if defined(LT) || defined(RN)
  175. movl KK, %eax
  176. #else
  177. movl K, %eax
  178. subl KK, %eax
  179. #endif
  180. sarl $2, %eax
  181. jle .L03
  182. ALIGN_4
  183. .L02:
  184. movsd 0 * SIZE(B), %xmm3
  185. movhps 2 * SIZE(B), %xmm3
  186. movsd 4 * SIZE(B), %xmm7
  187. movhps 6 * SIZE(B), %xmm7
  188. #ifdef HAVE_SSE2
  189. pshufd $0x00, %xmm3, %xmm0
  190. pshufd $0x55, %xmm3, %xmm1
  191. pshufd $0xaa, %xmm3, %xmm2
  192. pshufd $0xff, %xmm3, %xmm3
  193. pshufd $0x00, %xmm7, %xmm4
  194. pshufd $0x55, %xmm7, %xmm5
  195. pshufd $0xaa, %xmm7, %xmm6
  196. pshufd $0xff, %xmm7, %xmm7
  197. #else
  198. movaps %xmm3, %xmm0
  199. shufps $0x00, %xmm0, %xmm0
  200. movaps %xmm3, %xmm1
  201. shufps $0x55, %xmm1, %xmm1
  202. movaps %xmm3, %xmm2
  203. shufps $0xaa, %xmm2, %xmm2
  204. shufps $0xff, %xmm3, %xmm3
  205. movaps %xmm7, %xmm4
  206. shufps $0x00, %xmm4, %xmm4
  207. movaps %xmm7, %xmm5
  208. shufps $0x55, %xmm5, %xmm5
  209. movaps %xmm7, %xmm6
  210. shufps $0xaa, %xmm6, %xmm6
  211. shufps $0xff, %xmm7, %xmm7
  212. #endif
  213. movaps %xmm0, 0 * SIZE(BB)
  214. movaps %xmm1, 4 * SIZE(BB)
  215. movaps %xmm2, 8 * SIZE(BB)
  216. movaps %xmm3, 12 * SIZE(BB)
  217. movaps %xmm4, 16 * SIZE(BB)
  218. movaps %xmm5, 20 * SIZE(BB)
  219. movaps %xmm6, 24 * SIZE(BB)
  220. movaps %xmm7, 28 * SIZE(BB)
  221. addl $ 8 * SIZE, B
  222. addl $32 * SIZE, BB
  223. decl %eax
  224. BRANCH
  225. jne .L02
  226. ALIGN_2
  227. .L03:
  228. #if defined(LT) || defined(RN)
  229. movl KK, %eax
  230. #else
  231. movl K, %eax
  232. subl KK, %eax
  233. #endif
  234. andl $3, %eax
  235. BRANCH
  236. jle .L05
  237. ALIGN_2
  238. .L04:
  239. movsd 0 * SIZE(B), %xmm3
  240. #ifdef HAVE_SSE2
  241. pshufd $0x00, %xmm3, %xmm0
  242. pshufd $0x55, %xmm3, %xmm1
  243. #else
  244. movaps %xmm3, %xmm0
  245. shufps $0x00, %xmm0, %xmm0
  246. movaps %xmm3, %xmm1
  247. shufps $0x55, %xmm1, %xmm1
  248. #endif
  249. movaps %xmm0, 0 * SIZE(BB)
  250. movaps %xmm1, 4 * SIZE(BB)
  251. addl $2 * SIZE, B
  252. addl $8 * SIZE, BB
  253. decl %eax
  254. jne .L04
  255. ALIGN_4
  256. .L05:
  257. #if defined(LT) || defined(RN)
  258. movl A, AA
  259. #else
  260. movl A, %eax
  261. movl %eax, AORIG
  262. #endif
  263. leal (, LDC, 2), %eax
  264. #ifdef RT
  265. subl %eax, C
  266. #endif
  267. movl C, CO1
  268. #ifndef RT
  269. addl %eax, C
  270. #endif
  271. testl $1, M
  272. jle .L30
  273. #ifdef LN
  274. movl K, %eax
  275. sall $BASE_SHIFT, %eax
  276. subl %eax, AORIG
  277. #endif
  278. #if defined(LN) || defined(RT)
  279. movl KK, %eax
  280. movl AORIG, AA
  281. sall $BASE_SHIFT, %eax
  282. addl %eax, AA
  283. #endif
  284. leal BUFFER, BB
  285. #if defined(LN) || defined(RT)
  286. movl KK, %eax
  287. sall $1 + BASE_SHIFT, %eax
  288. leal (BB, %eax, 4), BB
  289. #endif
  290. movss 0 * SIZE(BB), %xmm2
  291. xorps %xmm4, %xmm4
  292. movss 0 * SIZE(AA), %xmm0
  293. xorps %xmm5, %xmm5
  294. movss 16 * SIZE(BB), %xmm3
  295. xorps %xmm6, %xmm6
  296. movss 4 * SIZE(AA), %xmm1
  297. xorps %xmm7, %xmm7
  298. #if defined(LT) || defined(RN)
  299. movl KK, %eax
  300. #else
  301. movl K, %eax
  302. subl KK, %eax
  303. #endif
  304. sarl $3, %eax
  305. je .L72
  306. ALIGN_2
  307. .L71:
  308. mulss %xmm0, %xmm2
  309. mulss 4 * SIZE(BB), %xmm0
  310. addss %xmm2, %xmm4
  311. movss 8 * SIZE(BB), %xmm2
  312. addss %xmm0, %xmm5
  313. movss 1 * SIZE(AA), %xmm0
  314. mulss %xmm0, %xmm2
  315. mulss 12 * SIZE(BB), %xmm0
  316. addss %xmm2, %xmm6
  317. movss 32 * SIZE(BB), %xmm2
  318. addss %xmm0, %xmm7
  319. movss 2 * SIZE(AA), %xmm0
  320. mulss %xmm0, %xmm3
  321. mulss 20 * SIZE(BB), %xmm0
  322. addss %xmm3, %xmm4
  323. movss 24 * SIZE(BB), %xmm3
  324. addss %xmm0, %xmm5
  325. movss 3 * SIZE(AA), %xmm0
  326. mulss %xmm0, %xmm3
  327. mulss 28 * SIZE(BB), %xmm0
  328. addss %xmm3, %xmm6
  329. movss 48 * SIZE(BB), %xmm3
  330. addss %xmm0, %xmm7
  331. movss 8 * SIZE(AA), %xmm0
  332. mulss %xmm1, %xmm2
  333. mulss 36 * SIZE(BB), %xmm1
  334. addss %xmm2, %xmm4
  335. movss 40 * SIZE(BB), %xmm2
  336. addss %xmm1, %xmm5
  337. movss 5 * SIZE(AA), %xmm1
  338. mulss %xmm1, %xmm2
  339. mulss 44 * SIZE(BB), %xmm1
  340. addss %xmm2, %xmm6
  341. movss 64 * SIZE(BB), %xmm2
  342. addss %xmm1, %xmm7
  343. movss 6 * SIZE(AA), %xmm1
  344. mulss %xmm1, %xmm3
  345. mulss 52 * SIZE(BB), %xmm1
  346. addss %xmm3, %xmm4
  347. movss 56 * SIZE(BB), %xmm3
  348. addss %xmm1, %xmm5
  349. movss 7 * SIZE(AA), %xmm1
  350. mulss %xmm1, %xmm3
  351. mulss 60 * SIZE(BB), %xmm1
  352. addss %xmm3, %xmm6
  353. movss 80 * SIZE(BB), %xmm3
  354. addss %xmm1, %xmm7
  355. movss 12 * SIZE(AA), %xmm1
  356. addl $ 8 * SIZE, AA
  357. addl $64 * SIZE, BB
  358. decl %eax
  359. jne .L71
  360. ALIGN_2
  361. .L72:
  362. #if defined(LT) || defined(RN)
  363. movl KK, %eax
  364. #else
  365. movl K, %eax
  366. subl KK, %eax
  367. #endif
  368. andl $7, %eax # if (k & 1)
  369. BRANCH
  370. je .L74
  371. .L73:
  372. mulss %xmm0, %xmm2
  373. mulss 4 * SIZE(BB), %xmm0
  374. addss %xmm2, %xmm4
  375. movss 8 * SIZE(BB), %xmm2
  376. addss %xmm0, %xmm5
  377. movss 1 * SIZE(AA), %xmm0
  378. addl $1 * SIZE, AA
  379. addl $8 * SIZE, BB
  380. decl %eax
  381. jg .L73
  382. ALIGN_4
  383. .L74:
  384. addss %xmm6, %xmm4
  385. addss %xmm7, %xmm5
  386. #if defined(LN) || defined(RT)
  387. movl KK, %eax
  388. #ifdef LN
  389. subl $1, %eax
  390. #else
  391. subl $2, %eax
  392. #endif
  393. movl AORIG, AA
  394. movl BORIG, B
  395. leal BUFFER, BB
  396. sall $BASE_SHIFT, %eax
  397. leal (AA, %eax, 1), AA
  398. leal (B, %eax, 2), B
  399. leal (BB, %eax, 8), BB
  400. #endif
  401. #if defined(LN) || defined(LT)
  402. unpcklps %xmm5, %xmm4
  403. #ifdef movsd
  404. xorps %xmm2, %xmm2
  405. #endif
  406. movsd 0 * SIZE(B), %xmm2
  407. subps %xmm4, %xmm2
  408. #else
  409. movss 0 * SIZE(AA), %xmm0
  410. movss 1 * SIZE(AA), %xmm2
  411. subss %xmm4, %xmm0
  412. subss %xmm5, %xmm2
  413. #endif
  414. #if defined(LN) || defined(LT)
  415. movaps TRMASK, %xmm6
  416. #endif
  417. #if defined(LN) || defined(LT)
  418. movss 0 * SIZE(AA), %xmm0
  419. shufps $0x00, %xmm6, %xmm0
  420. mulps %xmm0, %xmm2
  421. #endif
  422. #ifdef RN
  423. movss 0 * SIZE(B), %xmm6
  424. mulss %xmm6, %xmm0
  425. movss 1 * SIZE(B), %xmm6
  426. movaps %xmm6, %xmm5
  427. mulss %xmm0, %xmm5
  428. subss %xmm5, %xmm2
  429. movss 3 * SIZE(B), %xmm6
  430. mulss %xmm6, %xmm2
  431. #endif
  432. #ifdef RT
  433. movss 3 * SIZE(B), %xmm6
  434. mulss %xmm6, %xmm2
  435. movss 2 * SIZE(B), %xmm6
  436. movaps %xmm6, %xmm5
  437. mulss %xmm2, %xmm5
  438. subss %xmm5, %xmm0
  439. movss 0 * SIZE(B), %xmm6
  440. mulss %xmm6, %xmm0
  441. #endif
  442. #if defined(LN) || defined(LT)
  443. movlps %xmm2, 0 * SIZE(B)
  444. movaps %xmm2, %xmm0
  445. shufps $0x00, %xmm0, %xmm0
  446. movaps %xmm2, %xmm1
  447. shufps $0x55, %xmm1, %xmm1
  448. movaps %xmm0, 0 * SIZE(BB)
  449. movaps %xmm1, 4 * SIZE(BB)
  450. #else
  451. movss %xmm0, 0 * SIZE(AA)
  452. movss %xmm2, 1 * SIZE(AA)
  453. #endif
  454. #ifdef LN
  455. subl $1 * SIZE, CO1
  456. #endif
  457. #if defined(LN) || defined(LT)
  458. movaps %xmm2, %xmm0
  459. shufps $0x88, %xmm3, %xmm2
  460. shufps $0xdd, %xmm3, %xmm0
  461. movss %xmm2, 0 * SIZE(CO1)
  462. movss %xmm0, 0 * SIZE(CO1, LDC)
  463. #else
  464. movss %xmm0, 0 * SIZE(CO1)
  465. movss %xmm2, 0 * SIZE(CO1, LDC)
  466. #endif
  467. #ifndef LN
  468. addl $1 * SIZE, CO1
  469. #endif
  470. #if defined(LT) || defined(RN)
  471. movl K, %eax
  472. subl KK, %eax
  473. leal (,%eax, SIZE), %eax
  474. leal (AA, %eax, 1), AA
  475. #ifdef LT
  476. addl $2 * SIZE, B
  477. #endif
  478. #endif
  479. #ifdef LN
  480. subl $1, KK
  481. movl BORIG, B
  482. #endif
  483. #ifdef LT
  484. addl $1, KK
  485. #endif
  486. #ifdef RT
  487. movl K, %eax
  488. movl BORIG, B
  489. sall $BASE_SHIFT, %eax
  490. addl %eax, AORIG
  491. #endif
  492. ALIGN_2
  493. .L30:
  494. testl $2, M
  495. jle .L50
  496. #ifdef LN
  497. movl K, %eax
  498. sall $1 + BASE_SHIFT, %eax
  499. subl %eax, AORIG
  500. #endif
  501. #if defined(LN) || defined(RT)
  502. movl KK, %eax
  503. movl AORIG, AA
  504. sall $1 + BASE_SHIFT, %eax
  505. addl %eax, AA
  506. #endif
  507. leal BUFFER, BB
  508. #if defined(LN) || defined(RT)
  509. movl KK, %eax
  510. sall $1 + BASE_SHIFT, %eax
  511. leal (BB, %eax, 4), BB
  512. #endif
  513. movaps 0 * SIZE(BB), %xmm2
  514. xorps %xmm4, %xmm4
  515. movaps 0 * SIZE(AA), %xmm0
  516. xorps %xmm5, %xmm5
  517. movaps 16 * SIZE(BB), %xmm3
  518. xorps %xmm6, %xmm6
  519. movaps 8 * SIZE(AA), %xmm1
  520. xorps %xmm7, %xmm7
  521. #if defined(LT) || defined(RN)
  522. movl KK, %eax
  523. #else
  524. movl K, %eax
  525. subl KK, %eax
  526. #endif
  527. sarl $3, %eax
  528. je .L52
  529. ALIGN_2
  530. .L51:
  531. mulps %xmm0, %xmm2
  532. addps %xmm2, %xmm4
  533. movaps 4 * SIZE(BB), %xmm2
  534. mulps %xmm0, %xmm2
  535. movsd 2 * SIZE(AA), %xmm0
  536. addps %xmm2, %xmm5
  537. movaps 8 * SIZE(BB), %xmm2
  538. mulps %xmm0, %xmm2
  539. addps %xmm2, %xmm6
  540. movaps 12 * SIZE(BB), %xmm2
  541. mulps %xmm0, %xmm2
  542. movsd 4 * SIZE(AA), %xmm0
  543. addps %xmm2, %xmm7
  544. movaps 32 * SIZE(BB), %xmm2
  545. mulps %xmm0, %xmm3
  546. addps %xmm3, %xmm4
  547. movaps 20 * SIZE(BB), %xmm3
  548. mulps %xmm0, %xmm3
  549. movsd 6 * SIZE(AA), %xmm0
  550. addps %xmm3, %xmm5
  551. movaps 24 * SIZE(BB), %xmm3
  552. mulps %xmm0, %xmm3
  553. addps %xmm3, %xmm6
  554. movaps 28 * SIZE(BB), %xmm3
  555. mulps %xmm0, %xmm3
  556. movsd 16 * SIZE(AA), %xmm0
  557. addps %xmm3, %xmm7
  558. movaps 48 * SIZE(BB), %xmm3
  559. mulps %xmm1, %xmm2
  560. addps %xmm2, %xmm4
  561. movaps 36 * SIZE(BB), %xmm2
  562. mulps %xmm1, %xmm2
  563. movsd 10 * SIZE(AA), %xmm1
  564. addps %xmm2, %xmm5
  565. movaps 40 * SIZE(BB), %xmm2
  566. mulps %xmm1, %xmm2
  567. addps %xmm2, %xmm6
  568. movaps 44 * SIZE(BB), %xmm2
  569. mulps %xmm1, %xmm2
  570. movsd 12 * SIZE(AA), %xmm1
  571. addps %xmm2, %xmm7
  572. movaps 64 * SIZE(BB), %xmm2
  573. mulps %xmm1, %xmm3
  574. addps %xmm3, %xmm4
  575. movaps 52 * SIZE(BB), %xmm3
  576. mulps %xmm1, %xmm3
  577. movsd 14 * SIZE(AA), %xmm1
  578. addps %xmm3, %xmm5
  579. movaps 56 * SIZE(BB), %xmm3
  580. mulps %xmm1, %xmm3
  581. addps %xmm3, %xmm6
  582. movaps 60 * SIZE(BB), %xmm3
  583. mulps %xmm1, %xmm3
  584. movsd 24 * SIZE(AA), %xmm1
  585. addps %xmm3, %xmm7
  586. movaps 80 * SIZE(BB), %xmm3
  587. addl $16 * SIZE, AA
  588. addl $64 * SIZE, BB
  589. decl %eax
  590. jne .L51
  591. ALIGN_2
  592. .L52:
  593. #if defined(LT) || defined(RN)
  594. movl KK, %eax
  595. #else
  596. movl K, %eax
  597. subl KK, %eax
  598. #endif
  599. andl $7, %eax # if (k & 1)
  600. BRANCH
  601. je .L54
  602. .L53:
  603. mulps %xmm0, %xmm2
  604. addps %xmm2, %xmm4
  605. movaps 4 * SIZE(BB), %xmm2
  606. mulps %xmm0, %xmm2
  607. movsd 2 * SIZE(AA), %xmm0
  608. addps %xmm2, %xmm5
  609. movaps 8 * SIZE(BB), %xmm2
  610. addl $2 * SIZE, AA
  611. addl $8 * SIZE, BB
  612. decl %eax
  613. jg .L53
  614. ALIGN_4
  615. .L54:
  616. addps %xmm6, %xmm4
  617. addps %xmm7, %xmm5
  618. #if defined(LN) || defined(RT)
  619. movl KK, %eax
  620. #ifdef LN
  621. subl $2, %eax
  622. #else
  623. subl $2, %eax
  624. #endif
  625. movl AORIG, AA
  626. movl BORIG, B
  627. leal BUFFER, BB
  628. sall $BASE_SHIFT, %eax
  629. leal (AA, %eax, 2), AA
  630. leal (B, %eax, 2), B
  631. leal (BB, %eax, 8), BB
  632. #endif
  633. #if defined(LN) || defined(LT)
  634. unpcklps %xmm5, %xmm4
  635. movsd 0 * SIZE(B), %xmm2
  636. movhps 2 * SIZE(B), %xmm2
  637. subps %xmm4, %xmm2
  638. #else
  639. #ifdef movsd
  640. xorps %xmm0, %xmm0
  641. #endif
  642. movsd 0 * SIZE(AA), %xmm0
  643. #ifdef movsd
  644. xorps %xmm2, %xmm2
  645. #endif
  646. movsd 2 * SIZE(AA), %xmm2
  647. subps %xmm4, %xmm0
  648. subps %xmm5, %xmm2
  649. #endif
  650. #if defined(LN) || defined(LT)
  651. movaps TRMASK, %xmm6
  652. #endif
  653. #ifdef LN
  654. movss 3 * SIZE(AA), %xmm0
  655. movaps %xmm6, %xmm1
  656. shufps $0x00, %xmm0, %xmm1
  657. mulps %xmm1, %xmm2
  658. movaps %xmm2, %xmm1
  659. shufps $0xee, %xmm1, %xmm1
  660. movss 2 * SIZE(AA), %xmm0
  661. shufps $0x50, %xmm0, %xmm0
  662. mulps %xmm1, %xmm0
  663. subps %xmm0, %xmm2
  664. movss 0 * SIZE(AA), %xmm0
  665. shufps $0x00, %xmm6, %xmm0
  666. mulps %xmm0, %xmm2
  667. #endif
  668. #ifdef LT
  669. movss 0 * SIZE(AA), %xmm0
  670. shufps $0x00, %xmm6, %xmm0
  671. mulps %xmm0, %xmm2
  672. movaps %xmm2, %xmm1
  673. shufps $0x44, %xmm1, %xmm1
  674. movss 1 * SIZE(AA), %xmm0
  675. shufps $0x05, %xmm0, %xmm0
  676. mulps %xmm1, %xmm0
  677. subps %xmm0, %xmm2
  678. movss 3 * SIZE(AA), %xmm0
  679. movaps %xmm6, %xmm1
  680. shufps $0x00, %xmm0, %xmm1
  681. mulps %xmm1, %xmm2
  682. #endif
  683. #ifdef RN
  684. movss 0 * SIZE(B), %xmm6
  685. shufps $0x00, %xmm6, %xmm6
  686. mulps %xmm6, %xmm0
  687. movss 1 * SIZE(B), %xmm6
  688. shufps $0x00, %xmm6, %xmm6
  689. movaps %xmm6, %xmm5
  690. mulps %xmm0, %xmm5
  691. subps %xmm5, %xmm2
  692. movss 3 * SIZE(B), %xmm6
  693. shufps $0x00, %xmm6, %xmm6
  694. mulps %xmm6, %xmm2
  695. #endif
  696. #ifdef RT
  697. movss 3 * SIZE(B), %xmm6
  698. shufps $0x00, %xmm6, %xmm6
  699. mulps %xmm6, %xmm2
  700. movss 2 * SIZE(B), %xmm6
  701. shufps $0x00, %xmm6, %xmm6
  702. movaps %xmm6, %xmm5
  703. mulps %xmm2, %xmm5
  704. subps %xmm5, %xmm0
  705. movss 0 * SIZE(B), %xmm6
  706. shufps $0x00, %xmm6, %xmm6
  707. mulps %xmm6, %xmm0
  708. #endif
  709. #if defined(LN) || defined(LT)
  710. movsd %xmm2, 0 * SIZE(B)
  711. movhps %xmm2, 2 * SIZE(B)
  712. #ifdef HAVE_SSE2
  713. pshufd $0x00, %xmm2, %xmm0
  714. pshufd $0x55, %xmm2, %xmm1
  715. pshufd $0xaa, %xmm2, %xmm4
  716. pshufd $0xff, %xmm2, %xmm6
  717. #else
  718. movaps %xmm2, %xmm0
  719. shufps $0x00, %xmm0, %xmm0
  720. movaps %xmm2, %xmm1
  721. shufps $0x55, %xmm1, %xmm1
  722. movaps %xmm2, %xmm4
  723. shufps $0xaa, %xmm4, %xmm4
  724. movaps %xmm2, %xmm6
  725. shufps $0xff, %xmm6, %xmm6
  726. #endif
  727. movaps %xmm0, 0 * SIZE(BB)
  728. movaps %xmm1, 4 * SIZE(BB)
  729. movaps %xmm4, 8 * SIZE(BB)
  730. movaps %xmm6, 12 * SIZE(BB)
  731. #else
  732. movlps %xmm0, 0 * SIZE(AA)
  733. movlps %xmm2, 2 * SIZE(AA)
  734. #endif
  735. #ifdef LN
  736. subl $2 * SIZE, CO1
  737. #endif
  738. #if defined(LN) || defined(LT)
  739. movaps %xmm2, %xmm0
  740. shufps $0x88, %xmm3, %xmm2
  741. shufps $0xdd, %xmm3, %xmm0
  742. movlps %xmm2, 0 * SIZE(CO1)
  743. movlps %xmm0, 0 * SIZE(CO1, LDC)
  744. #else
  745. movlps %xmm0, 0 * SIZE(CO1)
  746. movlps %xmm2, 0 * SIZE(CO1, LDC)
  747. #endif
  748. #ifndef LN
  749. addl $2 * SIZE, CO1
  750. #endif
  751. #if defined(LT) || defined(RN)
  752. movl K, %eax
  753. subl KK, %eax
  754. leal (,%eax, SIZE), %eax
  755. leal (AA, %eax, 2), AA
  756. #ifdef LT
  757. addl $4 * SIZE, B
  758. #endif
  759. #endif
  760. #ifdef LN
  761. subl $2, KK
  762. movl BORIG, B
  763. #endif
  764. #ifdef LT
  765. addl $2, KK
  766. #endif
  767. #ifdef RT
  768. movl K, %eax
  769. movl BORIG, B
  770. sall $1 + BASE_SHIFT, %eax
  771. addl %eax, AORIG
  772. #endif
  773. ALIGN_2
  774. .L50:
  775. testl $4, M
  776. jle .L70
  777. #ifdef LN
  778. movl K, %eax
  779. sall $2 + BASE_SHIFT, %eax
  780. subl %eax, AORIG
  781. #endif
  782. #if defined(LN) || defined(RT)
  783. movl KK, %eax
  784. movl AORIG, AA
  785. sall $2 + BASE_SHIFT, %eax
  786. addl %eax, AA
  787. #endif
  788. leal BUFFER, BB
  789. #if defined(LN) || defined(RT)
  790. movl KK, %eax
  791. sall $1 + BASE_SHIFT, %eax
  792. leal (BB, %eax, 4), BB
  793. #endif
  794. movaps 0 * SIZE(BB), %xmm2
  795. xorps %xmm4, %xmm4
  796. movaps 0 * SIZE(AA), %xmm0
  797. xorps %xmm5, %xmm5
  798. movaps 16 * SIZE(BB), %xmm3
  799. xorps %xmm6, %xmm6
  800. movaps 16 * SIZE(AA), %xmm1
  801. xorps %xmm7, %xmm7
  802. #if defined(LT) || defined(RN)
  803. movl KK, %eax
  804. #else
  805. movl K, %eax
  806. subl KK, %eax
  807. #endif
  808. sarl $3, %eax
  809. je .L32
  810. ALIGN_2
  811. .L31:
  812. mulps %xmm0, %xmm2
  813. mulps 4 * SIZE(BB), %xmm0
  814. addps %xmm2, %xmm4
  815. movaps 8 * SIZE(BB), %xmm2
  816. addps %xmm0, %xmm5
  817. movaps 4 * SIZE(AA), %xmm0
  818. mulps %xmm0, %xmm2
  819. mulps 12 * SIZE(BB), %xmm0
  820. addps %xmm2, %xmm6
  821. movaps 32 * SIZE(BB), %xmm2
  822. addps %xmm0, %xmm7
  823. movaps 8 * SIZE(AA), %xmm0
  824. mulps %xmm0, %xmm3
  825. mulps 20 * SIZE(BB), %xmm0
  826. addps %xmm3, %xmm4
  827. movaps 24 * SIZE(BB), %xmm3
  828. addps %xmm0, %xmm5
  829. movaps 12 * SIZE(AA), %xmm0
  830. mulps %xmm0, %xmm3
  831. mulps 28 * SIZE(BB), %xmm0
  832. addps %xmm3, %xmm6
  833. movaps 48 * SIZE(BB), %xmm3
  834. addps %xmm0, %xmm7
  835. movaps 32 * SIZE(AA), %xmm0
  836. mulps %xmm1, %xmm2
  837. mulps 36 * SIZE(BB), %xmm1
  838. addps %xmm2, %xmm4
  839. movaps 40 * SIZE(BB), %xmm2
  840. addps %xmm1, %xmm5
  841. movaps 20 * SIZE(AA), %xmm1
  842. mulps %xmm1, %xmm2
  843. mulps 44 * SIZE(BB), %xmm1
  844. addps %xmm2, %xmm6
  845. movaps 64 * SIZE(BB), %xmm2
  846. addps %xmm1, %xmm7
  847. movaps 24 * SIZE(AA), %xmm1
  848. mulps %xmm1, %xmm3
  849. mulps 52 * SIZE(BB), %xmm1
  850. addps %xmm3, %xmm4
  851. movaps 56 * SIZE(BB), %xmm3
  852. addps %xmm1, %xmm5
  853. movaps 28 * SIZE(AA), %xmm1
  854. mulps %xmm1, %xmm3
  855. mulps 60 * SIZE(BB), %xmm1
  856. addps %xmm3, %xmm6
  857. movaps 80 * SIZE(BB), %xmm3
  858. addps %xmm1, %xmm7
  859. movaps 48 * SIZE(AA), %xmm1
  860. addl $32 * SIZE, AA
  861. addl $64 * SIZE, BB
  862. decl %eax
  863. jne .L31
  864. ALIGN_2
  865. .L32:
  866. #if defined(LT) || defined(RN)
  867. movl KK, %eax
  868. #else
  869. movl K, %eax
  870. subl KK, %eax
  871. #endif
  872. andl $7, %eax # if (k & 1)
  873. BRANCH
  874. je .L34
  875. .L33:
  876. mulps %xmm0, %xmm2
  877. mulps 4 * SIZE(BB), %xmm0
  878. addps %xmm2, %xmm4
  879. movaps 8 * SIZE(BB), %xmm2
  880. addps %xmm0, %xmm5
  881. movaps 4 * SIZE(AA), %xmm0
  882. addl $4 * SIZE, AA
  883. addl $8 * SIZE, BB
  884. decl %eax
  885. jg .L33
  886. ALIGN_4
  887. .L34:
  888. addps %xmm6, %xmm4
  889. addps %xmm7, %xmm5
  890. #if defined(LN) || defined(RT)
  891. movl KK, %eax
  892. #ifdef LN
  893. subl $4, %eax
  894. #else
  895. subl $2, %eax
  896. #endif
  897. movl AORIG, AA
  898. movl BORIG, B
  899. leal BUFFER, BB
  900. sall $BASE_SHIFT, %eax
  901. leal (AA, %eax, 4), AA
  902. leal (B, %eax, 2), B
  903. leal (BB, %eax, 8), BB
  904. #endif
  905. #if defined(LN) || defined(LT)
  906. movaps %xmm4, %xmm0
  907. unpcklps %xmm5, %xmm4
  908. unpckhps %xmm5, %xmm0
  909. movsd 0 * SIZE(B), %xmm2
  910. movhps 2 * SIZE(B), %xmm2
  911. movsd 4 * SIZE(B), %xmm3
  912. movhps 6 * SIZE(B), %xmm3
  913. subps %xmm4, %xmm2
  914. subps %xmm0, %xmm3
  915. #else
  916. movaps 0 * SIZE(AA), %xmm0
  917. movaps 4 * SIZE(AA), %xmm2
  918. subps %xmm4, %xmm0
  919. subps %xmm5, %xmm2
  920. #endif
  921. #if defined(LN) || defined(LT)
  922. movaps TRMASK, %xmm6
  923. #endif
  924. #ifdef LN
  925. movss 15 * SIZE(AA), %xmm0
  926. movaps %xmm6, %xmm1
  927. shufps $0x00, %xmm0, %xmm1
  928. mulps %xmm1, %xmm3
  929. movaps %xmm3, %xmm1
  930. shufps $0xee, %xmm1, %xmm1
  931. movss 14 * SIZE(AA), %xmm0
  932. shufps $0x50, %xmm0, %xmm0
  933. mulps %xmm1, %xmm0
  934. subps %xmm0, %xmm3
  935. movsd 12 * SIZE(AA), %xmm0
  936. shufps $0x50, %xmm0, %xmm0
  937. mulps %xmm1, %xmm0
  938. subps %xmm0, %xmm2
  939. movss 10 * SIZE(AA), %xmm0
  940. shufps $0x00, %xmm6, %xmm0
  941. mulps %xmm0, %xmm3
  942. movaps %xmm3, %xmm1
  943. shufps $0x44, %xmm1, %xmm1
  944. movsd 8 * SIZE(AA), %xmm0
  945. shufps $0x50, %xmm0, %xmm0
  946. mulps %xmm1, %xmm0
  947. subps %xmm0, %xmm2
  948. movss 5 * SIZE(AA), %xmm0
  949. movaps %xmm6, %xmm1
  950. shufps $0x00, %xmm0, %xmm1
  951. mulps %xmm1, %xmm2
  952. movaps %xmm2, %xmm1
  953. shufps $0xee, %xmm1, %xmm1
  954. movss 4 * SIZE(AA), %xmm0
  955. shufps $0x50, %xmm0, %xmm0
  956. mulps %xmm1, %xmm0
  957. subps %xmm0, %xmm2
  958. movss 0 * SIZE(AA), %xmm0
  959. shufps $0x00, %xmm6, %xmm0
  960. mulps %xmm0, %xmm2
  961. #endif
  962. #ifdef LT
  963. movss 0 * SIZE(AA), %xmm0
  964. shufps $0x00, %xmm6, %xmm0
  965. mulps %xmm0, %xmm2
  966. movaps %xmm2, %xmm1
  967. shufps $0x44, %xmm1, %xmm1
  968. movss 1 * SIZE(AA), %xmm0
  969. shufps $0x05, %xmm0, %xmm0
  970. mulps %xmm1, %xmm0
  971. subps %xmm0, %xmm2
  972. movsd 2 * SIZE(AA), %xmm0
  973. shufps $0x50, %xmm0, %xmm0
  974. mulps %xmm1, %xmm0
  975. subps %xmm0, %xmm3
  976. movss 5 * SIZE(AA), %xmm0
  977. movaps %xmm6, %xmm1
  978. shufps $0x00, %xmm0, %xmm1
  979. mulps %xmm1, %xmm2
  980. movaps %xmm2, %xmm1
  981. shufps $0xee, %xmm1, %xmm1
  982. movsd 6 * SIZE(AA), %xmm0
  983. shufps $0x50, %xmm0, %xmm0
  984. mulps %xmm1, %xmm0
  985. subps %xmm0, %xmm3
  986. movss 10 * SIZE(AA), %xmm0
  987. shufps $0x00, %xmm6, %xmm0
  988. mulps %xmm0, %xmm3
  989. movaps %xmm3, %xmm1
  990. shufps $0x44, %xmm1, %xmm1
  991. movss 11 * SIZE(AA), %xmm0
  992. shufps $0x05, %xmm0, %xmm0
  993. mulps %xmm1, %xmm0
  994. subps %xmm0, %xmm3
  995. movss 15 * SIZE(AA), %xmm0
  996. movaps %xmm6, %xmm1
  997. shufps $0x00, %xmm0, %xmm1
  998. mulps %xmm1, %xmm3
  999. #endif
  1000. #ifdef RN
  1001. movss 0 * SIZE(B), %xmm6
  1002. shufps $0x00, %xmm6, %xmm6
  1003. mulps %xmm6, %xmm0
  1004. movss 1 * SIZE(B), %xmm6
  1005. shufps $0x00, %xmm6, %xmm6
  1006. movaps %xmm6, %xmm5
  1007. mulps %xmm0, %xmm5
  1008. subps %xmm5, %xmm2
  1009. movss 3 * SIZE(B), %xmm6
  1010. shufps $0x00, %xmm6, %xmm6
  1011. mulps %xmm6, %xmm2
  1012. #endif
  1013. #ifdef RT
  1014. movss 3 * SIZE(B), %xmm6
  1015. shufps $0x00, %xmm6, %xmm6
  1016. mulps %xmm6, %xmm2
  1017. movss 2 * SIZE(B), %xmm6
  1018. shufps $0x00, %xmm6, %xmm6
  1019. movaps %xmm6, %xmm5
  1020. mulps %xmm2, %xmm5
  1021. subps %xmm5, %xmm0
  1022. movss 0 * SIZE(B), %xmm6
  1023. shufps $0x00, %xmm6, %xmm6
  1024. mulps %xmm6, %xmm0
  1025. #endif
  1026. #if defined(LN) || defined(LT)
  1027. movlps %xmm2, 0 * SIZE(B)
  1028. movhps %xmm2, 2 * SIZE(B)
  1029. movlps %xmm3, 4 * SIZE(B)
  1030. movhps %xmm3, 6 * SIZE(B)
  1031. #ifdef HAVE_SSE2
  1032. pshufd $0x00, %xmm2, %xmm0
  1033. pshufd $0x55, %xmm2, %xmm1
  1034. pshufd $0xaa, %xmm2, %xmm4
  1035. pshufd $0xff, %xmm2, %xmm6
  1036. #else
  1037. movaps %xmm2, %xmm0
  1038. shufps $0x00, %xmm0, %xmm0
  1039. movaps %xmm2, %xmm1
  1040. shufps $0x55, %xmm1, %xmm1
  1041. movaps %xmm2, %xmm4
  1042. shufps $0xaa, %xmm4, %xmm4
  1043. movaps %xmm2, %xmm6
  1044. shufps $0xff, %xmm6, %xmm6
  1045. #endif
  1046. movaps %xmm0, 0 * SIZE(BB)
  1047. movaps %xmm1, 4 * SIZE(BB)
  1048. movaps %xmm4, 8 * SIZE(BB)
  1049. movaps %xmm6, 12 * SIZE(BB)
  1050. #ifdef HAVE_SSE2
  1051. pshufd $0x00, %xmm3, %xmm0
  1052. pshufd $0x55, %xmm3, %xmm1
  1053. pshufd $0xaa, %xmm3, %xmm4
  1054. pshufd $0xff, %xmm3, %xmm6
  1055. #else
  1056. movaps %xmm3, %xmm0
  1057. shufps $0x00, %xmm0, %xmm0
  1058. movaps %xmm3, %xmm1
  1059. shufps $0x55, %xmm1, %xmm1
  1060. movaps %xmm3, %xmm4
  1061. shufps $0xaa, %xmm4, %xmm4
  1062. movaps %xmm3, %xmm6
  1063. shufps $0xff, %xmm6, %xmm6
  1064. #endif
  1065. movaps %xmm0, 16 * SIZE(BB)
  1066. movaps %xmm1, 20 * SIZE(BB)
  1067. movaps %xmm4, 24 * SIZE(BB)
  1068. movaps %xmm6, 28 * SIZE(BB)
  1069. #else
  1070. movaps %xmm0, 0 * SIZE(AA)
  1071. movaps %xmm2, 4 * SIZE(AA)
  1072. #endif
  1073. #ifdef LN
  1074. subl $4 * SIZE, CO1
  1075. #endif
  1076. #if defined(LN) || defined(LT)
  1077. movaps %xmm2, %xmm0
  1078. shufps $0x88, %xmm3, %xmm2
  1079. shufps $0xdd, %xmm3, %xmm0
  1080. movlps %xmm2, 0 * SIZE(CO1)
  1081. movhps %xmm2, 2 * SIZE(CO1)
  1082. movlps %xmm0, 0 * SIZE(CO1, LDC)
  1083. movhps %xmm0, 2 * SIZE(CO1, LDC)
  1084. #else
  1085. movlps %xmm0, 0 * SIZE(CO1)
  1086. movhps %xmm0, 2 * SIZE(CO1)
  1087. movlps %xmm2, 0 * SIZE(CO1, LDC)
  1088. movhps %xmm2, 2 * SIZE(CO1, LDC)
  1089. #endif
  1090. #ifndef LN
  1091. addl $4 * SIZE, CO1
  1092. #endif
  1093. #if defined(LT) || defined(RN)
  1094. movl K, %eax
  1095. subl KK, %eax
  1096. leal (,%eax, SIZE), %eax
  1097. leal (AA, %eax, 4), AA
  1098. #ifdef LT
  1099. addl $8 * SIZE, B
  1100. #endif
  1101. #endif
  1102. #ifdef LN
  1103. subl $4, KK
  1104. movl BORIG, B
  1105. #endif
  1106. #ifdef LT
  1107. addl $4, KK
  1108. #endif
  1109. #ifdef RT
  1110. movl K, %eax
  1111. movl BORIG, B
  1112. sall $2 + BASE_SHIFT, %eax
  1113. addl %eax, AORIG
  1114. #endif
  1115. ALIGN_2
  1116. .L70:
  1117. movl M, %ebx
  1118. sarl $3, %ebx
  1119. jle .L99
  1120. ALIGN_4
  1121. .L10:
  1122. #ifdef LN
  1123. movl K, %eax
  1124. sall $3 + BASE_SHIFT, %eax
  1125. subl %eax, AORIG
  1126. #endif
  1127. #if defined(LN) || defined(RT)
  1128. movl KK, %eax
  1129. movl AORIG, AA
  1130. sall $3 + BASE_SHIFT, %eax
  1131. addl %eax, AA
  1132. #endif
  1133. leal BUFFER, BB
  1134. #if defined(LN) || defined(RT)
  1135. movl KK, %eax
  1136. sall $1 + BASE_SHIFT, %eax
  1137. leal (BB, %eax, 4), BB
  1138. #endif
  1139. movaps 0 * SIZE(BB), %xmm2
  1140. xorps %xmm4, %xmm4
  1141. movaps 0 * SIZE(AA), %xmm0
  1142. xorps %xmm5, %xmm5
  1143. movaps 8 * SIZE(BB), %xmm3
  1144. xorps %xmm6, %xmm6
  1145. movaps 8 * SIZE(AA), %xmm1
  1146. xorps %xmm7, %xmm7
  1147. PREFETCHW 7 * SIZE(CO1)
  1148. PREFETCHW 7 * SIZE(CO1, LDC)
  1149. #if defined(LT) || defined(RN)
  1150. movl KK, %eax
  1151. #else
  1152. movl K, %eax
  1153. subl KK, %eax
  1154. #endif
  1155. sarl $3, %eax
  1156. je .L12
  1157. ALIGN_2
  1158. .L11:
  1159. mulps %xmm0, %xmm2
  1160. mulps 4 * SIZE(BB), %xmm0
  1161. addps %xmm2, %xmm4
  1162. movaps 0 * SIZE(BB), %xmm2
  1163. addps %xmm0, %xmm5
  1164. movaps 4 * SIZE(AA), %xmm0
  1165. mulps %xmm0, %xmm2
  1166. mulps 4 * SIZE(BB), %xmm0
  1167. addps %xmm2, %xmm6
  1168. movaps 16 * SIZE(BB), %xmm2
  1169. addps %xmm0, %xmm7
  1170. movaps 16 * SIZE(AA), %xmm0
  1171. mulps %xmm1, %xmm3
  1172. mulps 12 * SIZE(BB), %xmm1
  1173. addps %xmm3, %xmm4
  1174. movaps 8 * SIZE(BB), %xmm3
  1175. addps %xmm1, %xmm5
  1176. movaps 12 * SIZE(AA), %xmm1
  1177. mulps %xmm1, %xmm3
  1178. mulps 12 * SIZE(BB), %xmm1
  1179. addps %xmm3, %xmm6
  1180. movaps 24 * SIZE(BB), %xmm3
  1181. addps %xmm1, %xmm7
  1182. movaps 24 * SIZE(AA), %xmm1
  1183. mulps %xmm0, %xmm2
  1184. mulps 20 * SIZE(BB), %xmm0
  1185. addps %xmm2, %xmm4
  1186. movaps 16 * SIZE(BB), %xmm2
  1187. addps %xmm0, %xmm5
  1188. movaps 20 * SIZE(AA), %xmm0
  1189. mulps %xmm0, %xmm2
  1190. mulps 20 * SIZE(BB), %xmm0
  1191. addps %xmm2, %xmm6
  1192. movaps 32 * SIZE(BB), %xmm2
  1193. addps %xmm0, %xmm7
  1194. movaps 32 * SIZE(AA), %xmm0
  1195. mulps %xmm1, %xmm3
  1196. mulps 28 * SIZE(BB), %xmm1
  1197. addps %xmm3, %xmm4
  1198. movaps 24 * SIZE(BB), %xmm3
  1199. addps %xmm1, %xmm5
  1200. movaps 28 * SIZE(AA), %xmm1
  1201. mulps %xmm1, %xmm3
  1202. mulps 28 * SIZE(BB), %xmm1
  1203. addps %xmm3, %xmm6
  1204. movaps 40 * SIZE(BB), %xmm3
  1205. addps %xmm1, %xmm7
  1206. movaps 40 * SIZE(AA), %xmm1
  1207. mulps %xmm0, %xmm2
  1208. mulps 36 * SIZE(BB), %xmm0
  1209. addps %xmm2, %xmm4
  1210. movaps 32 * SIZE(BB), %xmm2
  1211. addps %xmm0, %xmm5
  1212. movaps 36 * SIZE(AA), %xmm0
  1213. mulps %xmm0, %xmm2
  1214. mulps 36 * SIZE(BB), %xmm0
  1215. addps %xmm2, %xmm6
  1216. movaps 48 * SIZE(BB), %xmm2
  1217. addps %xmm0, %xmm7
  1218. movaps 48 * SIZE(AA), %xmm0
  1219. mulps %xmm1, %xmm3
  1220. mulps 44 * SIZE(BB), %xmm1
  1221. addps %xmm3, %xmm4
  1222. movaps 40 * SIZE(BB), %xmm3
  1223. addps %xmm1, %xmm5
  1224. movaps 44 * SIZE(AA), %xmm1
  1225. mulps %xmm1, %xmm3
  1226. mulps 44 * SIZE(BB), %xmm1
  1227. addps %xmm3, %xmm6
  1228. movaps 56 * SIZE(BB), %xmm3
  1229. addps %xmm1, %xmm7
  1230. movaps 56 * SIZE(AA), %xmm1
  1231. mulps %xmm0, %xmm2
  1232. mulps 52 * SIZE(BB), %xmm0
  1233. addps %xmm2, %xmm4
  1234. movaps 48 * SIZE(BB), %xmm2
  1235. addps %xmm0, %xmm5
  1236. movaps 52 * SIZE(AA), %xmm0
  1237. mulps %xmm0, %xmm2
  1238. mulps 52 * SIZE(BB), %xmm0
  1239. addps %xmm2, %xmm6
  1240. movaps 64 * SIZE(BB), %xmm2
  1241. addps %xmm0, %xmm7
  1242. movaps 64 * SIZE(AA), %xmm0
  1243. mulps %xmm1, %xmm3
  1244. mulps 60 * SIZE(BB), %xmm1
  1245. addps %xmm3, %xmm4
  1246. movaps 56 * SIZE(BB), %xmm3
  1247. addps %xmm1, %xmm5
  1248. movaps 60 * SIZE(AA), %xmm1
  1249. mulps %xmm1, %xmm3
  1250. mulps 60 * SIZE(BB), %xmm1
  1251. addps %xmm3, %xmm6
  1252. movaps 72 * SIZE(BB), %xmm3
  1253. addps %xmm1, %xmm7
  1254. movaps 72 * SIZE(AA), %xmm1
  1255. addl $64 * SIZE, BB
  1256. addl $64 * SIZE, AA
  1257. decl %eax
  1258. jne .L11
  1259. ALIGN_2
  1260. .L12:
  1261. #if defined(LT) || defined(RN)
  1262. movl KK, %eax
  1263. #else
  1264. movl K, %eax
  1265. subl KK, %eax
  1266. #endif
  1267. andl $7, %eax # if (k & 1)
  1268. BRANCH
  1269. je .L14
  1270. .L13:
  1271. movaps 4 * SIZE(BB), %xmm1
  1272. mulps %xmm0, %xmm2
  1273. addps %xmm2, %xmm4
  1274. movaps 0 * SIZE(BB), %xmm2
  1275. mulps %xmm0, %xmm1
  1276. movaps 4 * SIZE(AA), %xmm0
  1277. addps %xmm1, %xmm5
  1278. movaps 4 * SIZE(BB), %xmm1
  1279. mulps %xmm0, %xmm2
  1280. addps %xmm2, %xmm6
  1281. movaps 8 * SIZE(BB), %xmm2
  1282. mulps %xmm0, %xmm1
  1283. movaps 8 * SIZE(AA), %xmm0
  1284. addps %xmm1, %xmm7
  1285. addl $8 * SIZE, AA
  1286. addl $8 * SIZE, BB
  1287. subl $1, %eax
  1288. jg .L13
  1289. ALIGN_4
  1290. .L14:
  1291. #if defined(LN) || defined(RT)
  1292. movl KK, %eax
  1293. #ifdef LN
  1294. subl $8, %eax
  1295. #else
  1296. subl $2, %eax
  1297. #endif
  1298. movl AORIG, AA
  1299. movl BORIG, B
  1300. leal BUFFER, BB
  1301. sall $BASE_SHIFT, %eax
  1302. leal (AA, %eax, 8), AA
  1303. leal (B, %eax, 2), B
  1304. leal (BB, %eax, 8), BB
  1305. #endif
  1306. #if defined(LN) || defined(LT)
  1307. movaps %xmm4, %xmm0
  1308. unpcklps %xmm5, %xmm4
  1309. unpckhps %xmm5, %xmm0
  1310. movaps %xmm6, %xmm1
  1311. unpcklps %xmm7, %xmm6
  1312. unpckhps %xmm7, %xmm1
  1313. movsd 0 * SIZE(B), %xmm2
  1314. movhps 2 * SIZE(B), %xmm2
  1315. movsd 4 * SIZE(B), %xmm3
  1316. movhps 6 * SIZE(B), %xmm3
  1317. movsd 8 * SIZE(B), %xmm5
  1318. movhps 10 * SIZE(B), %xmm5
  1319. movsd 12 * SIZE(B), %xmm7
  1320. movhps 14 * SIZE(B), %xmm7
  1321. subps %xmm4, %xmm2
  1322. subps %xmm0, %xmm3
  1323. subps %xmm6, %xmm5
  1324. subps %xmm1, %xmm7
  1325. #else
  1326. movaps 0 * SIZE(AA), %xmm0
  1327. movaps 4 * SIZE(AA), %xmm1
  1328. movaps 8 * SIZE(AA), %xmm2
  1329. movaps 12 * SIZE(AA), %xmm3
  1330. subps %xmm4, %xmm0
  1331. subps %xmm6, %xmm1
  1332. subps %xmm5, %xmm2
  1333. subps %xmm7, %xmm3
  1334. #endif
  1335. #if defined(LN) || defined(LT)
  1336. movaps TRMASK, %xmm6
  1337. #endif
  1338. #ifdef LN
  1339. movss 63 * SIZE(AA), %xmm0
  1340. movaps %xmm6, %xmm1
  1341. shufps $0x00, %xmm0, %xmm1
  1342. mulps %xmm1, %xmm7
  1343. movaps %xmm7, %xmm1
  1344. shufps $0xee, %xmm1, %xmm1
  1345. movss 62 * SIZE(AA), %xmm0
  1346. shufps $0x50, %xmm0, %xmm0
  1347. mulps %xmm1, %xmm0
  1348. subps %xmm0, %xmm7
  1349. movsd 60 * SIZE(AA), %xmm0
  1350. shufps $0x50, %xmm0, %xmm0
  1351. mulps %xmm1, %xmm0
  1352. subps %xmm0, %xmm5
  1353. movsd 58 * SIZE(AA), %xmm0
  1354. shufps $0x50, %xmm0, %xmm0
  1355. mulps %xmm1, %xmm0
  1356. subps %xmm0, %xmm3
  1357. movsd 56 * SIZE(AA), %xmm0
  1358. shufps $0x50, %xmm0, %xmm0
  1359. mulps %xmm1, %xmm0
  1360. subps %xmm0, %xmm2
  1361. movss 54 * SIZE(AA), %xmm0
  1362. shufps $0x00, %xmm6, %xmm0
  1363. mulps %xmm0, %xmm7
  1364. movaps %xmm7, %xmm1
  1365. shufps $0x44, %xmm1, %xmm1
  1366. movsd 52 * SIZE(AA), %xmm0
  1367. shufps $0x50, %xmm0, %xmm0
  1368. mulps %xmm1, %xmm0
  1369. subps %xmm0, %xmm5
  1370. movsd 50 * SIZE(AA), %xmm0
  1371. shufps $0x50, %xmm0, %xmm0
  1372. mulps %xmm1, %xmm0
  1373. subps %xmm0, %xmm3
  1374. movsd 48 * SIZE(AA), %xmm0
  1375. shufps $0x50, %xmm0, %xmm0
  1376. mulps %xmm1, %xmm0
  1377. subps %xmm0, %xmm2
  1378. movss 45 * SIZE(AA), %xmm0
  1379. movaps %xmm6, %xmm1
  1380. shufps $0x00, %xmm0, %xmm1
  1381. mulps %xmm1, %xmm5
  1382. movaps %xmm5, %xmm1
  1383. shufps $0xee, %xmm1, %xmm1
  1384. movss 44 * SIZE(AA), %xmm0
  1385. shufps $0x50, %xmm0, %xmm0
  1386. mulps %xmm1, %xmm0
  1387. subps %xmm0, %xmm5
  1388. movsd 42 * SIZE(AA), %xmm0
  1389. shufps $0x50, %xmm0, %xmm0
  1390. mulps %xmm1, %xmm0
  1391. subps %xmm0, %xmm3
  1392. movsd 40 * SIZE(AA), %xmm0
  1393. shufps $0x50, %xmm0, %xmm0
  1394. mulps %xmm1, %xmm0
  1395. subps %xmm0, %xmm2
  1396. movss 36 * SIZE(AA), %xmm0
  1397. shufps $0x00, %xmm6, %xmm0
  1398. mulps %xmm0, %xmm5
  1399. movaps %xmm5, %xmm1
  1400. shufps $0x44, %xmm1, %xmm1
  1401. movsd 34 * SIZE(AA), %xmm0
  1402. shufps $0x50, %xmm0, %xmm0
  1403. mulps %xmm1, %xmm0
  1404. subps %xmm0, %xmm3
  1405. movsd 32 * SIZE(AA), %xmm0
  1406. shufps $0x50, %xmm0, %xmm0
  1407. mulps %xmm1, %xmm0
  1408. subps %xmm0, %xmm2
  1409. movss 27 * SIZE(AA), %xmm0
  1410. movaps %xmm6, %xmm1
  1411. shufps $0x00, %xmm0, %xmm1
  1412. mulps %xmm1, %xmm3
  1413. movaps %xmm3, %xmm1
  1414. shufps $0xee, %xmm1, %xmm1
  1415. movss 26 * SIZE(AA), %xmm0
  1416. shufps $0x50, %xmm0, %xmm0
  1417. mulps %xmm1, %xmm0
  1418. subps %xmm0, %xmm3
  1419. movsd 24 * SIZE(AA), %xmm0
  1420. shufps $0x50, %xmm0, %xmm0
  1421. mulps %xmm1, %xmm0
  1422. subps %xmm0, %xmm2
  1423. movss 18 * SIZE(AA), %xmm0
  1424. shufps $0x00, %xmm6, %xmm0
  1425. mulps %xmm0, %xmm3
  1426. movaps %xmm3, %xmm1
  1427. shufps $0x44, %xmm1, %xmm1
  1428. movsd 16 * SIZE(AA), %xmm0
  1429. shufps $0x50, %xmm0, %xmm0
  1430. mulps %xmm1, %xmm0
  1431. subps %xmm0, %xmm2
  1432. movss 9 * SIZE(AA), %xmm0
  1433. movaps %xmm6, %xmm1
  1434. shufps $0x00, %xmm0, %xmm1
  1435. mulps %xmm1, %xmm2
  1436. movaps %xmm2, %xmm1
  1437. shufps $0xee, %xmm1, %xmm1
  1438. movss 8 * SIZE(AA), %xmm0
  1439. shufps $0x50, %xmm0, %xmm0
  1440. mulps %xmm1, %xmm0
  1441. subps %xmm0, %xmm2
  1442. movss 0 * SIZE(AA), %xmm0
  1443. shufps $0x00, %xmm6, %xmm0
  1444. mulps %xmm0, %xmm2
  1445. #endif
  1446. #ifdef LT
  1447. movss 0 * SIZE(AA), %xmm0
  1448. shufps $0x00, %xmm6, %xmm0
  1449. mulps %xmm0, %xmm2
  1450. movaps %xmm2, %xmm1
  1451. shufps $0x44, %xmm1, %xmm1
  1452. movss 1 * SIZE(AA), %xmm0
  1453. shufps $0x05, %xmm0, %xmm0
  1454. mulps %xmm1, %xmm0
  1455. subps %xmm0, %xmm2
  1456. movsd 2 * SIZE(AA), %xmm0
  1457. shufps $0x50, %xmm0, %xmm0
  1458. mulps %xmm1, %xmm0
  1459. subps %xmm0, %xmm3
  1460. movsd 4 * SIZE(AA), %xmm0
  1461. shufps $0x50, %xmm0, %xmm0
  1462. mulps %xmm1, %xmm0
  1463. subps %xmm0, %xmm5
  1464. movsd 6 * SIZE(AA), %xmm0
  1465. shufps $0x50, %xmm0, %xmm0
  1466. mulps %xmm1, %xmm0
  1467. subps %xmm0, %xmm7
  1468. movss 9 * SIZE(AA), %xmm0
  1469. movaps %xmm6, %xmm1
  1470. shufps $0x00, %xmm0, %xmm1
  1471. mulps %xmm1, %xmm2
  1472. movaps %xmm2, %xmm1
  1473. shufps $0xee, %xmm1, %xmm1
  1474. movsd 10 * SIZE(AA), %xmm0
  1475. shufps $0x50, %xmm0, %xmm0
  1476. mulps %xmm1, %xmm0
  1477. subps %xmm0, %xmm3
  1478. movsd 12 * SIZE(AA), %xmm0
  1479. shufps $0x50, %xmm0, %xmm0
  1480. mulps %xmm1, %xmm0
  1481. subps %xmm0, %xmm5
  1482. movsd 14 * SIZE(AA), %xmm0
  1483. shufps $0x50, %xmm0, %xmm0
  1484. mulps %xmm1, %xmm0
  1485. subps %xmm0, %xmm7
  1486. movss 18 * SIZE(AA), %xmm0
  1487. shufps $0x00, %xmm6, %xmm0
  1488. mulps %xmm0, %xmm3
  1489. movaps %xmm3, %xmm1
  1490. shufps $0x44, %xmm1, %xmm1
  1491. movss 19 * SIZE(AA), %xmm0
  1492. shufps $0x05, %xmm0, %xmm0
  1493. mulps %xmm1, %xmm0
  1494. subps %xmm0, %xmm3
  1495. movsd 20 * SIZE(AA), %xmm0
  1496. shufps $0x50, %xmm0, %xmm0
  1497. mulps %xmm1, %xmm0
  1498. subps %xmm0, %xmm5
  1499. movsd 22 * SIZE(AA), %xmm0
  1500. shufps $0x50, %xmm0, %xmm0
  1501. mulps %xmm1, %xmm0
  1502. subps %xmm0, %xmm7
  1503. movss 27 * SIZE(AA), %xmm0
  1504. movaps %xmm6, %xmm1
  1505. shufps $0x00, %xmm0, %xmm1
  1506. mulps %xmm1, %xmm3
  1507. movaps %xmm3, %xmm1
  1508. shufps $0xee, %xmm1, %xmm1
  1509. movsd 28 * SIZE(AA), %xmm0
  1510. shufps $0x50, %xmm0, %xmm0
  1511. mulps %xmm1, %xmm0
  1512. subps %xmm0, %xmm5
  1513. movsd 30 * SIZE(AA), %xmm0
  1514. shufps $0x50, %xmm0, %xmm0
  1515. mulps %xmm1, %xmm0
  1516. subps %xmm0, %xmm7
  1517. movss 36 * SIZE(AA), %xmm0
  1518. shufps $0x00, %xmm6, %xmm0
  1519. mulps %xmm0, %xmm5
  1520. movaps %xmm5, %xmm1
  1521. shufps $0x44, %xmm1, %xmm1
  1522. movss 37 * SIZE(AA), %xmm0
  1523. shufps $0x05, %xmm0, %xmm0
  1524. mulps %xmm1, %xmm0
  1525. subps %xmm0, %xmm5
  1526. movsd 38 * SIZE(AA), %xmm0
  1527. shufps $0x50, %xmm0, %xmm0
  1528. mulps %xmm1, %xmm0
  1529. subps %xmm0, %xmm7
  1530. movss 45 * SIZE(AA), %xmm0
  1531. movaps %xmm6, %xmm1
  1532. shufps $0x00, %xmm0, %xmm1
  1533. mulps %xmm1, %xmm5
  1534. movaps %xmm5, %xmm1
  1535. shufps $0xee, %xmm1, %xmm1
  1536. movsd 46 * SIZE(AA), %xmm0
  1537. shufps $0x50, %xmm0, %xmm0
  1538. mulps %xmm1, %xmm0
  1539. subps %xmm0, %xmm7
  1540. movss 54 * SIZE(AA), %xmm0
  1541. shufps $0x00, %xmm6, %xmm0
  1542. mulps %xmm0, %xmm7
  1543. movaps %xmm7, %xmm1
  1544. shufps $0x44, %xmm1, %xmm1
  1545. movss 55 * SIZE(AA), %xmm0
  1546. shufps $0x05, %xmm0, %xmm0
  1547. mulps %xmm1, %xmm0
  1548. subps %xmm0, %xmm7
  1549. movss 63 * SIZE(AA), %xmm0
  1550. movaps %xmm6, %xmm1
  1551. shufps $0x00, %xmm0, %xmm1
  1552. mulps %xmm1, %xmm7
  1553. #endif
  1554. #ifdef RN
  1555. movss 0 * SIZE(B), %xmm6
  1556. shufps $0x00, %xmm6, %xmm6
  1557. mulps %xmm6, %xmm0
  1558. mulps %xmm6, %xmm1
  1559. movss 1 * SIZE(B), %xmm6
  1560. shufps $0x00, %xmm6, %xmm6
  1561. movaps %xmm6, %xmm5
  1562. mulps %xmm0, %xmm5
  1563. mulps %xmm1, %xmm6
  1564. subps %xmm5, %xmm2
  1565. subps %xmm6, %xmm3
  1566. movss 3 * SIZE(B), %xmm6
  1567. shufps $0x00, %xmm6, %xmm6
  1568. mulps %xmm6, %xmm2
  1569. mulps %xmm6, %xmm3
  1570. #endif
  1571. #ifdef RT
  1572. movss 3 * SIZE(B), %xmm6
  1573. shufps $0x00, %xmm6, %xmm6
  1574. mulps %xmm6, %xmm2
  1575. mulps %xmm6, %xmm3
  1576. movss 2 * SIZE(B), %xmm6
  1577. shufps $0x00, %xmm6, %xmm6
  1578. movaps %xmm6, %xmm5
  1579. mulps %xmm2, %xmm5
  1580. mulps %xmm3, %xmm6
  1581. subps %xmm5, %xmm0
  1582. subps %xmm6, %xmm1
  1583. movss 0 * SIZE(B), %xmm6
  1584. shufps $0x00, %xmm6, %xmm6
  1585. mulps %xmm6, %xmm0
  1586. mulps %xmm6, %xmm1
  1587. #endif
  1588. #if defined(LN) || defined(LT)
  1589. movlps %xmm2, 0 * SIZE(B)
  1590. movhps %xmm2, 2 * SIZE(B)
  1591. movlps %xmm3, 4 * SIZE(B)
  1592. movhps %xmm3, 6 * SIZE(B)
  1593. movlps %xmm5, 8 * SIZE(B)
  1594. movhps %xmm5, 10 * SIZE(B)
  1595. movlps %xmm7, 12 * SIZE(B)
  1596. movhps %xmm7, 14 * SIZE(B)
  1597. #ifdef HAVE_SSE2
  1598. pshufd $0x00, %xmm2, %xmm0
  1599. pshufd $0x55, %xmm2, %xmm1
  1600. pshufd $0xaa, %xmm2, %xmm4
  1601. pshufd $0xff, %xmm2, %xmm6
  1602. #else
  1603. movaps %xmm2, %xmm0
  1604. shufps $0x00, %xmm0, %xmm0
  1605. movaps %xmm2, %xmm1
  1606. shufps $0x55, %xmm1, %xmm1
  1607. movaps %xmm2, %xmm4
  1608. shufps $0xaa, %xmm4, %xmm4
  1609. movaps %xmm2, %xmm6
  1610. shufps $0xff, %xmm6, %xmm6
  1611. #endif
  1612. movaps %xmm0, 0 * SIZE(BB)
  1613. movaps %xmm1, 4 * SIZE(BB)
  1614. movaps %xmm4, 8 * SIZE(BB)
  1615. movaps %xmm6, 12 * SIZE(BB)
  1616. #ifdef HAVE_SSE2
  1617. pshufd $0x00, %xmm3, %xmm0
  1618. pshufd $0x55, %xmm3, %xmm1
  1619. pshufd $0xaa, %xmm3, %xmm4
  1620. pshufd $0xff, %xmm3, %xmm6
  1621. #else
  1622. movaps %xmm3, %xmm0
  1623. shufps $0x00, %xmm0, %xmm0
  1624. movaps %xmm3, %xmm1
  1625. shufps $0x55, %xmm1, %xmm1
  1626. movaps %xmm3, %xmm4
  1627. shufps $0xaa, %xmm4, %xmm4
  1628. movaps %xmm3, %xmm6
  1629. shufps $0xff, %xmm6, %xmm6
  1630. #endif
  1631. movaps %xmm0, 16 * SIZE(BB)
  1632. movaps %xmm1, 20 * SIZE(BB)
  1633. movaps %xmm4, 24 * SIZE(BB)
  1634. movaps %xmm6, 28 * SIZE(BB)
  1635. #ifdef HAVE_SSE2
  1636. pshufd $0x00, %xmm5, %xmm0
  1637. pshufd $0x55, %xmm5, %xmm1
  1638. pshufd $0xaa, %xmm5, %xmm4
  1639. pshufd $0xff, %xmm5, %xmm6
  1640. #else
  1641. movaps %xmm5, %xmm0
  1642. shufps $0x00, %xmm0, %xmm0
  1643. movaps %xmm5, %xmm1
  1644. shufps $0x55, %xmm1, %xmm1
  1645. movaps %xmm5, %xmm4
  1646. shufps $0xaa, %xmm4, %xmm4
  1647. movaps %xmm5, %xmm6
  1648. shufps $0xff, %xmm6, %xmm6
  1649. #endif
  1650. movaps %xmm0, 32 * SIZE(BB)
  1651. movaps %xmm1, 36 * SIZE(BB)
  1652. movaps %xmm4, 40 * SIZE(BB)
  1653. movaps %xmm6, 44 * SIZE(BB)
  1654. #ifdef HAVE_SSE2
  1655. pshufd $0x00, %xmm7, %xmm0
  1656. pshufd $0x55, %xmm7, %xmm1
  1657. pshufd $0xaa, %xmm7, %xmm4
  1658. pshufd $0xff, %xmm7, %xmm6
  1659. #else
  1660. movaps %xmm7, %xmm0
  1661. shufps $0x00, %xmm0, %xmm0
  1662. movaps %xmm7, %xmm1
  1663. shufps $0x55, %xmm1, %xmm1
  1664. movaps %xmm7, %xmm4
  1665. shufps $0xaa, %xmm4, %xmm4
  1666. movaps %xmm7, %xmm6
  1667. shufps $0xff, %xmm6, %xmm6
  1668. #endif
  1669. movaps %xmm0, 48 * SIZE(BB)
  1670. movaps %xmm1, 52 * SIZE(BB)
  1671. movaps %xmm4, 56 * SIZE(BB)
  1672. movaps %xmm6, 60 * SIZE(BB)
  1673. #else
  1674. movaps %xmm0, 0 * SIZE(AA)
  1675. movaps %xmm1, 4 * SIZE(AA)
  1676. movaps %xmm2, 8 * SIZE(AA)
  1677. movaps %xmm3, 12 * SIZE(AA)
  1678. #endif
  1679. #ifdef LN
  1680. subl $8 * SIZE, CO1
  1681. #endif
  1682. #if defined(LN) || defined(LT)
  1683. movaps %xmm2, %xmm0
  1684. shufps $0x88, %xmm3, %xmm2
  1685. shufps $0xdd, %xmm3, %xmm0
  1686. movaps %xmm5, %xmm4
  1687. shufps $0x88, %xmm7, %xmm5
  1688. shufps $0xdd, %xmm7, %xmm4
  1689. movlps %xmm2, 0 * SIZE(CO1)
  1690. movhps %xmm2, 2 * SIZE(CO1)
  1691. movlps %xmm5, 4 * SIZE(CO1)
  1692. movhps %xmm5, 6 * SIZE(CO1)
  1693. movlps %xmm0, 0 * SIZE(CO1, LDC)
  1694. movhps %xmm0, 2 * SIZE(CO1, LDC)
  1695. movlps %xmm4, 4 * SIZE(CO1, LDC)
  1696. movhps %xmm4, 6 * SIZE(CO1, LDC)
  1697. #else
  1698. movlps %xmm0, 0 * SIZE(CO1)
  1699. movhps %xmm0, 2 * SIZE(CO1)
  1700. movlps %xmm1, 4 * SIZE(CO1)
  1701. movhps %xmm1, 6 * SIZE(CO1)
  1702. movlps %xmm2, 0 * SIZE(CO1, LDC)
  1703. movhps %xmm2, 2 * SIZE(CO1, LDC)
  1704. movlps %xmm3, 4 * SIZE(CO1, LDC)
  1705. movhps %xmm3, 6 * SIZE(CO1, LDC)
  1706. #endif
  1707. #ifndef LN
  1708. addl $8 * SIZE, CO1
  1709. #endif
  1710. #if defined(LT) || defined(RN)
  1711. movl K, %eax
  1712. subl KK, %eax
  1713. leal (,%eax, SIZE), %eax
  1714. leal (AA, %eax, 8), AA
  1715. #ifdef LT
  1716. addl $16 * SIZE, B
  1717. #endif
  1718. #endif
  1719. #ifdef LN
  1720. subl $8, KK
  1721. movl BORIG, B
  1722. #endif
  1723. #ifdef LT
  1724. addl $8, KK
  1725. #endif
  1726. #ifdef RT
  1727. movl K, %eax
  1728. movl BORIG, B
  1729. sall $3 + BASE_SHIFT, %eax
  1730. addl %eax, AORIG
  1731. #endif
  1732. decl %ebx # i --
  1733. jg .L10
  1734. ALIGN_2
  1735. .L99:
  1736. #ifdef LN
  1737. movl K, %eax
  1738. leal (, %eax, SIZE), %eax
  1739. leal (B, %eax, 2), B
  1740. #endif
  1741. #if defined(LT) || defined(RN)
  1742. movl K, %eax
  1743. subl KK, %eax
  1744. leal (,%eax, SIZE), %eax
  1745. leal (B, %eax, 2), B
  1746. #endif
  1747. #ifdef RN
  1748. addl $2, KK
  1749. #endif
  1750. #ifdef RT
  1751. subl $2, KK
  1752. #endif
  1753. decl J # j --
  1754. jg .L01
  1755. ALIGN_2
  1756. .L100:
  1757. testl $1, N
  1758. jle .L999
  1759. #ifdef LN
  1760. movl OFFSET, %eax
  1761. addl M, %eax
  1762. movl %eax, KK
  1763. #endif
  1764. leal BUFFER, BB
  1765. #ifdef RT
  1766. movl K, %eax
  1767. sall $BASE_SHIFT, %eax
  1768. subl %eax, B
  1769. #endif
  1770. #if defined(LN) || defined(RT)
  1771. movl KK, %eax
  1772. movl B, BORIG
  1773. sall $BASE_SHIFT, %eax
  1774. leal (B, %eax, 1), B
  1775. leal (BB, %eax, 4), BB
  1776. #endif
  1777. #ifdef LT
  1778. movl OFFSET, %eax
  1779. movl %eax, KK
  1780. #endif
  1781. #if defined(LT) || defined(RN)
  1782. movl KK, %eax
  1783. #else
  1784. movl K, %eax
  1785. subl KK, %eax
  1786. #endif
  1787. sarl $3, %eax
  1788. jle .L103
  1789. ALIGN_4
  1790. .L102:
  1791. movsd 0 * SIZE(B), %xmm3
  1792. movhps 2 * SIZE(B), %xmm3
  1793. movsd 4 * SIZE(B), %xmm7
  1794. movhps 6 * SIZE(B), %xmm7
  1795. #ifdef HAVE_SSE2
  1796. pshufd $0x00, %xmm3, %xmm0
  1797. pshufd $0x55, %xmm3, %xmm1
  1798. pshufd $0xaa, %xmm3, %xmm2
  1799. pshufd $0xff, %xmm3, %xmm3
  1800. pshufd $0x00, %xmm7, %xmm4
  1801. pshufd $0x55, %xmm7, %xmm5
  1802. pshufd $0xaa, %xmm7, %xmm6
  1803. pshufd $0xff, %xmm7, %xmm7
  1804. #else
  1805. movaps %xmm3, %xmm0
  1806. shufps $0x00, %xmm0, %xmm0
  1807. movaps %xmm3, %xmm1
  1808. shufps $0x55, %xmm1, %xmm1
  1809. movaps %xmm3, %xmm2
  1810. shufps $0xaa, %xmm2, %xmm2
  1811. shufps $0xff, %xmm3, %xmm3
  1812. movaps %xmm7, %xmm4
  1813. shufps $0x00, %xmm4, %xmm4
  1814. movaps %xmm7, %xmm5
  1815. shufps $0x55, %xmm5, %xmm5
  1816. movaps %xmm7, %xmm6
  1817. shufps $0xaa, %xmm6, %xmm6
  1818. shufps $0xff, %xmm7, %xmm7
  1819. #endif
  1820. movaps %xmm0, 0 * SIZE(BB)
  1821. movaps %xmm1, 4 * SIZE(BB)
  1822. movaps %xmm2, 8 * SIZE(BB)
  1823. movaps %xmm3, 12 * SIZE(BB)
  1824. movaps %xmm4, 16 * SIZE(BB)
  1825. movaps %xmm5, 20 * SIZE(BB)
  1826. movaps %xmm6, 24 * SIZE(BB)
  1827. movaps %xmm7, 28 * SIZE(BB)
  1828. addl $ 8 * SIZE, B
  1829. addl $32 * SIZE, BB
  1830. decl %eax
  1831. BRANCH
  1832. jne .L102
  1833. ALIGN_2
  1834. .L103:
  1835. #if defined(LT) || defined(RN)
  1836. movl KK, %eax
  1837. #else
  1838. movl K, %eax
  1839. subl KK, %eax
  1840. #endif
  1841. andl $7, %eax
  1842. BRANCH
  1843. jle .L105
  1844. ALIGN_2
  1845. .L104:
  1846. movss 0 * SIZE(B), %xmm0
  1847. shufps $0x00, %xmm0, %xmm0
  1848. movaps %xmm0, 0 * SIZE(BB)
  1849. addl $1 * SIZE, B
  1850. addl $4 * SIZE, BB
  1851. decl %eax
  1852. jne .L104
  1853. ALIGN_4
  1854. .L105:
  1855. #if defined(LT) || defined(RN)
  1856. movl A, AA
  1857. #else
  1858. movl A, %eax
  1859. movl %eax, AORIG
  1860. #endif
  1861. #ifdef RT
  1862. subl LDC, C
  1863. #endif
  1864. movl C, CO1
  1865. #ifndef RT
  1866. addl LDC, C
  1867. #endif
  1868. testl $1, M
  1869. jle .L130
  1870. #ifdef LN
  1871. movl K, %eax
  1872. sall $BASE_SHIFT, %eax
  1873. subl %eax, AORIG
  1874. #endif
  1875. #if defined(LN) || defined(RT)
  1876. movl KK, %eax
  1877. movl AORIG, AA
  1878. leal (AA, %eax, SIZE), AA
  1879. #endif
  1880. leal BUFFER, BB
  1881. #if defined(LN) || defined(RT)
  1882. movl KK, %eax
  1883. sall $BASE_SHIFT, %eax
  1884. leal (BB, %eax, 4), BB
  1885. #endif
  1886. movss 0 * SIZE(BB), %xmm2
  1887. xorps %xmm4, %xmm4
  1888. movss 0 * SIZE(AA), %xmm0
  1889. xorps %xmm5, %xmm5
  1890. movss 16 * SIZE(BB), %xmm3
  1891. xorps %xmm6, %xmm6
  1892. movss 4 * SIZE(AA), %xmm1
  1893. xorps %xmm7, %xmm7
  1894. #if defined(LT) || defined(RN)
  1895. movl KK, %eax
  1896. #else
  1897. movl K, %eax
  1898. subl KK, %eax
  1899. #endif
  1900. sarl $3, %eax
  1901. je .L172
  1902. ALIGN_2
  1903. .L171:
  1904. mulss %xmm0, %xmm2
  1905. movss 1 * SIZE(AA), %xmm0
  1906. addss %xmm2, %xmm4
  1907. mulss 4 * SIZE(BB), %xmm0
  1908. movss 32 * SIZE(BB), %xmm2
  1909. addss %xmm0, %xmm5
  1910. movss 2 * SIZE(AA), %xmm0
  1911. mulss 8 * SIZE(BB), %xmm0
  1912. addss %xmm0, %xmm6
  1913. movss 3 * SIZE(AA), %xmm0
  1914. mulss 12 * SIZE(BB), %xmm0
  1915. addss %xmm0, %xmm7
  1916. movss 8 * SIZE(AA), %xmm0
  1917. mulss %xmm1, %xmm3
  1918. movss 5 * SIZE(AA), %xmm1
  1919. addss %xmm3, %xmm4
  1920. mulss 20 * SIZE(BB), %xmm1
  1921. movss 48 * SIZE(BB), %xmm3
  1922. addss %xmm1, %xmm5
  1923. movss 6 * SIZE(AA), %xmm1
  1924. mulss 24 * SIZE(BB), %xmm1
  1925. addss %xmm1, %xmm6
  1926. movss 7 * SIZE(AA), %xmm1
  1927. mulss 28 * SIZE(BB), %xmm1
  1928. addss %xmm1, %xmm7
  1929. movss 12 * SIZE(AA), %xmm1
  1930. addl $ 8 * SIZE, AA
  1931. addl $32 * SIZE, BB
  1932. decl %eax
  1933. jne .L171
  1934. ALIGN_2
  1935. .L172:
  1936. #if defined(LT) || defined(RN)
  1937. movl KK, %eax
  1938. #else
  1939. movl K, %eax
  1940. subl KK, %eax
  1941. #endif
  1942. andl $7, %eax # if (k & 1)
  1943. BRANCH
  1944. je .L174
  1945. .L173:
  1946. movss 0 * SIZE(AA), %xmm0
  1947. movss 0 * SIZE(BB), %xmm2
  1948. mulss %xmm0, %xmm2
  1949. addss %xmm2, %xmm4
  1950. addl $1 * SIZE, AA
  1951. addl $4 * SIZE, BB
  1952. decl %eax
  1953. jg .L173
  1954. ALIGN_4
  1955. .L174:
  1956. addss %xmm5, %xmm4
  1957. addss %xmm7, %xmm6
  1958. addss %xmm6, %xmm4
  1959. #if defined(LN) || defined(RT)
  1960. movl KK, %eax
  1961. subl $1, %eax
  1962. movl AORIG, AA
  1963. movl BORIG, B
  1964. leal BUFFER, BB
  1965. sall $ BASE_SHIFT, %eax
  1966. leal (AA, %eax, 1), AA
  1967. leal (B, %eax, 1), B
  1968. leal (BB, %eax, 4), BB
  1969. #endif
  1970. #if defined(LN) || defined(LT)
  1971. movss 0 * SIZE(B), %xmm1
  1972. subss %xmm4, %xmm1
  1973. #else
  1974. movss 0 * SIZE(AA), %xmm0
  1975. subss %xmm4, %xmm0
  1976. #endif
  1977. #if defined(LN) || defined(LT)
  1978. mulss 0 * SIZE(AA), %xmm1
  1979. #endif
  1980. #if defined(RN) || defined(RT)
  1981. mulss 0 * SIZE(B), %xmm0
  1982. #endif
  1983. #if defined(LN) || defined(LT)
  1984. movss %xmm1, 0 * SIZE(B)
  1985. shufps $0x00, %xmm1, %xmm1
  1986. movaps %xmm1, 0 * SIZE(BB)
  1987. #else
  1988. movss %xmm0, 0 * SIZE(AA)
  1989. #endif
  1990. #ifdef LN
  1991. subl $1 * SIZE, CO1
  1992. #endif
  1993. #if defined(LN) || defined(LT)
  1994. movss %xmm1, 0 * SIZE(CO1)
  1995. #else
  1996. movss %xmm0, 0 * SIZE(CO1)
  1997. #endif
  1998. #ifndef LN
  1999. addl $1 * SIZE, CO1
  2000. #endif
  2001. #if defined(LT) || defined(RN)
  2002. movl K, %eax
  2003. subl KK, %eax
  2004. leal (AA, %eax, SIZE), AA
  2005. #ifdef LT
  2006. addl $1 * SIZE, B
  2007. #endif
  2008. #endif
  2009. #ifdef LN
  2010. subl $1, KK
  2011. movl BORIG, B
  2012. #endif
  2013. #ifdef LT
  2014. addl $1, KK
  2015. #endif
  2016. #ifdef RT
  2017. movl K, %eax
  2018. movl BORIG, B
  2019. sall $BASE_SHIFT, %eax
  2020. addl %eax, AORIG
  2021. #endif
  2022. ALIGN_2
  2023. .L130:
  2024. testl $2, M
  2025. jle .L150
  2026. #ifdef LN
  2027. movl K, %eax
  2028. sall $1 + BASE_SHIFT, %eax
  2029. subl %eax, AORIG
  2030. #endif
  2031. #if defined(LN) || defined(RT)
  2032. movl KK, %eax
  2033. movl AORIG, AA
  2034. sall $1 + BASE_SHIFT, %eax
  2035. addl %eax, AA
  2036. #endif
  2037. leal BUFFER, BB
  2038. #if defined(LN) || defined(RT)
  2039. movl KK, %eax
  2040. sall $BASE_SHIFT, %eax
  2041. leal (BB, %eax, 4), BB
  2042. #endif
  2043. movaps 0 * SIZE(BB), %xmm2
  2044. xorps %xmm4, %xmm4
  2045. #ifdef movsd
  2046. xorps %xmm0, %xmm0
  2047. #endif
  2048. movsd 0 * SIZE(AA), %xmm0
  2049. xorps %xmm5, %xmm5
  2050. movaps 16 * SIZE(BB), %xmm3
  2051. xorps %xmm6, %xmm6
  2052. #ifdef movsd
  2053. xorps %xmm1, %xmm1
  2054. #endif
  2055. movsd 8 * SIZE(AA), %xmm1
  2056. xorps %xmm7, %xmm7
  2057. #if defined(LT) || defined(RN)
  2058. movl KK, %eax
  2059. #else
  2060. movl K, %eax
  2061. subl KK, %eax
  2062. #endif
  2063. sarl $3, %eax
  2064. je .L152
  2065. ALIGN_2
  2066. .L151:
  2067. mulps %xmm0, %xmm2
  2068. movsd 2 * SIZE(AA), %xmm0
  2069. addps %xmm2, %xmm4
  2070. movaps 4 * SIZE(BB), %xmm2
  2071. mulps %xmm0, %xmm2
  2072. movsd 4 * SIZE(AA), %xmm0
  2073. addps %xmm2, %xmm5
  2074. movaps 8 * SIZE(BB), %xmm2
  2075. mulps %xmm0, %xmm2
  2076. movsd 6 * SIZE(AA), %xmm0
  2077. addps %xmm2, %xmm6
  2078. movaps 12 * SIZE(BB), %xmm2
  2079. mulps %xmm0, %xmm2
  2080. movsd 16 * SIZE(AA), %xmm0
  2081. addps %xmm2, %xmm7
  2082. movaps 32 * SIZE(BB), %xmm2
  2083. mulps %xmm1, %xmm3
  2084. movsd 10 * SIZE(AA), %xmm1
  2085. addps %xmm3, %xmm4
  2086. movaps 20 * SIZE(BB), %xmm3
  2087. mulps %xmm1, %xmm3
  2088. movsd 12 * SIZE(AA), %xmm1
  2089. addps %xmm3, %xmm5
  2090. movaps 24 * SIZE(BB), %xmm3
  2091. mulps %xmm1, %xmm3
  2092. movsd 14 * SIZE(AA), %xmm1
  2093. addps %xmm3, %xmm6
  2094. movaps 28 * SIZE(BB), %xmm3
  2095. mulps %xmm1, %xmm3
  2096. movsd 24 * SIZE(AA), %xmm1
  2097. addps %xmm3, %xmm7
  2098. movaps 48 * SIZE(BB), %xmm3
  2099. addl $16 * SIZE, AA
  2100. addl $32 * SIZE, BB
  2101. decl %eax
  2102. jne .L151
  2103. ALIGN_2
  2104. .L152:
  2105. #if defined(LT) || defined(RN)
  2106. movl KK, %eax
  2107. #else
  2108. movl K, %eax
  2109. subl KK, %eax
  2110. #endif
  2111. andl $7, %eax # if (k & 1)
  2112. BRANCH
  2113. je .L154
  2114. .L153:
  2115. mulps %xmm0, %xmm2
  2116. movsd 2 * SIZE(AA), %xmm0
  2117. addps %xmm2, %xmm4
  2118. movaps 4 * SIZE(BB), %xmm2
  2119. addl $2 * SIZE, AA
  2120. addl $4 * SIZE, BB
  2121. decl %eax
  2122. jg .L153
  2123. ALIGN_4
  2124. .L154:
  2125. addps %xmm5, %xmm4
  2126. addps %xmm7, %xmm6
  2127. addps %xmm6, %xmm4
  2128. #if defined(LN) || defined(RT)
  2129. movl KK, %eax
  2130. #ifdef LN
  2131. subl $2, %eax
  2132. #else
  2133. subl $1, %eax
  2134. #endif
  2135. movl AORIG, AA
  2136. movl BORIG, B
  2137. leal BUFFER, BB
  2138. sall $BASE_SHIFT, %eax
  2139. leal (AA, %eax, 2), AA
  2140. leal (B, %eax, 1), B
  2141. leal (BB, %eax, 4), BB
  2142. #endif
  2143. #if defined(LN) || defined(LT)
  2144. movaps %xmm4, %xmm5
  2145. shufps $1, %xmm5, %xmm5
  2146. movss 0 * SIZE(B), %xmm0
  2147. movss 1 * SIZE(B), %xmm1
  2148. subss %xmm4, %xmm0
  2149. subss %xmm5, %xmm1
  2150. #else
  2151. #ifdef movsd
  2152. xorps %xmm0, %xmm0
  2153. #endif
  2154. movsd 0 * SIZE(AA), %xmm0
  2155. subps %xmm4, %xmm0
  2156. #endif
  2157. #ifdef LN
  2158. movaps 0 * SIZE(AA), %xmm4
  2159. movaps %xmm4, %xmm6
  2160. shufps $0xff, %xmm6, %xmm6
  2161. mulss %xmm6, %xmm1
  2162. movaps %xmm4, %xmm6
  2163. shufps $0xaa, %xmm6, %xmm6
  2164. mulss %xmm1, %xmm6
  2165. subss %xmm6, %xmm0
  2166. mulss %xmm4, %xmm0
  2167. #endif
  2168. #ifdef LT
  2169. movaps 0 * SIZE(AA), %xmm4
  2170. mulss %xmm4, %xmm0
  2171. movaps %xmm4, %xmm6
  2172. shufps $0x55, %xmm6, %xmm6
  2173. mulss %xmm0, %xmm6
  2174. subss %xmm6, %xmm1
  2175. movaps %xmm4, %xmm6
  2176. shufps $0xff, %xmm6, %xmm6
  2177. mulss %xmm6, %xmm1
  2178. #endif
  2179. #ifdef RN
  2180. movss 0 * SIZE(B), %xmm6
  2181. shufps $0x00, %xmm6, %xmm6
  2182. mulps %xmm6, %xmm0
  2183. #endif
  2184. #ifdef RT
  2185. movss 0 * SIZE(B), %xmm6
  2186. shufps $0x00, %xmm6, %xmm6
  2187. mulps %xmm6, %xmm0
  2188. #endif
  2189. #if defined(LN) || defined(LT)
  2190. movss %xmm0, 0 * SIZE(B)
  2191. movss %xmm1, 1 * SIZE(B)
  2192. shufps $0x00, %xmm0, %xmm0
  2193. shufps $0x00, %xmm1, %xmm1
  2194. movaps %xmm0, 0 * SIZE(BB)
  2195. movaps %xmm1, 4 * SIZE(BB)
  2196. #else
  2197. movlps %xmm0, 0 * SIZE(AA)
  2198. #endif
  2199. #ifdef LN
  2200. subl $2 * SIZE, CO1
  2201. #endif
  2202. #if defined(LN) || defined(LT)
  2203. movss %xmm0, 0 * SIZE(CO1)
  2204. movss %xmm1, 1 * SIZE(CO1)
  2205. #else
  2206. movlps %xmm0, 0 * SIZE(CO1)
  2207. #endif
  2208. #ifndef LN
  2209. addl $2 * SIZE, CO1
  2210. #endif
  2211. #if defined(LT) || defined(RN)
  2212. movl K, %eax
  2213. subl KK, %eax
  2214. leal (,%eax, SIZE), %eax
  2215. leal (AA, %eax, 2), AA
  2216. #ifdef LT
  2217. addl $2 * SIZE, B
  2218. #endif
  2219. #endif
  2220. #ifdef LN
  2221. subl $2, KK
  2222. movl BORIG, B
  2223. #endif
  2224. #ifdef LT
  2225. addl $2, KK
  2226. #endif
  2227. #ifdef RT
  2228. movl K, %eax
  2229. movl BORIG, B
  2230. sall $1 + BASE_SHIFT, %eax
  2231. addl %eax, AORIG
  2232. #endif
  2233. ALIGN_2
  2234. .L150:
  2235. testl $4, M
  2236. jle .L170
  2237. #ifdef LN
  2238. movl K, %eax
  2239. sall $2 + BASE_SHIFT, %eax
  2240. subl %eax, AORIG
  2241. #endif
  2242. #if defined(LN) || defined(RT)
  2243. movl KK, %eax
  2244. movl AORIG, AA
  2245. sall $2 + BASE_SHIFT, %eax
  2246. addl %eax, AA
  2247. #endif
  2248. leal BUFFER, BB
  2249. #if defined(LN) || defined(RT)
  2250. movl KK, %eax
  2251. sall $BASE_SHIFT, %eax
  2252. leal (BB, %eax, 4), BB
  2253. #endif
  2254. movaps 0 * SIZE(BB), %xmm2
  2255. xorps %xmm4, %xmm4
  2256. movsd 0 * SIZE(AA), %xmm0
  2257. movhps 2 * SIZE(AA), %xmm0
  2258. xorps %xmm5, %xmm5
  2259. movaps 16 * SIZE(BB), %xmm3
  2260. xorps %xmm6, %xmm6
  2261. movsd 16 * SIZE(AA), %xmm1
  2262. movhps 18 * SIZE(AA), %xmm1
  2263. xorps %xmm7, %xmm7
  2264. #if defined(LT) || defined(RN)
  2265. movl KK, %eax
  2266. #else
  2267. movl K, %eax
  2268. subl KK, %eax
  2269. #endif
  2270. sarl $3, %eax
  2271. je .L132
  2272. ALIGN_2
  2273. .L131:
  2274. mulps %xmm0, %xmm2
  2275. movaps 4 * SIZE(AA), %xmm0
  2276. addps %xmm2, %xmm4
  2277. mulps 4 * SIZE(BB), %xmm0
  2278. movaps 32 * SIZE(BB), %xmm2
  2279. addps %xmm0, %xmm5
  2280. movaps 8 * SIZE(AA), %xmm0
  2281. mulps 8 * SIZE(BB), %xmm0
  2282. addps %xmm0, %xmm6
  2283. movaps 12 * SIZE(AA), %xmm0
  2284. mulps 12 * SIZE(BB), %xmm0
  2285. addps %xmm0, %xmm7
  2286. movaps 32 * SIZE(AA), %xmm0
  2287. mulps %xmm1, %xmm3
  2288. movaps 20 * SIZE(AA), %xmm1
  2289. addps %xmm3, %xmm4
  2290. mulps 20 * SIZE(BB), %xmm1
  2291. movaps 48 * SIZE(BB), %xmm3
  2292. addps %xmm1, %xmm5
  2293. movaps 24 * SIZE(AA), %xmm1
  2294. mulps 24 * SIZE(BB), %xmm1
  2295. addps %xmm1, %xmm6
  2296. movaps 28 * SIZE(AA), %xmm1
  2297. mulps 28 * SIZE(BB), %xmm1
  2298. addps %xmm1, %xmm7
  2299. movaps 48 * SIZE(AA), %xmm1
  2300. addl $32 * SIZE, AA
  2301. addl $32 * SIZE, BB
  2302. decl %eax
  2303. jne .L131
  2304. ALIGN_2
  2305. .L132:
  2306. #if defined(LT) || defined(RN)
  2307. movl KK, %eax
  2308. #else
  2309. movl K, %eax
  2310. subl KK, %eax
  2311. #endif
  2312. andl $7, %eax # if (k & 1)
  2313. BRANCH
  2314. je .L134
  2315. .L133:
  2316. movaps 0 * SIZE(BB), %xmm2
  2317. movaps 0 * SIZE(AA), %xmm0
  2318. mulps %xmm0, %xmm2
  2319. addps %xmm2, %xmm4
  2320. addl $4 * SIZE, AA
  2321. addl $4 * SIZE, BB
  2322. decl %eax
  2323. jg .L133
  2324. ALIGN_4
  2325. .L134:
  2326. addps %xmm5, %xmm4
  2327. addps %xmm7, %xmm6
  2328. addps %xmm6, %xmm4
  2329. #if defined(LN) || defined(RT)
  2330. movl KK, %eax
  2331. #ifdef LN
  2332. subl $4, %eax
  2333. #else
  2334. subl $1, %eax
  2335. #endif
  2336. movl AORIG, AA
  2337. movl BORIG, B
  2338. leal BUFFER, BB
  2339. sall $BASE_SHIFT, %eax
  2340. leal (AA, %eax, 4), AA
  2341. leal (B, %eax, 1), B
  2342. leal (BB, %eax, 4), BB
  2343. #endif
  2344. #if defined(LN) || defined(LT)
  2345. movsd 0 * SIZE(B), %xmm2
  2346. movhps 2 * SIZE(B), %xmm2
  2347. subps %xmm4, %xmm2
  2348. xorps %xmm5, %xmm5
  2349. movaps %xmm2, %xmm3
  2350. unpcklps %xmm5, %xmm2
  2351. unpckhps %xmm5, %xmm3
  2352. #else
  2353. movaps 0 * SIZE(AA), %xmm0
  2354. subps %xmm4, %xmm0
  2355. #endif
  2356. #if defined(LN) || defined(LT)
  2357. movaps TRMASK, %xmm6
  2358. #endif
  2359. #ifdef LN
  2360. movss 15 * SIZE(AA), %xmm0
  2361. movaps %xmm6, %xmm1
  2362. shufps $0x00, %xmm0, %xmm1
  2363. mulps %xmm1, %xmm3
  2364. movaps %xmm3, %xmm1
  2365. shufps $0xee, %xmm1, %xmm1
  2366. movss 14 * SIZE(AA), %xmm0
  2367. shufps $0x50, %xmm0, %xmm0
  2368. mulps %xmm1, %xmm0
  2369. subps %xmm0, %xmm3
  2370. movsd 12 * SIZE(AA), %xmm0
  2371. shufps $0x50, %xmm0, %xmm0
  2372. mulps %xmm1, %xmm0
  2373. subps %xmm0, %xmm2
  2374. movss 10 * SIZE(AA), %xmm0
  2375. shufps $0x00, %xmm6, %xmm0
  2376. mulps %xmm0, %xmm3
  2377. movaps %xmm3, %xmm1
  2378. shufps $0x44, %xmm1, %xmm1
  2379. movsd 8 * SIZE(AA), %xmm0
  2380. shufps $0x50, %xmm0, %xmm0
  2381. mulps %xmm1, %xmm0
  2382. subps %xmm0, %xmm2
  2383. movss 5 * SIZE(AA), %xmm0
  2384. movaps %xmm6, %xmm1
  2385. shufps $0x00, %xmm0, %xmm1
  2386. mulps %xmm1, %xmm2
  2387. movaps %xmm2, %xmm1
  2388. shufps $0xee, %xmm1, %xmm1
  2389. movss 4 * SIZE(AA), %xmm0
  2390. shufps $0x50, %xmm0, %xmm0
  2391. mulps %xmm1, %xmm0
  2392. subps %xmm0, %xmm2
  2393. movss 0 * SIZE(AA), %xmm0
  2394. shufps $0x00, %xmm6, %xmm0
  2395. mulps %xmm0, %xmm2
  2396. #endif
  2397. #ifdef LT
  2398. movss 0 * SIZE(AA), %xmm0
  2399. shufps $0x00, %xmm6, %xmm0
  2400. mulps %xmm0, %xmm2
  2401. movaps %xmm2, %xmm1
  2402. shufps $0x44, %xmm1, %xmm1
  2403. movss 1 * SIZE(AA), %xmm0
  2404. shufps $0x05, %xmm0, %xmm0
  2405. mulps %xmm1, %xmm0
  2406. subps %xmm0, %xmm2
  2407. movsd 2 * SIZE(AA), %xmm0
  2408. shufps $0x50, %xmm0, %xmm0
  2409. mulps %xmm1, %xmm0
  2410. subps %xmm0, %xmm3
  2411. movss 5 * SIZE(AA), %xmm0
  2412. movaps %xmm6, %xmm1
  2413. shufps $0x00, %xmm0, %xmm1
  2414. mulps %xmm1, %xmm2
  2415. movaps %xmm2, %xmm1
  2416. shufps $0xee, %xmm1, %xmm1
  2417. movsd 6 * SIZE(AA), %xmm0
  2418. shufps $0x50, %xmm0, %xmm0
  2419. mulps %xmm1, %xmm0
  2420. subps %xmm0, %xmm3
  2421. movss 10 * SIZE(AA), %xmm0
  2422. shufps $0x00, %xmm6, %xmm0
  2423. mulps %xmm0, %xmm3
  2424. movaps %xmm3, %xmm1
  2425. shufps $0x44, %xmm1, %xmm1
  2426. movss 11 * SIZE(AA), %xmm0
  2427. shufps $0x05, %xmm0, %xmm0
  2428. mulps %xmm1, %xmm0
  2429. subps %xmm0, %xmm3
  2430. movss 15 * SIZE(AA), %xmm0
  2431. movaps %xmm6, %xmm1
  2432. shufps $0x00, %xmm0, %xmm1
  2433. mulps %xmm1, %xmm3
  2434. #endif
  2435. #ifdef RN
  2436. movss 0 * SIZE(B), %xmm6
  2437. shufps $0x00, %xmm6, %xmm6
  2438. mulps %xmm6, %xmm0
  2439. #endif
  2440. #ifdef RT
  2441. movss 0 * SIZE(B), %xmm6
  2442. shufps $0x00, %xmm6, %xmm6
  2443. mulps %xmm6, %xmm0
  2444. #endif
  2445. #if defined(LN) || defined(LT)
  2446. shufps $0x88, %xmm3, %xmm2
  2447. movlps %xmm2, 0 * SIZE(B)
  2448. movhps %xmm2, 2 * SIZE(B)
  2449. #ifdef HAVE_SSE2
  2450. pshufd $0x00, %xmm2, %xmm0
  2451. pshufd $0x55, %xmm2, %xmm1
  2452. pshufd $0xaa, %xmm2, %xmm4
  2453. pshufd $0xff, %xmm2, %xmm6
  2454. #else
  2455. movaps %xmm2, %xmm0
  2456. shufps $0x00, %xmm0, %xmm0
  2457. movaps %xmm2, %xmm1
  2458. shufps $0x55, %xmm1, %xmm1
  2459. movaps %xmm2, %xmm4
  2460. shufps $0xaa, %xmm4, %xmm4
  2461. movaps %xmm2, %xmm6
  2462. shufps $0xff, %xmm6, %xmm6
  2463. #endif
  2464. movaps %xmm0, 0 * SIZE(BB)
  2465. movaps %xmm1, 4 * SIZE(BB)
  2466. movaps %xmm4, 8 * SIZE(BB)
  2467. movaps %xmm6, 12 * SIZE(BB)
  2468. #else
  2469. movaps %xmm0, 0 * SIZE(AA)
  2470. #endif
  2471. #ifdef LN
  2472. subl $4 * SIZE, CO1
  2473. #endif
  2474. #if defined(LN) || defined(LT)
  2475. movlps %xmm2, 0 * SIZE(CO1)
  2476. movhps %xmm2, 2 * SIZE(CO1)
  2477. #else
  2478. movlps %xmm0, 0 * SIZE(CO1)
  2479. movhps %xmm0, 2 * SIZE(CO1)
  2480. #endif
  2481. #ifndef LN
  2482. addl $4 * SIZE, CO1
  2483. #endif
  2484. #if defined(LT) || defined(RN)
  2485. movl K, %eax
  2486. subl KK, %eax
  2487. leal (,%eax, SIZE), %eax
  2488. leal (AA, %eax, 4), AA
  2489. #ifdef LT
  2490. addl $4 * SIZE, B
  2491. #endif
  2492. #endif
  2493. #ifdef LN
  2494. subl $4, KK
  2495. movl BORIG, B
  2496. #endif
  2497. #ifdef LT
  2498. addl $4, KK
  2499. #endif
  2500. #ifdef RT
  2501. movl K, %eax
  2502. movl BORIG, B
  2503. sall $2 + BASE_SHIFT, %eax
  2504. addl %eax, AORIG
  2505. #endif
  2506. ALIGN_2
  2507. .L170:
  2508. movl M, %ebx
  2509. sarl $3, %ebx # i = (m >> 2)
  2510. jle .L179
  2511. ALIGN_4
  2512. .L110:
  2513. #ifdef LN
  2514. movl K, %eax
  2515. sall $3 + BASE_SHIFT, %eax
  2516. subl %eax, AORIG
  2517. #endif
  2518. #if defined(LN) || defined(RT)
  2519. movl KK, %eax
  2520. movl AORIG, AA
  2521. sall $3 + BASE_SHIFT, %eax
  2522. addl %eax, AA
  2523. #endif
  2524. leal BUFFER, BB
  2525. #if defined(LN) || defined(RT)
  2526. movl KK, %eax
  2527. sall $BASE_SHIFT, %eax
  2528. leal (BB, %eax, 4), BB
  2529. #endif
  2530. movaps 0 * SIZE(BB), %xmm2
  2531. xorps %xmm4, %xmm4
  2532. movaps 0 * SIZE(AA), %xmm0
  2533. xorps %xmm5, %xmm5
  2534. movaps 16 * SIZE(BB), %xmm3
  2535. xorps %xmm6, %xmm6
  2536. movaps 16 * SIZE(AA), %xmm1
  2537. xorps %xmm7, %xmm7
  2538. PREFETCHW 7 * SIZE(CO1)
  2539. #if defined(LT) || defined(RN)
  2540. movl KK, %eax
  2541. #else
  2542. movl K, %eax
  2543. subl KK, %eax
  2544. #endif
  2545. sarl $3, %eax
  2546. je .L112
  2547. ALIGN_2
  2548. .L111:
  2549. mulps %xmm2, %xmm0
  2550. mulps 4 * SIZE(AA), %xmm2
  2551. addps %xmm0, %xmm4
  2552. movaps 8 * SIZE(AA), %xmm0
  2553. addps %xmm2, %xmm6
  2554. movaps 4 * SIZE(BB), %xmm2
  2555. mulps %xmm2, %xmm0
  2556. mulps 12 * SIZE(AA), %xmm2
  2557. addps %xmm0, %xmm5
  2558. movaps 32 * SIZE(AA), %xmm0
  2559. addps %xmm2, %xmm7
  2560. movaps 8 * SIZE(BB), %xmm2
  2561. mulps %xmm2, %xmm1
  2562. mulps 20 * SIZE(AA), %xmm2
  2563. addps %xmm1, %xmm4
  2564. movaps 24 * SIZE(AA), %xmm1
  2565. addps %xmm2, %xmm6
  2566. movaps 12 * SIZE(BB), %xmm2
  2567. mulps %xmm2, %xmm1
  2568. mulps 28 * SIZE(AA), %xmm2
  2569. addps %xmm1, %xmm5
  2570. movaps 48 * SIZE(AA), %xmm1
  2571. addps %xmm2, %xmm7
  2572. movaps 32 * SIZE(BB), %xmm2
  2573. mulps %xmm3, %xmm0
  2574. mulps 36 * SIZE(AA), %xmm3
  2575. addps %xmm0, %xmm4
  2576. movaps 40 * SIZE(AA), %xmm0
  2577. addps %xmm3, %xmm6
  2578. movaps 20 * SIZE(BB), %xmm3
  2579. mulps %xmm3, %xmm0
  2580. mulps 44 * SIZE(AA), %xmm3
  2581. addps %xmm0, %xmm5
  2582. movaps 64 * SIZE(AA), %xmm0
  2583. addps %xmm3, %xmm7
  2584. movaps 24 * SIZE(BB), %xmm3
  2585. mulps %xmm3, %xmm1
  2586. mulps 52 * SIZE(AA), %xmm3
  2587. addps %xmm1, %xmm4
  2588. movaps 56 * SIZE(AA), %xmm1
  2589. addps %xmm3, %xmm6
  2590. movaps 28 * SIZE(BB), %xmm3
  2591. mulps %xmm3, %xmm1
  2592. mulps 60 * SIZE(AA), %xmm3
  2593. addps %xmm1, %xmm5
  2594. movaps 80 * SIZE(AA), %xmm1
  2595. addps %xmm3, %xmm7
  2596. movaps 48 * SIZE(BB), %xmm3
  2597. addl $64 * SIZE, AA
  2598. addl $32 * SIZE, BB
  2599. decl %eax
  2600. jne .L111
  2601. ALIGN_2
  2602. .L112:
  2603. #if defined(LT) || defined(RN)
  2604. movl KK, %eax
  2605. #else
  2606. movl K, %eax
  2607. subl KK, %eax
  2608. #endif
  2609. andl $7, %eax # if (k & 1)
  2610. BRANCH
  2611. je .L114
  2612. .L113:
  2613. movaps 0 * SIZE(BB), %xmm2
  2614. movaps 0 * SIZE(AA), %xmm0
  2615. mulps %xmm2, %xmm0
  2616. addps %xmm0, %xmm4
  2617. mulps 4 * SIZE(AA), %xmm2
  2618. addps %xmm2, %xmm6
  2619. addl $8 * SIZE, AA
  2620. addl $4 * SIZE, BB
  2621. subl $1, %eax
  2622. jg .L113
  2623. ALIGN_4
  2624. .L114:
  2625. addps %xmm5, %xmm4
  2626. addps %xmm7, %xmm6
  2627. #if defined(LN) || defined(RT)
  2628. movl KK, %eax
  2629. #ifdef LN
  2630. subl $8, %eax
  2631. #else
  2632. subl $1, %eax
  2633. #endif
  2634. movl AORIG, AA
  2635. movl BORIG, B
  2636. leal BUFFER, BB
  2637. sall $BASE_SHIFT, %eax
  2638. leal (AA, %eax, 8), AA
  2639. leal (B, %eax, 1), B
  2640. leal (BB, %eax, 4), BB
  2641. #endif
  2642. #if defined(LN) || defined(LT)
  2643. movsd 0 * SIZE(B), %xmm2
  2644. movhps 2 * SIZE(B), %xmm2
  2645. movsd 4 * SIZE(B), %xmm5
  2646. movhps 6 * SIZE(B), %xmm5
  2647. subps %xmm4, %xmm2
  2648. subps %xmm6, %xmm5
  2649. xorps %xmm0, %xmm0
  2650. movaps %xmm2, %xmm3
  2651. unpcklps %xmm0, %xmm2
  2652. unpckhps %xmm0, %xmm3
  2653. movaps %xmm5, %xmm7
  2654. unpcklps %xmm0, %xmm5
  2655. unpckhps %xmm0, %xmm7
  2656. #else
  2657. movaps 0 * SIZE(AA), %xmm0
  2658. movaps 4 * SIZE(AA), %xmm1
  2659. subps %xmm4, %xmm0
  2660. subps %xmm6, %xmm1
  2661. #endif
  2662. #if defined(LN) || defined(LT)
  2663. movaps TRMASK, %xmm6
  2664. #endif
  2665. #ifdef LN
  2666. movss 63 * SIZE(AA), %xmm0
  2667. movaps %xmm6, %xmm1
  2668. shufps $0x00, %xmm0, %xmm1
  2669. mulps %xmm1, %xmm7
  2670. movaps %xmm7, %xmm1
  2671. shufps $0xee, %xmm1, %xmm1
  2672. movss 62 * SIZE(AA), %xmm0
  2673. shufps $0x50, %xmm0, %xmm0
  2674. mulps %xmm1, %xmm0
  2675. subps %xmm0, %xmm7
  2676. movsd 60 * SIZE(AA), %xmm0
  2677. shufps $0x50, %xmm0, %xmm0
  2678. mulps %xmm1, %xmm0
  2679. subps %xmm0, %xmm5
  2680. movsd 58 * SIZE(AA), %xmm0
  2681. shufps $0x50, %xmm0, %xmm0
  2682. mulps %xmm1, %xmm0
  2683. subps %xmm0, %xmm3
  2684. movsd 56 * SIZE(AA), %xmm0
  2685. shufps $0x50, %xmm0, %xmm0
  2686. mulps %xmm1, %xmm0
  2687. subps %xmm0, %xmm2
  2688. movss 54 * SIZE(AA), %xmm0
  2689. shufps $0x00, %xmm6, %xmm0
  2690. mulps %xmm0, %xmm7
  2691. movaps %xmm7, %xmm1
  2692. shufps $0x44, %xmm1, %xmm1
  2693. movsd 52 * SIZE(AA), %xmm0
  2694. shufps $0x50, %xmm0, %xmm0
  2695. mulps %xmm1, %xmm0
  2696. subps %xmm0, %xmm5
  2697. movsd 50 * SIZE(AA), %xmm0
  2698. shufps $0x50, %xmm0, %xmm0
  2699. mulps %xmm1, %xmm0
  2700. subps %xmm0, %xmm3
  2701. movsd 48 * SIZE(AA), %xmm0
  2702. shufps $0x50, %xmm0, %xmm0
  2703. mulps %xmm1, %xmm0
  2704. subps %xmm0, %xmm2
  2705. movss 45 * SIZE(AA), %xmm0
  2706. movaps %xmm6, %xmm1
  2707. shufps $0x00, %xmm0, %xmm1
  2708. mulps %xmm1, %xmm5
  2709. movaps %xmm5, %xmm1
  2710. shufps $0xee, %xmm1, %xmm1
  2711. movss 44 * SIZE(AA), %xmm0
  2712. shufps $0x50, %xmm0, %xmm0
  2713. mulps %xmm1, %xmm0
  2714. subps %xmm0, %xmm5
  2715. movsd 42 * SIZE(AA), %xmm0
  2716. shufps $0x50, %xmm0, %xmm0
  2717. mulps %xmm1, %xmm0
  2718. subps %xmm0, %xmm3
  2719. movsd 40 * SIZE(AA), %xmm0
  2720. shufps $0x50, %xmm0, %xmm0
  2721. mulps %xmm1, %xmm0
  2722. subps %xmm0, %xmm2
  2723. movss 36 * SIZE(AA), %xmm0
  2724. shufps $0x00, %xmm6, %xmm0
  2725. mulps %xmm0, %xmm5
  2726. movaps %xmm5, %xmm1
  2727. shufps $0x44, %xmm1, %xmm1
  2728. movsd 34 * SIZE(AA), %xmm0
  2729. shufps $0x50, %xmm0, %xmm0
  2730. mulps %xmm1, %xmm0
  2731. subps %xmm0, %xmm3
  2732. movsd 32 * SIZE(AA), %xmm0
  2733. shufps $0x50, %xmm0, %xmm0
  2734. mulps %xmm1, %xmm0
  2735. subps %xmm0, %xmm2
  2736. movss 27 * SIZE(AA), %xmm0
  2737. movaps %xmm6, %xmm1
  2738. shufps $0x00, %xmm0, %xmm1
  2739. mulps %xmm1, %xmm3
  2740. movaps %xmm3, %xmm1
  2741. shufps $0xee, %xmm1, %xmm1
  2742. movss 26 * SIZE(AA), %xmm0
  2743. shufps $0x50, %xmm0, %xmm0
  2744. mulps %xmm1, %xmm0
  2745. subps %xmm0, %xmm3
  2746. movsd 24 * SIZE(AA), %xmm0
  2747. shufps $0x50, %xmm0, %xmm0
  2748. mulps %xmm1, %xmm0
  2749. subps %xmm0, %xmm2
  2750. movss 18 * SIZE(AA), %xmm0
  2751. shufps $0x00, %xmm6, %xmm0
  2752. mulps %xmm0, %xmm3
  2753. movaps %xmm3, %xmm1
  2754. shufps $0x44, %xmm1, %xmm1
  2755. movsd 16 * SIZE(AA), %xmm0
  2756. shufps $0x50, %xmm0, %xmm0
  2757. mulps %xmm1, %xmm0
  2758. subps %xmm0, %xmm2
  2759. movss 9 * SIZE(AA), %xmm0
  2760. movaps %xmm6, %xmm1
  2761. shufps $0x00, %xmm0, %xmm1
  2762. mulps %xmm1, %xmm2
  2763. movaps %xmm2, %xmm1
  2764. shufps $0xee, %xmm1, %xmm1
  2765. movss 8 * SIZE(AA), %xmm0
  2766. shufps $0x50, %xmm0, %xmm0
  2767. mulps %xmm1, %xmm0
  2768. subps %xmm0, %xmm2
  2769. movss 0 * SIZE(AA), %xmm0
  2770. shufps $0x00, %xmm6, %xmm0
  2771. mulps %xmm0, %xmm2
  2772. #endif
  2773. #ifdef LT
  2774. movss 0 * SIZE(AA), %xmm0
  2775. shufps $0x00, %xmm6, %xmm0
  2776. mulps %xmm0, %xmm2
  2777. movaps %xmm2, %xmm1
  2778. shufps $0x44, %xmm1, %xmm1
  2779. movss 1 * SIZE(AA), %xmm0
  2780. shufps $0x05, %xmm0, %xmm0
  2781. mulps %xmm1, %xmm0
  2782. subps %xmm0, %xmm2
  2783. movsd 2 * SIZE(AA), %xmm0
  2784. shufps $0x50, %xmm0, %xmm0
  2785. mulps %xmm1, %xmm0
  2786. subps %xmm0, %xmm3
  2787. movsd 4 * SIZE(AA), %xmm0
  2788. shufps $0x50, %xmm0, %xmm0
  2789. mulps %xmm1, %xmm0
  2790. subps %xmm0, %xmm5
  2791. movsd 6 * SIZE(AA), %xmm0
  2792. shufps $0x50, %xmm0, %xmm0
  2793. mulps %xmm1, %xmm0
  2794. subps %xmm0, %xmm7
  2795. movss 9 * SIZE(AA), %xmm0
  2796. movaps %xmm6, %xmm1
  2797. shufps $0x00, %xmm0, %xmm1
  2798. mulps %xmm1, %xmm2
  2799. movaps %xmm2, %xmm1
  2800. shufps $0xee, %xmm1, %xmm1
  2801. movsd 10 * SIZE(AA), %xmm0
  2802. shufps $0x50, %xmm0, %xmm0
  2803. mulps %xmm1, %xmm0
  2804. subps %xmm0, %xmm3
  2805. movsd 12 * SIZE(AA), %xmm0
  2806. shufps $0x50, %xmm0, %xmm0
  2807. mulps %xmm1, %xmm0
  2808. subps %xmm0, %xmm5
  2809. movsd 14 * SIZE(AA), %xmm0
  2810. shufps $0x50, %xmm0, %xmm0
  2811. mulps %xmm1, %xmm0
  2812. subps %xmm0, %xmm7
  2813. movss 18 * SIZE(AA), %xmm0
  2814. shufps $0x00, %xmm6, %xmm0
  2815. mulps %xmm0, %xmm3
  2816. movaps %xmm3, %xmm1
  2817. shufps $0x44, %xmm1, %xmm1
  2818. movss 19 * SIZE(AA), %xmm0
  2819. shufps $0x05, %xmm0, %xmm0
  2820. mulps %xmm1, %xmm0
  2821. subps %xmm0, %xmm3
  2822. movsd 20 * SIZE(AA), %xmm0
  2823. shufps $0x50, %xmm0, %xmm0
  2824. mulps %xmm1, %xmm0
  2825. subps %xmm0, %xmm5
  2826. movsd 22 * SIZE(AA), %xmm0
  2827. shufps $0x50, %xmm0, %xmm0
  2828. mulps %xmm1, %xmm0
  2829. subps %xmm0, %xmm7
  2830. movss 27 * SIZE(AA), %xmm0
  2831. movaps %xmm6, %xmm1
  2832. shufps $0x00, %xmm0, %xmm1
  2833. mulps %xmm1, %xmm3
  2834. movaps %xmm3, %xmm1
  2835. shufps $0xee, %xmm1, %xmm1
  2836. movsd 28 * SIZE(AA), %xmm0
  2837. shufps $0x50, %xmm0, %xmm0
  2838. mulps %xmm1, %xmm0
  2839. subps %xmm0, %xmm5
  2840. movsd 30 * SIZE(AA), %xmm0
  2841. shufps $0x50, %xmm0, %xmm0
  2842. mulps %xmm1, %xmm0
  2843. subps %xmm0, %xmm7
  2844. movss 36 * SIZE(AA), %xmm0
  2845. shufps $0x00, %xmm6, %xmm0
  2846. mulps %xmm0, %xmm5
  2847. movaps %xmm5, %xmm1
  2848. shufps $0x44, %xmm1, %xmm1
  2849. movss 37 * SIZE(AA), %xmm0
  2850. shufps $0x05, %xmm0, %xmm0
  2851. mulps %xmm1, %xmm0
  2852. subps %xmm0, %xmm5
  2853. movsd 38 * SIZE(AA), %xmm0
  2854. shufps $0x50, %xmm0, %xmm0
  2855. mulps %xmm1, %xmm0
  2856. subps %xmm0, %xmm7
  2857. movss 45 * SIZE(AA), %xmm0
  2858. movaps %xmm6, %xmm1
  2859. shufps $0x00, %xmm0, %xmm1
  2860. mulps %xmm1, %xmm5
  2861. movaps %xmm5, %xmm1
  2862. shufps $0xee, %xmm1, %xmm1
  2863. movsd 46 * SIZE(AA), %xmm0
  2864. shufps $0x50, %xmm0, %xmm0
  2865. mulps %xmm1, %xmm0
  2866. subps %xmm0, %xmm7
  2867. movss 54 * SIZE(AA), %xmm0
  2868. shufps $0x00, %xmm6, %xmm0
  2869. mulps %xmm0, %xmm7
  2870. movaps %xmm7, %xmm1
  2871. shufps $0x44, %xmm1, %xmm1
  2872. movss 55 * SIZE(AA), %xmm0
  2873. shufps $0x05, %xmm0, %xmm0
  2874. mulps %xmm1, %xmm0
  2875. subps %xmm0, %xmm7
  2876. movss 63 * SIZE(AA), %xmm0
  2877. movaps %xmm6, %xmm1
  2878. shufps $0x00, %xmm0, %xmm1
  2879. mulps %xmm1, %xmm7
  2880. #endif
  2881. #if defined(RN) || defined(RT)
  2882. movss 0 * SIZE(B), %xmm6
  2883. shufps $0x00, %xmm6, %xmm6
  2884. mulps %xmm6, %xmm0
  2885. mulps %xmm6, %xmm1
  2886. #endif
  2887. #if defined(LN) || defined(LT)
  2888. shufps $0x88, %xmm3, %xmm2
  2889. shufps $0x88, %xmm7, %xmm5
  2890. movlps %xmm2, 0 * SIZE(B)
  2891. movhps %xmm2, 2 * SIZE(B)
  2892. movlps %xmm5, 4 * SIZE(B)
  2893. movhps %xmm5, 6 * SIZE(B)
  2894. #ifdef HAVE_SSE2
  2895. pshufd $0x00, %xmm2, %xmm0
  2896. pshufd $0x55, %xmm2, %xmm1
  2897. pshufd $0xaa, %xmm2, %xmm4
  2898. pshufd $0xff, %xmm2, %xmm6
  2899. #else
  2900. movaps %xmm2, %xmm0
  2901. shufps $0x00, %xmm0, %xmm0
  2902. movaps %xmm2, %xmm1
  2903. shufps $0x55, %xmm1, %xmm1
  2904. movaps %xmm2, %xmm4
  2905. shufps $0xaa, %xmm4, %xmm4
  2906. movaps %xmm2, %xmm6
  2907. shufps $0xff, %xmm6, %xmm6
  2908. #endif
  2909. movaps %xmm0, 0 * SIZE(BB)
  2910. movaps %xmm1, 4 * SIZE(BB)
  2911. movaps %xmm4, 8 * SIZE(BB)
  2912. movaps %xmm6, 12 * SIZE(BB)
  2913. #ifdef HAVE_SSE2
  2914. pshufd $0x00, %xmm5, %xmm0
  2915. pshufd $0x55, %xmm5, %xmm1
  2916. pshufd $0xaa, %xmm5, %xmm4
  2917. pshufd $0xff, %xmm5, %xmm6
  2918. #else
  2919. movaps %xmm5, %xmm0
  2920. shufps $0x00, %xmm0, %xmm0
  2921. movaps %xmm5, %xmm1
  2922. shufps $0x55, %xmm1, %xmm1
  2923. movaps %xmm5, %xmm4
  2924. shufps $0xaa, %xmm4, %xmm4
  2925. movaps %xmm5, %xmm6
  2926. shufps $0xff, %xmm6, %xmm6
  2927. #endif
  2928. movaps %xmm0, 16 * SIZE(BB)
  2929. movaps %xmm1, 20 * SIZE(BB)
  2930. movaps %xmm4, 24 * SIZE(BB)
  2931. movaps %xmm6, 28 * SIZE(BB)
  2932. #else
  2933. movaps %xmm0, 0 * SIZE(AA)
  2934. movaps %xmm1, 4 * SIZE(AA)
  2935. #endif
  2936. #ifdef LN
  2937. subl $8 * SIZE, CO1
  2938. #endif
  2939. #if defined(LN) || defined(LT)
  2940. movlps %xmm2, 0 * SIZE(CO1)
  2941. movhps %xmm2, 2 * SIZE(CO1)
  2942. movlps %xmm5, 4 * SIZE(CO1)
  2943. movhps %xmm5, 6 * SIZE(CO1)
  2944. #else
  2945. movlps %xmm0, 0 * SIZE(CO1)
  2946. movhps %xmm0, 2 * SIZE(CO1)
  2947. movlps %xmm1, 4 * SIZE(CO1)
  2948. movhps %xmm1, 6 * SIZE(CO1)
  2949. #endif
  2950. #ifndef LN
  2951. addl $8 * SIZE, CO1
  2952. #endif
  2953. #if defined(LT) || defined(RN)
  2954. movl K, %eax
  2955. subl KK, %eax
  2956. leal (,%eax, SIZE), %eax
  2957. leal (AA, %eax, 8), AA
  2958. #ifdef LT
  2959. addl $8 * SIZE, B
  2960. #endif
  2961. #endif
  2962. #ifdef LN
  2963. subl $8, KK
  2964. movl BORIG, B
  2965. #endif
  2966. #ifdef LT
  2967. addl $8, KK
  2968. #endif
  2969. #ifdef RT
  2970. movl K, %eax
  2971. movl BORIG, B
  2972. sall $3 + BASE_SHIFT, %eax
  2973. addl %eax, AORIG
  2974. #endif
  2975. decl %ebx # i --
  2976. jg .L110
  2977. ALIGN_2
  2978. .L179:
  2979. #ifdef LN
  2980. movl K, %eax
  2981. leal (B, %eax, SIZE), B
  2982. #endif
  2983. #if defined(LT) || defined(RN)
  2984. movl K, %eax
  2985. subl KK, %eax
  2986. leal (B, %eax, SIZE), B
  2987. #endif
  2988. #ifdef RN
  2989. addl $1, KK
  2990. #endif
  2991. #ifdef RT
  2992. subl $1, KK
  2993. #endif
  2994. ALIGN_4
  2995. .L999:
  2996. movl OLD_STACK, %esp
  2997. popl %ebx
  2998. popl %esi
  2999. popl %edi
  3000. popl %ebp
  3001. ret
  3002. EPILOGUE