X86SchedSkylakeServer.td 111 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572
  1. //=- X86SchedSkylake.td - X86 Skylake Server Scheduling ------*- tablegen -*-=//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file defines the machine model for Skylake Server to support
  10. // instruction scheduling and other instruction cost heuristics.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. def SkylakeServerModel : SchedMachineModel {
  14. // All x86 instructions are modeled as a single micro-op, and SKylake can
  15. // decode 6 instructions per cycle.
  16. let IssueWidth = 6;
  17. let MicroOpBufferSize = 224; // Based on the reorder buffer.
  18. let LoadLatency = 5;
  19. let MispredictPenalty = 14;
  20. // Based on the LSD (loop-stream detector) queue size and benchmarking data.
  21. let LoopMicroOpBufferSize = 50;
  22. // This flag is set to allow the scheduler to assign a default model to
  23. // unrecognized opcodes.
  24. let CompleteModel = 0;
  25. }
  26. let SchedModel = SkylakeServerModel in {
  27. // Skylake Server can issue micro-ops to 8 different ports in one cycle.
  28. // Ports 0, 1, 5, and 6 handle all computation.
  29. // Port 4 gets the data half of stores. Store data can be available later than
  30. // the store address, but since we don't model the latency of stores, we can
  31. // ignore that.
  32. // Ports 2 and 3 are identical. They handle loads and the address half of
  33. // stores. Port 7 can handle address calculations.
  34. def SKXPort0 : ProcResource<1>;
  35. def SKXPort1 : ProcResource<1>;
  36. def SKXPort2 : ProcResource<1>;
  37. def SKXPort3 : ProcResource<1>;
  38. def SKXPort4 : ProcResource<1>;
  39. def SKXPort5 : ProcResource<1>;
  40. def SKXPort6 : ProcResource<1>;
  41. def SKXPort7 : ProcResource<1>;
  42. // Many micro-ops are capable of issuing on multiple ports.
  43. def SKXPort01 : ProcResGroup<[SKXPort0, SKXPort1]>;
  44. def SKXPort23 : ProcResGroup<[SKXPort2, SKXPort3]>;
  45. def SKXPort237 : ProcResGroup<[SKXPort2, SKXPort3, SKXPort7]>;
  46. def SKXPort04 : ProcResGroup<[SKXPort0, SKXPort4]>;
  47. def SKXPort05 : ProcResGroup<[SKXPort0, SKXPort5]>;
  48. def SKXPort06 : ProcResGroup<[SKXPort0, SKXPort6]>;
  49. def SKXPort15 : ProcResGroup<[SKXPort1, SKXPort5]>;
  50. def SKXPort16 : ProcResGroup<[SKXPort1, SKXPort6]>;
  51. def SKXPort56 : ProcResGroup<[SKXPort5, SKXPort6]>;
  52. def SKXPort015 : ProcResGroup<[SKXPort0, SKXPort1, SKXPort5]>;
  53. def SKXPort056 : ProcResGroup<[SKXPort0, SKXPort5, SKXPort6]>;
  54. def SKXPort0156: ProcResGroup<[SKXPort0, SKXPort1, SKXPort5, SKXPort6]>;
  55. def SKXDivider : ProcResource<1>; // Integer division issued on port 0.
  56. // FP division and sqrt on port 0.
  57. def SKXFPDivider : ProcResource<1>;
  58. // 60 Entry Unified Scheduler
  59. def SKXPortAny : ProcResGroup<[SKXPort0, SKXPort1, SKXPort2, SKXPort3, SKXPort4,
  60. SKXPort5, SKXPort6, SKXPort7]> {
  61. let BufferSize=60;
  62. }
  63. // Integer loads are 5 cycles, so ReadAfterLd registers needn't be available until 5
  64. // cycles after the memory operand.
  65. def : ReadAdvance<ReadAfterLd, 5>;
  66. // Vector loads are 5/6/7 cycles, so ReadAfterVec*Ld registers needn't be available
  67. // until 5/6/7 cycles after the memory operand.
  68. def : ReadAdvance<ReadAfterVecLd, 5>;
  69. def : ReadAdvance<ReadAfterVecXLd, 6>;
  70. def : ReadAdvance<ReadAfterVecYLd, 7>;
  71. def : ReadAdvance<ReadInt2Fpu, 0>;
  72. // Many SchedWrites are defined in pairs with and without a folded load.
  73. // Instructions with folded loads are usually micro-fused, so they only appear
  74. // as two micro-ops when queued in the reservation station.
  75. // This multiclass defines the resource usage for variants with and without
  76. // folded loads.
  77. multiclass SKXWriteResPair<X86FoldableSchedWrite SchedRW,
  78. list<ProcResourceKind> ExePorts,
  79. int Lat, list<int> Res = [1], int UOps = 1,
  80. int LoadLat = 5, int LoadUOps = 1> {
  81. // Register variant is using a single cycle on ExePort.
  82. def : WriteRes<SchedRW, ExePorts> {
  83. let Latency = Lat;
  84. let ResourceCycles = Res;
  85. let NumMicroOps = UOps;
  86. }
  87. // Memory variant also uses a cycle on port 2/3 and adds LoadLat cycles to
  88. // the latency (default = 5).
  89. def : WriteRes<SchedRW.Folded, !listconcat([SKXPort23], ExePorts)> {
  90. let Latency = !add(Lat, LoadLat);
  91. let ResourceCycles = !listconcat([1], Res);
  92. let NumMicroOps = !add(UOps, LoadUOps);
  93. }
  94. }
  95. // A folded store needs a cycle on port 4 for the store data, and an extra port
  96. // 2/3/7 cycle to recompute the address.
  97. def : WriteRes<WriteRMW, [SKXPort237,SKXPort4]>;
  98. // Arithmetic.
  99. defm : SKXWriteResPair<WriteALU, [SKXPort0156], 1>; // Simple integer ALU op.
  100. defm : SKXWriteResPair<WriteADC, [SKXPort06], 1>; // Integer ALU + flags op.
  101. // Integer multiplication.
  102. defm : SKXWriteResPair<WriteIMul8, [SKXPort1], 3>;
  103. defm : SKXWriteResPair<WriteIMul16, [SKXPort1,SKXPort06,SKXPort0156], 4, [1,1,2], 4>;
  104. defm : X86WriteRes<WriteIMul16Imm, [SKXPort1,SKXPort0156], 4, [1,1], 2>;
  105. defm : X86WriteRes<WriteIMul16ImmLd, [SKXPort1,SKXPort0156,SKXPort23], 8, [1,1,1], 3>;
  106. defm : X86WriteRes<WriteIMul16Reg, [SKXPort1], 3, [1], 1>;
  107. defm : X86WriteRes<WriteIMul16RegLd, [SKXPort1,SKXPort0156,SKXPort23], 8, [1,1,1], 3>;
  108. defm : SKXWriteResPair<WriteIMul32, [SKXPort1,SKXPort06,SKXPort0156], 4, [1,1,1], 3>;
  109. defm : SKXWriteResPair<WriteMULX32, [SKXPort1,SKXPort06,SKXPort0156], 3, [1,1,1], 3>;
  110. defm : SKXWriteResPair<WriteIMul32Imm, [SKXPort1], 3>;
  111. defm : SKXWriteResPair<WriteIMul32Reg, [SKXPort1], 3>;
  112. defm : SKXWriteResPair<WriteIMul64, [SKXPort1,SKXPort5], 4, [1,1], 2>;
  113. defm : SKXWriteResPair<WriteMULX64, [SKXPort1,SKXPort5], 3, [1,1], 2>;
  114. defm : SKXWriteResPair<WriteIMul64Imm, [SKXPort1], 3>;
  115. defm : SKXWriteResPair<WriteIMul64Reg, [SKXPort1], 3>;
  116. def SKXWriteIMulH : WriteRes<WriteIMulH, []> { let Latency = 4; }
  117. def : WriteRes<WriteIMulHLd, []> {
  118. let Latency = !add(SKXWriteIMulH.Latency, SkylakeServerModel.LoadLatency);
  119. }
  120. defm : X86WriteRes<WriteBSWAP32, [SKXPort15], 1, [1], 1>;
  121. defm : X86WriteRes<WriteBSWAP64, [SKXPort06, SKXPort15], 2, [1,1], 2>;
  122. defm : X86WriteRes<WriteCMPXCHG,[SKXPort06, SKXPort0156], 5, [2,3], 5>;
  123. defm : X86WriteRes<WriteCMPXCHGRMW,[SKXPort23,SKXPort06,SKXPort0156,SKXPort237,SKXPort4], 8, [1,2,1,1,1], 6>;
  124. defm : X86WriteRes<WriteXCHG, [SKXPort0156], 2, [3], 3>;
  125. // TODO: Why isn't the SKXDivider used?
  126. defm : SKXWriteResPair<WriteDiv8, [SKXPort0, SKXDivider], 25, [1,10], 1, 4>;
  127. defm : X86WriteRes<WriteDiv16, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort05,SKXPort0156], 76, [7,2,8,3,1,11], 32>;
  128. defm : X86WriteRes<WriteDiv32, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort05,SKXPort0156], 76, [7,2,8,3,1,11], 32>;
  129. defm : X86WriteRes<WriteDiv64, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort05,SKXPort0156], 76, [7,2,8,3,1,11], 32>;
  130. defm : X86WriteRes<WriteDiv16Ld, [SKXPort0,SKXPort23,SKXDivider], 29, [1,1,10], 2>;
  131. defm : X86WriteRes<WriteDiv32Ld, [SKXPort0,SKXPort23,SKXDivider], 29, [1,1,10], 2>;
  132. defm : X86WriteRes<WriteDiv64Ld, [SKXPort0,SKXPort23,SKXDivider], 29, [1,1,10], 2>;
  133. defm : X86WriteRes<WriteIDiv8, [SKXPort0, SKXDivider], 25, [1,10], 1>;
  134. defm : X86WriteRes<WriteIDiv16, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort06,SKXPort0156], 102, [4,2,4,8,14,34], 66>;
  135. defm : X86WriteRes<WriteIDiv32, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort06,SKXPort0156], 102, [4,2,4,8,14,34], 66>;
  136. defm : X86WriteRes<WriteIDiv64, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort06,SKXPort0156], 102, [4,2,4,8,14,34], 66>;
  137. defm : X86WriteRes<WriteIDiv8Ld, [SKXPort0,SKXPort5,SKXPort23,SKXPort0156], 28, [2,4,1,1], 8>;
  138. defm : X86WriteRes<WriteIDiv16Ld, [SKXPort0,SKXPort5,SKXPort23,SKXPort0156], 28, [2,4,1,1], 8>;
  139. defm : X86WriteRes<WriteIDiv32Ld, [SKXPort0,SKXPort5,SKXPort23,SKXPort0156], 28, [2,4,1,1], 8>;
  140. defm : X86WriteRes<WriteIDiv64Ld, [SKXPort0,SKXPort5,SKXPort23,SKXPort0156], 28, [2,4,1,1], 8>;
  141. defm : SKXWriteResPair<WriteCRC32, [SKXPort1], 3>;
  142. def : WriteRes<WriteLEA, [SKXPort15]>; // LEA instructions can't fold loads.
  143. defm : SKXWriteResPair<WriteCMOV, [SKXPort06], 1, [1], 1>; // Conditional move.
  144. defm : X86WriteRes<WriteFCMOV, [SKXPort1], 3, [1], 1>; // x87 conditional move.
  145. def : WriteRes<WriteSETCC, [SKXPort06]>; // Setcc.
  146. def : WriteRes<WriteSETCCStore, [SKXPort06,SKXPort4,SKXPort237]> {
  147. let Latency = 2;
  148. let NumMicroOps = 3;
  149. }
  150. defm : X86WriteRes<WriteLAHFSAHF, [SKXPort06], 1, [1], 1>;
  151. defm : X86WriteRes<WriteBitTest, [SKXPort06], 1, [1], 1>;
  152. defm : X86WriteRes<WriteBitTestImmLd, [SKXPort06,SKXPort23], 6, [1,1], 2>;
  153. defm : X86WriteRes<WriteBitTestRegLd, [SKXPort0156,SKXPort23], 6, [1,1], 2>;
  154. defm : X86WriteRes<WriteBitTestSet, [SKXPort06], 1, [1], 1>;
  155. defm : X86WriteRes<WriteBitTestSetImmLd, [SKXPort06,SKXPort23], 5, [1,1], 3>;
  156. defm : X86WriteRes<WriteBitTestSetRegLd, [SKXPort0156,SKXPort23], 5, [1,1], 2>;
  157. // Integer shifts and rotates.
  158. defm : SKXWriteResPair<WriteShift, [SKXPort06], 1>;
  159. defm : SKXWriteResPair<WriteShiftCL, [SKXPort06], 3, [3], 3>;
  160. defm : SKXWriteResPair<WriteRotate, [SKXPort06], 1, [1], 1>;
  161. defm : SKXWriteResPair<WriteRotateCL, [SKXPort06], 3, [3], 3>;
  162. // SHLD/SHRD.
  163. defm : X86WriteRes<WriteSHDrri, [SKXPort1], 3, [1], 1>;
  164. defm : X86WriteRes<WriteSHDrrcl,[SKXPort1,SKXPort06,SKXPort0156], 6, [1, 2, 1], 4>;
  165. defm : X86WriteRes<WriteSHDmri, [SKXPort1,SKXPort23,SKXPort237,SKXPort0156], 9, [1, 1, 1, 1], 4>;
  166. defm : X86WriteRes<WriteSHDmrcl,[SKXPort1,SKXPort23,SKXPort237,SKXPort06,SKXPort0156], 11, [1, 1, 1, 2, 1], 6>;
  167. // Bit counts.
  168. defm : SKXWriteResPair<WriteBSF, [SKXPort1], 3>;
  169. defm : SKXWriteResPair<WriteBSR, [SKXPort1], 3>;
  170. defm : SKXWriteResPair<WriteLZCNT, [SKXPort1], 3>;
  171. defm : SKXWriteResPair<WriteTZCNT, [SKXPort1], 3>;
  172. defm : SKXWriteResPair<WritePOPCNT, [SKXPort1], 3>;
  173. // BMI1 BEXTR/BLS, BMI2 BZHI
  174. defm : SKXWriteResPair<WriteBEXTR, [SKXPort06,SKXPort15], 2, [1,1], 2>;
  175. defm : SKXWriteResPair<WriteBLS, [SKXPort15], 1>;
  176. defm : SKXWriteResPair<WriteBZHI, [SKXPort15], 1>;
  177. // Loads, stores, and moves, not folded with other operations.
  178. defm : X86WriteRes<WriteLoad, [SKXPort23], 5, [1], 1>;
  179. defm : X86WriteRes<WriteStore, [SKXPort237, SKXPort4], 1, [1,1], 1>;
  180. defm : X86WriteRes<WriteStoreNT, [SKXPort237, SKXPort4], 1, [1,1], 2>;
  181. defm : X86WriteRes<WriteMove, [SKXPort0156], 1, [1], 1>;
  182. // Model the effect of clobbering the read-write mask operand of the GATHER operation.
  183. // Does not cost anything by itself, only has latency, matching that of the WriteLoad,
  184. defm : X86WriteRes<WriteVecMaskedGatherWriteback, [], 5, [], 0>;
  185. // Idioms that clear a register, like xorps %xmm0, %xmm0.
  186. // These can often bypass execution ports completely.
  187. def : WriteRes<WriteZero, []>;
  188. // Branches don't produce values, so they have no latency, but they still
  189. // consume resources. Indirect branches can fold loads.
  190. defm : SKXWriteResPair<WriteJump, [SKXPort06], 1>;
  191. // Floating point. This covers both scalar and vector operations.
  192. defm : X86WriteRes<WriteFLD0, [SKXPort05], 1, [1], 1>;
  193. defm : X86WriteRes<WriteFLD1, [SKXPort05], 1, [2], 2>;
  194. defm : X86WriteRes<WriteFLDC, [SKXPort05], 1, [2], 2>;
  195. defm : X86WriteRes<WriteFLoad, [SKXPort23], 5, [1], 1>;
  196. defm : X86WriteRes<WriteFLoadX, [SKXPort23], 6, [1], 1>;
  197. defm : X86WriteRes<WriteFLoadY, [SKXPort23], 7, [1], 1>;
  198. defm : X86WriteRes<WriteFMaskedLoad, [SKXPort23,SKXPort015], 7, [1,1], 2>;
  199. defm : X86WriteRes<WriteFMaskedLoadY, [SKXPort23,SKXPort015], 8, [1,1], 2>;
  200. defm : X86WriteRes<WriteFStore, [SKXPort237,SKXPort4], 1, [1,1], 2>;
  201. defm : X86WriteRes<WriteFStoreX, [SKXPort237,SKXPort4], 1, [1,1], 2>;
  202. defm : X86WriteRes<WriteFStoreY, [SKXPort237,SKXPort4], 1, [1,1], 2>;
  203. defm : X86WriteRes<WriteFStoreNT, [SKXPort237,SKXPort4], 1, [1,1], 2>;
  204. defm : X86WriteRes<WriteFStoreNTX, [SKXPort237,SKXPort4], 1, [1,1], 2>;
  205. defm : X86WriteRes<WriteFStoreNTY, [SKXPort237,SKXPort4], 1, [1,1], 2>;
  206. defm : X86WriteRes<WriteFMaskedStore32, [SKXPort237,SKXPort0], 2, [1,1], 2>;
  207. defm : X86WriteRes<WriteFMaskedStore32Y, [SKXPort237,SKXPort0], 2, [1,1], 2>;
  208. defm : X86WriteRes<WriteFMaskedStore64, [SKXPort237,SKXPort0], 2, [1,1], 2>;
  209. defm : X86WriteRes<WriteFMaskedStore64Y, [SKXPort237,SKXPort0], 2, [1,1], 2>;
  210. defm : X86WriteRes<WriteFMove, [SKXPort015], 1, [1], 1>;
  211. defm : X86WriteRes<WriteFMoveX, [SKXPort015], 1, [1], 1>;
  212. defm : X86WriteRes<WriteFMoveY, [SKXPort015], 1, [1], 1>;
  213. defm : X86WriteRes<WriteFMoveZ, [SKXPort05], 1, [1], 1>;
  214. defm : X86WriteRes<WriteEMMS, [SKXPort05,SKXPort0156], 10, [9,1], 10>;
  215. defm : SKXWriteResPair<WriteFAdd, [SKXPort01], 4, [1], 1, 5>; // Floating point add/sub.
  216. defm : SKXWriteResPair<WriteFAddX, [SKXPort01], 4, [1], 1, 6>;
  217. defm : SKXWriteResPair<WriteFAddY, [SKXPort01], 4, [1], 1, 7>;
  218. defm : SKXWriteResPair<WriteFAddZ, [SKXPort05], 4, [1], 1, 7>;
  219. defm : SKXWriteResPair<WriteFAdd64, [SKXPort01], 4, [1], 1, 5>; // Floating point double add/sub.
  220. defm : SKXWriteResPair<WriteFAdd64X, [SKXPort01], 4, [1], 1, 6>;
  221. defm : SKXWriteResPair<WriteFAdd64Y, [SKXPort01], 4, [1], 1, 7>;
  222. defm : SKXWriteResPair<WriteFAdd64Z, [SKXPort05], 4, [1], 1, 7>;
  223. defm : SKXWriteResPair<WriteFCmp, [SKXPort01], 4, [1], 1, 5>; // Floating point compare.
  224. defm : SKXWriteResPair<WriteFCmpX, [SKXPort01], 4, [1], 1, 6>;
  225. defm : SKXWriteResPair<WriteFCmpY, [SKXPort01], 4, [1], 1, 7>;
  226. defm : SKXWriteResPair<WriteFCmpZ, [SKXPort05], 4, [1], 1, 7>;
  227. defm : SKXWriteResPair<WriteFCmp64, [SKXPort01], 4, [1], 1, 5>; // Floating point double compare.
  228. defm : SKXWriteResPair<WriteFCmp64X, [SKXPort01], 4, [1], 1, 6>;
  229. defm : SKXWriteResPair<WriteFCmp64Y, [SKXPort01], 4, [1], 1, 7>;
  230. defm : SKXWriteResPair<WriteFCmp64Z, [SKXPort05], 4, [1], 1, 7>;
  231. defm : SKXWriteResPair<WriteFCom, [SKXPort0], 2>; // Floating point compare to flags (X87).
  232. defm : SKXWriteResPair<WriteFComX, [SKXPort0], 2>; // Floating point compare to flags (SSE).
  233. defm : SKXWriteResPair<WriteFMul, [SKXPort01], 4, [1], 1, 5>; // Floating point multiplication.
  234. defm : SKXWriteResPair<WriteFMulX, [SKXPort01], 4, [1], 1, 6>;
  235. defm : SKXWriteResPair<WriteFMulY, [SKXPort01], 4, [1], 1, 7>;
  236. defm : SKXWriteResPair<WriteFMulZ, [SKXPort05], 4, [1], 1, 7>;
  237. defm : SKXWriteResPair<WriteFMul64, [SKXPort01], 4, [1], 1, 5>; // Floating point double multiplication.
  238. defm : SKXWriteResPair<WriteFMul64X, [SKXPort01], 4, [1], 1, 6>;
  239. defm : SKXWriteResPair<WriteFMul64Y, [SKXPort01], 4, [1], 1, 7>;
  240. defm : SKXWriteResPair<WriteFMul64Z, [SKXPort05], 4, [1], 1, 7>;
  241. defm : SKXWriteResPair<WriteFDiv, [SKXPort0,SKXFPDivider], 11, [1,3], 1, 5>; // 10-14 cycles. // Floating point division.
  242. defm : SKXWriteResPair<WriteFDivX, [SKXPort0,SKXFPDivider], 11, [1,3], 1, 6>; // 10-14 cycles.
  243. defm : SKXWriteResPair<WriteFDivY, [SKXPort0,SKXFPDivider], 11, [1,5], 1, 7>; // 10-14 cycles.
  244. defm : SKXWriteResPair<WriteFDivZ, [SKXPort0,SKXPort5,SKXFPDivider], 18, [2,1,10], 3, 7>; // 10-14 cycles.
  245. defm : SKXWriteResPair<WriteFDiv64, [SKXPort0,SKXFPDivider], 14, [1,4], 1, 5>; // 10-14 cycles. // Floating point division.
  246. defm : SKXWriteResPair<WriteFDiv64X, [SKXPort0,SKXFPDivider], 14, [1,4], 1, 6>; // 10-14 cycles.
  247. defm : SKXWriteResPair<WriteFDiv64Y, [SKXPort0,SKXFPDivider], 14, [1,8], 1, 7>; // 10-14 cycles.
  248. defm : SKXWriteResPair<WriteFDiv64Z, [SKXPort0,SKXPort5,SKXFPDivider], 23, [2,1,16], 3, 7>; // 10-14 cycles.
  249. defm : SKXWriteResPair<WriteFSqrt, [SKXPort0,SKXFPDivider], 12, [1,3], 1, 5>; // Floating point square root.
  250. defm : SKXWriteResPair<WriteFSqrtX, [SKXPort0,SKXFPDivider], 12, [1,3], 1, 6>;
  251. defm : SKXWriteResPair<WriteFSqrtY, [SKXPort0,SKXFPDivider], 12, [1,6], 1, 7>;
  252. defm : SKXWriteResPair<WriteFSqrtZ, [SKXPort0,SKXPort5,SKXFPDivider], 20, [2,1,12], 3, 7>;
  253. defm : SKXWriteResPair<WriteFSqrt64, [SKXPort0,SKXFPDivider], 18, [1,6], 1, 5>; // Floating point double square root.
  254. defm : SKXWriteResPair<WriteFSqrt64X, [SKXPort0,SKXFPDivider], 18, [1,6], 1, 6>;
  255. defm : SKXWriteResPair<WriteFSqrt64Y, [SKXPort0,SKXFPDivider], 18, [1,12],1, 7>;
  256. defm : SKXWriteResPair<WriteFSqrt64Z, [SKXPort0,SKXPort5,SKXFPDivider], 32, [2,1,24], 3, 7>;
  257. defm : SKXWriteResPair<WriteFSqrt80, [SKXPort0,SKXFPDivider], 21, [1,7]>; // Floating point long double square root.
  258. defm : SKXWriteResPair<WriteFRcp, [SKXPort0], 4, [1], 1, 5>; // Floating point reciprocal estimate.
  259. defm : SKXWriteResPair<WriteFRcpX, [SKXPort0], 4, [1], 1, 6>;
  260. defm : SKXWriteResPair<WriteFRcpY, [SKXPort0], 4, [1], 1, 7>;
  261. defm : SKXWriteResPair<WriteFRcpZ, [SKXPort0,SKXPort5], 4, [2,1], 3, 7>;
  262. defm : SKXWriteResPair<WriteFRsqrt, [SKXPort0], 4, [1], 1, 5>; // Floating point reciprocal square root estimate.
  263. defm : SKXWriteResPair<WriteFRsqrtX,[SKXPort0], 4, [1], 1, 6>;
  264. defm : SKXWriteResPair<WriteFRsqrtY,[SKXPort0], 4, [1], 1, 7>;
  265. defm : SKXWriteResPair<WriteFRsqrtZ,[SKXPort0,SKXPort5], 9, [2,1], 3, 7>;
  266. defm : SKXWriteResPair<WriteFMA, [SKXPort01], 4, [1], 1, 5>; // Fused Multiply Add.
  267. defm : SKXWriteResPair<WriteFMAX, [SKXPort01], 4, [1], 1, 6>;
  268. defm : SKXWriteResPair<WriteFMAY, [SKXPort01], 4, [1], 1, 7>;
  269. defm : SKXWriteResPair<WriteFMAZ, [SKXPort05], 4, [1], 1, 7>;
  270. defm : SKXWriteResPair<WriteDPPD, [SKXPort5,SKXPort015], 9, [1,2], 3, 6>; // Floating point double dot product.
  271. defm : SKXWriteResPair<WriteDPPS, [SKXPort5,SKXPort015], 13, [1,3], 4, 6>;
  272. defm : SKXWriteResPair<WriteDPPSY,[SKXPort5,SKXPort015], 13, [1,3], 4, 7>;
  273. defm : SKXWriteResPair<WriteFSign, [SKXPort0], 1>; // Floating point fabs/fchs.
  274. defm : SKXWriteResPair<WriteFRnd, [SKXPort01], 8, [2], 2, 6>; // Floating point rounding.
  275. defm : SKXWriteResPair<WriteFRndY, [SKXPort01], 8, [2], 2, 7>;
  276. defm : SKXWriteResPair<WriteFRndZ, [SKXPort05], 8, [2], 2, 7>;
  277. defm : SKXWriteResPair<WriteFLogic, [SKXPort015], 1, [1], 1, 6>; // Floating point and/or/xor logicals.
  278. defm : SKXWriteResPair<WriteFLogicY, [SKXPort015], 1, [1], 1, 7>;
  279. defm : SKXWriteResPair<WriteFLogicZ, [SKXPort05], 1, [1], 1, 7>;
  280. defm : SKXWriteResPair<WriteFTest, [SKXPort0], 2, [1], 1, 6>; // Floating point TEST instructions.
  281. defm : SKXWriteResPair<WriteFTestY, [SKXPort0], 2, [1], 1, 7>;
  282. defm : SKXWriteResPair<WriteFTestZ, [SKXPort0], 2, [1], 1, 7>;
  283. defm : SKXWriteResPair<WriteFShuffle, [SKXPort5], 1, [1], 1, 6>; // Floating point vector shuffles.
  284. defm : SKXWriteResPair<WriteFShuffleY, [SKXPort5], 1, [1], 1, 7>;
  285. defm : SKXWriteResPair<WriteFShuffleZ, [SKXPort5], 1, [1], 1, 7>;
  286. defm : SKXWriteResPair<WriteFVarShuffle, [SKXPort5], 1, [1], 1, 6>; // Floating point vector variable shuffles.
  287. defm : SKXWriteResPair<WriteFVarShuffleY, [SKXPort5], 1, [1], 1, 7>;
  288. defm : SKXWriteResPair<WriteFVarShuffleZ, [SKXPort5], 1, [1], 1, 7>;
  289. defm : SKXWriteResPair<WriteFBlend, [SKXPort015], 1, [1], 1, 6>; // Floating point vector blends.
  290. defm : SKXWriteResPair<WriteFBlendY,[SKXPort015], 1, [1], 1, 7>;
  291. defm : SKXWriteResPair<WriteFBlendZ,[SKXPort015], 1, [1], 1, 7>;
  292. defm : SKXWriteResPair<WriteFVarBlend, [SKXPort015], 2, [2], 2, 6>; // Fp vector variable blends.
  293. defm : SKXWriteResPair<WriteFVarBlendY,[SKXPort015], 2, [2], 2, 7>;
  294. defm : SKXWriteResPair<WriteFVarBlendZ,[SKXPort015], 2, [2], 2, 7>;
  295. // FMA Scheduling helper class.
  296. // class FMASC { X86FoldableSchedWrite Sched = WriteFAdd; }
  297. // Vector integer operations.
  298. defm : X86WriteRes<WriteVecLoad, [SKXPort23], 5, [1], 1>;
  299. defm : X86WriteRes<WriteVecLoadX, [SKXPort23], 6, [1], 1>;
  300. defm : X86WriteRes<WriteVecLoadY, [SKXPort23], 7, [1], 1>;
  301. defm : X86WriteRes<WriteVecLoadNT, [SKXPort23], 6, [1], 1>;
  302. defm : X86WriteRes<WriteVecLoadNTY, [SKXPort23], 7, [1], 1>;
  303. defm : X86WriteRes<WriteVecMaskedLoad, [SKXPort23,SKXPort015], 7, [1,1], 2>;
  304. defm : X86WriteRes<WriteVecMaskedLoadY, [SKXPort23,SKXPort015], 8, [1,1], 2>;
  305. defm : X86WriteRes<WriteVecStore, [SKXPort237,SKXPort4], 1, [1,1], 2>;
  306. defm : X86WriteRes<WriteVecStoreX, [SKXPort237,SKXPort4], 1, [1,1], 2>;
  307. defm : X86WriteRes<WriteVecStoreY, [SKXPort237,SKXPort4], 1, [1,1], 2>;
  308. defm : X86WriteRes<WriteVecStoreNT, [SKXPort237,SKXPort4], 1, [1,1], 2>;
  309. defm : X86WriteRes<WriteVecStoreNTY, [SKXPort237,SKXPort4], 1, [1,1], 2>;
  310. defm : X86WriteRes<WriteVecMaskedStore32, [SKXPort237,SKXPort0], 2, [1,1], 2>;
  311. defm : X86WriteRes<WriteVecMaskedStore32Y, [SKXPort237,SKXPort0], 2, [1,1], 2>;
  312. defm : X86WriteRes<WriteVecMaskedStore64, [SKXPort237,SKXPort0], 2, [1,1], 2>;
  313. defm : X86WriteRes<WriteVecMaskedStore64Y, [SKXPort237,SKXPort0], 2, [1,1], 2>;
  314. defm : X86WriteRes<WriteVecMove, [SKXPort05], 1, [1], 1>;
  315. defm : X86WriteRes<WriteVecMoveX, [SKXPort015], 1, [1], 1>;
  316. defm : X86WriteRes<WriteVecMoveY, [SKXPort015], 1, [1], 1>;
  317. defm : X86WriteRes<WriteVecMoveZ, [SKXPort05], 1, [1], 1>;
  318. defm : X86WriteRes<WriteVecMoveToGpr, [SKXPort0], 2, [1], 1>;
  319. defm : X86WriteRes<WriteVecMoveFromGpr, [SKXPort5], 1, [1], 1>;
  320. defm : SKXWriteResPair<WriteVecALU, [SKXPort05], 1, [1], 1, 5>; // Vector integer ALU op, no logicals.
  321. defm : SKXWriteResPair<WriteVecALUX, [SKXPort01], 1, [1], 1, 6>;
  322. defm : SKXWriteResPair<WriteVecALUY, [SKXPort01], 1, [1], 1, 7>;
  323. defm : SKXWriteResPair<WriteVecALUZ, [SKXPort0], 1, [1], 1, 7>;
  324. defm : SKXWriteResPair<WriteVecLogic, [SKXPort05], 1, [1], 1, 5>; // Vector integer and/or/xor.
  325. defm : SKXWriteResPair<WriteVecLogicX,[SKXPort015], 1, [1], 1, 6>;
  326. defm : SKXWriteResPair<WriteVecLogicY,[SKXPort015], 1, [1], 1, 7>;
  327. defm : SKXWriteResPair<WriteVecLogicZ,[SKXPort05], 1, [1], 1, 7>;
  328. defm : SKXWriteResPair<WriteVecTest, [SKXPort0,SKXPort5], 3, [1,1], 2, 6>; // Vector integer TEST instructions.
  329. defm : SKXWriteResPair<WriteVecTestY, [SKXPort0,SKXPort5], 3, [1,1], 2, 7>;
  330. defm : SKXWriteResPair<WriteVecTestZ, [SKXPort0,SKXPort5], 3, [1,1], 2, 7>;
  331. defm : SKXWriteResPair<WriteVecIMul, [SKXPort0], 5, [1], 1, 5>; // Vector integer multiply.
  332. defm : SKXWriteResPair<WriteVecIMulX, [SKXPort01], 5, [1], 1, 6>;
  333. defm : SKXWriteResPair<WriteVecIMulY, [SKXPort01], 5, [1], 1, 7>;
  334. defm : SKXWriteResPair<WriteVecIMulZ, [SKXPort05], 5, [1], 1, 7>;
  335. defm : SKXWriteResPair<WritePMULLD, [SKXPort01], 10, [2], 2, 6>; // Vector PMULLD.
  336. defm : SKXWriteResPair<WritePMULLDY, [SKXPort01], 10, [2], 2, 7>;
  337. defm : SKXWriteResPair<WritePMULLDZ, [SKXPort05], 10, [2], 2, 7>;
  338. defm : SKXWriteResPair<WriteShuffle, [SKXPort5], 1, [1], 1, 5>; // Vector shuffles.
  339. defm : SKXWriteResPair<WriteShuffleX, [SKXPort5], 1, [1], 1, 6>;
  340. defm : SKXWriteResPair<WriteShuffleY, [SKXPort5], 1, [1], 1, 7>;
  341. defm : SKXWriteResPair<WriteShuffleZ, [SKXPort5], 1, [1], 1, 7>;
  342. defm : SKXWriteResPair<WriteVarShuffle, [SKXPort5], 1, [1], 1, 5>; // Vector variable shuffles.
  343. defm : SKXWriteResPair<WriteVarShuffleX, [SKXPort5], 1, [1], 1, 6>;
  344. defm : SKXWriteResPair<WriteVarShuffleY, [SKXPort5], 1, [1], 1, 7>;
  345. defm : SKXWriteResPair<WriteVarShuffleZ, [SKXPort5], 1, [1], 1, 7>;
  346. defm : SKXWriteResPair<WriteBlend, [SKXPort5], 1, [1], 1, 6>; // Vector blends.
  347. defm : SKXWriteResPair<WriteBlendY,[SKXPort5], 1, [1], 1, 7>;
  348. defm : SKXWriteResPair<WriteBlendZ,[SKXPort5], 1, [1], 1, 7>;
  349. defm : SKXWriteResPair<WriteVarBlend, [SKXPort015], 2, [2], 2, 6>; // Vector variable blends.
  350. defm : SKXWriteResPair<WriteVarBlendY,[SKXPort015], 2, [2], 2, 6>;
  351. defm : SKXWriteResPair<WriteVarBlendZ,[SKXPort05], 2, [1], 1, 6>;
  352. defm : SKXWriteResPair<WriteMPSAD, [SKXPort5], 4, [2], 2, 6>; // Vector MPSAD.
  353. defm : SKXWriteResPair<WriteMPSADY, [SKXPort5], 4, [2], 2, 7>;
  354. defm : SKXWriteResPair<WriteMPSADZ, [SKXPort5], 4, [2], 2, 7>;
  355. defm : SKXWriteResPair<WritePSADBW, [SKXPort5], 3, [1], 1, 5>; // Vector PSADBW.
  356. defm : SKXWriteResPair<WritePSADBWX, [SKXPort5], 3, [1], 1, 6>;
  357. defm : SKXWriteResPair<WritePSADBWY, [SKXPort5], 3, [1], 1, 7>;
  358. defm : SKXWriteResPair<WritePSADBWZ, [SKXPort5], 3, [1], 1, 7>; // TODO: 512-bit ops require ports 0/1 to be joined.
  359. defm : SKXWriteResPair<WritePHMINPOS, [SKXPort0], 4, [1], 1, 6>; // Vector PHMINPOS.
  360. // Vector integer shifts.
  361. defm : SKXWriteResPair<WriteVecShift, [SKXPort0], 1, [1], 1, 5>;
  362. defm : X86WriteRes<WriteVecShiftX, [SKXPort5,SKXPort01], 2, [1,1], 2>;
  363. defm : X86WriteRes<WriteVecShiftY, [SKXPort5,SKXPort01], 4, [1,1], 2>;
  364. defm : X86WriteRes<WriteVecShiftZ, [SKXPort5,SKXPort0], 4, [1,1], 2>;
  365. defm : X86WriteRes<WriteVecShiftXLd, [SKXPort01,SKXPort23], 7, [1,1], 2>;
  366. defm : X86WriteRes<WriteVecShiftYLd, [SKXPort01,SKXPort23], 8, [1,1], 2>;
  367. defm : X86WriteRes<WriteVecShiftZLd, [SKXPort0,SKXPort23], 8, [1,1], 2>;
  368. defm : SKXWriteResPair<WriteVecShiftImm, [SKXPort0], 1, [1], 1, 5>;
  369. defm : SKXWriteResPair<WriteVecShiftImmX, [SKXPort01], 1, [1], 1, 6>; // Vector integer immediate shifts.
  370. defm : SKXWriteResPair<WriteVecShiftImmY, [SKXPort01], 1, [1], 1, 7>;
  371. defm : SKXWriteResPair<WriteVecShiftImmZ, [SKXPort0], 1, [1], 1, 7>;
  372. defm : SKXWriteResPair<WriteVarVecShift, [SKXPort01], 1, [1], 1, 6>; // Variable vector shifts.
  373. defm : SKXWriteResPair<WriteVarVecShiftY, [SKXPort01], 1, [1], 1, 7>;
  374. defm : SKXWriteResPair<WriteVarVecShiftZ, [SKXPort0], 1, [1], 1, 7>;
  375. // Vector insert/extract operations.
  376. def : WriteRes<WriteVecInsert, [SKXPort5]> {
  377. let Latency = 2;
  378. let NumMicroOps = 2;
  379. let ResourceCycles = [2];
  380. }
  381. def : WriteRes<WriteVecInsertLd, [SKXPort5,SKXPort23]> {
  382. let Latency = 6;
  383. let NumMicroOps = 2;
  384. }
  385. def: InstRW<[WriteVecInsertLd], (instregex "(V?)MOV(H|L)(PD|PS)rm")>;
  386. def : WriteRes<WriteVecExtract, [SKXPort0,SKXPort5]> {
  387. let Latency = 3;
  388. let NumMicroOps = 2;
  389. }
  390. def : WriteRes<WriteVecExtractSt, [SKXPort4,SKXPort5,SKXPort237]> {
  391. let Latency = 2;
  392. let NumMicroOps = 3;
  393. }
  394. // Conversion between integer and float.
  395. defm : SKXWriteResPair<WriteCvtSS2I, [SKXPort01], 6, [2], 2>; // Needs more work: DD vs DQ.
  396. defm : SKXWriteResPair<WriteCvtPS2I, [SKXPort01], 3>;
  397. defm : SKXWriteResPair<WriteCvtPS2IY, [SKXPort01], 3>;
  398. defm : SKXWriteResPair<WriteCvtPS2IZ, [SKXPort05], 3>;
  399. defm : SKXWriteResPair<WriteCvtSD2I, [SKXPort01], 6, [2], 2>;
  400. defm : SKXWriteResPair<WriteCvtPD2I, [SKXPort01], 3>;
  401. defm : SKXWriteResPair<WriteCvtPD2IY, [SKXPort01], 3>;
  402. defm : SKXWriteResPair<WriteCvtPD2IZ, [SKXPort05], 3>;
  403. defm : SKXWriteResPair<WriteCvtI2SS, [SKXPort1], 4>;
  404. defm : SKXWriteResPair<WriteCvtI2PS, [SKXPort01], 4>;
  405. defm : SKXWriteResPair<WriteCvtI2PSY, [SKXPort01], 4>;
  406. defm : SKXWriteResPair<WriteCvtI2PSZ, [SKXPort05], 4>; // Needs more work: DD vs DQ.
  407. defm : SKXWriteResPair<WriteCvtI2SD, [SKXPort1], 4>;
  408. defm : SKXWriteResPair<WriteCvtI2PD, [SKXPort01], 4>;
  409. defm : SKXWriteResPair<WriteCvtI2PDY, [SKXPort01], 4>;
  410. defm : SKXWriteResPair<WriteCvtI2PDZ, [SKXPort05], 4>;
  411. defm : SKXWriteResPair<WriteCvtSS2SD, [SKXPort1], 3>;
  412. defm : SKXWriteResPair<WriteCvtPS2PD, [SKXPort1], 3>;
  413. defm : SKXWriteResPair<WriteCvtPS2PDY, [SKXPort5,SKXPort01], 3, [1,1], 2>;
  414. defm : SKXWriteResPair<WriteCvtPS2PDZ, [SKXPort05], 3, [2], 2>;
  415. defm : SKXWriteResPair<WriteCvtSD2SS, [SKXPort5,SKXPort01], 5, [1,1], 2, 5>;
  416. defm : SKXWriteResPair<WriteCvtPD2PS, [SKXPort5,SKXPort01], 5, [1,1], 2, 4>;
  417. defm : SKXWriteResPair<WriteCvtPD2PSY, [SKXPort5,SKXPort01], 7, [1,1], 2, 7>;
  418. defm : SKXWriteResPair<WriteCvtPD2PSZ, [SKXPort5,SKXPort05], 7, [1,1], 2, 7>;
  419. defm : X86WriteRes<WriteCvtPH2PS, [SKXPort5,SKXPort01], 5, [1,1], 2>;
  420. defm : X86WriteRes<WriteCvtPH2PSY, [SKXPort5,SKXPort01], 7, [1,1], 2>;
  421. defm : X86WriteRes<WriteCvtPH2PSZ, [SKXPort5,SKXPort0], 7, [1,1], 2>;
  422. defm : X86WriteRes<WriteCvtPH2PSLd, [SKXPort23,SKXPort01], 9, [1,1], 2>;
  423. defm : X86WriteRes<WriteCvtPH2PSYLd, [SKXPort23,SKXPort01], 10, [1,1], 2>;
  424. defm : X86WriteRes<WriteCvtPH2PSZLd, [SKXPort23,SKXPort05], 10, [1,1], 2>;
  425. defm : X86WriteRes<WriteCvtPS2PH, [SKXPort5,SKXPort01], 5, [1,1], 2>;
  426. defm : X86WriteRes<WriteCvtPS2PHY, [SKXPort5,SKXPort01], 7, [1,1], 2>;
  427. defm : X86WriteRes<WriteCvtPS2PHZ, [SKXPort5,SKXPort05], 7, [1,1], 2>;
  428. defm : X86WriteRes<WriteCvtPS2PHSt, [SKXPort4,SKXPort5,SKXPort237,SKXPort01], 6, [1,1,1,1], 4>;
  429. defm : X86WriteRes<WriteCvtPS2PHYSt, [SKXPort4,SKXPort5,SKXPort237,SKXPort01], 8, [1,1,1,1], 4>;
  430. defm : X86WriteRes<WriteCvtPS2PHZSt, [SKXPort4,SKXPort5,SKXPort237,SKXPort05], 8, [1,1,1,1], 4>;
  431. // Strings instructions.
  432. // Packed Compare Implicit Length Strings, Return Mask
  433. def : WriteRes<WritePCmpIStrM, [SKXPort0]> {
  434. let Latency = 10;
  435. let NumMicroOps = 3;
  436. let ResourceCycles = [3];
  437. }
  438. def : WriteRes<WritePCmpIStrMLd, [SKXPort0, SKXPort23]> {
  439. let Latency = 16;
  440. let NumMicroOps = 4;
  441. let ResourceCycles = [3,1];
  442. }
  443. // Packed Compare Explicit Length Strings, Return Mask
  444. def : WriteRes<WritePCmpEStrM, [SKXPort0, SKXPort5, SKXPort015, SKXPort0156]> {
  445. let Latency = 19;
  446. let NumMicroOps = 9;
  447. let ResourceCycles = [4,3,1,1];
  448. }
  449. def : WriteRes<WritePCmpEStrMLd, [SKXPort0, SKXPort5, SKXPort23, SKXPort015, SKXPort0156]> {
  450. let Latency = 25;
  451. let NumMicroOps = 10;
  452. let ResourceCycles = [4,3,1,1,1];
  453. }
  454. // Packed Compare Implicit Length Strings, Return Index
  455. def : WriteRes<WritePCmpIStrI, [SKXPort0]> {
  456. let Latency = 10;
  457. let NumMicroOps = 3;
  458. let ResourceCycles = [3];
  459. }
  460. def : WriteRes<WritePCmpIStrILd, [SKXPort0, SKXPort23]> {
  461. let Latency = 16;
  462. let NumMicroOps = 4;
  463. let ResourceCycles = [3,1];
  464. }
  465. // Packed Compare Explicit Length Strings, Return Index
  466. def : WriteRes<WritePCmpEStrI, [SKXPort0,SKXPort5,SKXPort0156]> {
  467. let Latency = 18;
  468. let NumMicroOps = 8;
  469. let ResourceCycles = [4,3,1];
  470. }
  471. def : WriteRes<WritePCmpEStrILd, [SKXPort0, SKXPort5, SKXPort23, SKXPort0156]> {
  472. let Latency = 24;
  473. let NumMicroOps = 9;
  474. let ResourceCycles = [4,3,1,1];
  475. }
  476. // MOVMSK Instructions.
  477. def : WriteRes<WriteFMOVMSK, [SKXPort0]> { let Latency = 2; }
  478. def : WriteRes<WriteVecMOVMSK, [SKXPort0]> { let Latency = 2; }
  479. def : WriteRes<WriteVecMOVMSKY, [SKXPort0]> { let Latency = 2; }
  480. def : WriteRes<WriteMMXMOVMSK, [SKXPort0]> { let Latency = 2; }
  481. // AES instructions.
  482. def : WriteRes<WriteAESDecEnc, [SKXPort0]> { // Decryption, encryption.
  483. let Latency = 4;
  484. let NumMicroOps = 1;
  485. let ResourceCycles = [1];
  486. }
  487. def : WriteRes<WriteAESDecEncLd, [SKXPort0, SKXPort23]> {
  488. let Latency = 10;
  489. let NumMicroOps = 2;
  490. let ResourceCycles = [1,1];
  491. }
  492. def : WriteRes<WriteAESIMC, [SKXPort0]> { // InvMixColumn.
  493. let Latency = 8;
  494. let NumMicroOps = 2;
  495. let ResourceCycles = [2];
  496. }
  497. def : WriteRes<WriteAESIMCLd, [SKXPort0, SKXPort23]> {
  498. let Latency = 14;
  499. let NumMicroOps = 3;
  500. let ResourceCycles = [2,1];
  501. }
  502. def : WriteRes<WriteAESKeyGen, [SKXPort0,SKXPort5,SKXPort015]> { // Key Generation.
  503. let Latency = 20;
  504. let NumMicroOps = 11;
  505. let ResourceCycles = [3,6,2];
  506. }
  507. def : WriteRes<WriteAESKeyGenLd, [SKXPort0,SKXPort5,SKXPort23,SKXPort015]> {
  508. let Latency = 25;
  509. let NumMicroOps = 11;
  510. let ResourceCycles = [3,6,1,1];
  511. }
  512. // Carry-less multiplication instructions.
  513. def : WriteRes<WriteCLMul, [SKXPort5]> {
  514. let Latency = 6;
  515. let NumMicroOps = 1;
  516. let ResourceCycles = [1];
  517. }
  518. def : WriteRes<WriteCLMulLd, [SKXPort5, SKXPort23]> {
  519. let Latency = 12;
  520. let NumMicroOps = 2;
  521. let ResourceCycles = [1,1];
  522. }
  523. // Catch-all for expensive system instructions.
  524. def : WriteRes<WriteSystem, [SKXPort0156]> { let Latency = 100; } // def WriteSystem : SchedWrite;
  525. // AVX2.
  526. defm : SKXWriteResPair<WriteFShuffle256, [SKXPort5], 3, [1], 1, 7>; // Fp 256-bit width vector shuffles.
  527. defm : SKXWriteResPair<WriteFVarShuffle256, [SKXPort5], 3, [1], 1, 7>; // Fp 256-bit width vector variable shuffles.
  528. defm : SKXWriteResPair<WriteShuffle256, [SKXPort5], 3, [1], 1, 7>; // 256-bit width vector shuffles.
  529. defm : SKXWriteResPair<WriteVPMOV256, [SKXPort5], 3, [1], 1, 7>; // 256-bit width packed vector width-changing move.
  530. defm : SKXWriteResPair<WriteVarShuffle256, [SKXPort5], 3, [1], 1, 7>; // 256-bit width vector variable shuffles.
  531. // Old microcoded instructions that nobody use.
  532. def : WriteRes<WriteMicrocoded, [SKXPort0156]> { let Latency = 100; } // def WriteMicrocoded : SchedWrite;
  533. // Fence instructions.
  534. def : WriteRes<WriteFence, [SKXPort23, SKXPort4]>;
  535. // Load/store MXCSR.
  536. def : WriteRes<WriteLDMXCSR, [SKXPort0,SKXPort23,SKXPort0156]> { let Latency = 7; let NumMicroOps = 3; let ResourceCycles = [1,1,1]; }
  537. def : WriteRes<WriteSTMXCSR, [SKXPort4,SKXPort5,SKXPort237]> { let Latency = 2; let NumMicroOps = 3; let ResourceCycles = [1,1,1]; }
  538. // Nop, not very useful expect it provides a model for nops!
  539. def : WriteRes<WriteNop, []>;
  540. ////////////////////////////////////////////////////////////////////////////////
  541. // Horizontal add/sub instructions.
  542. ////////////////////////////////////////////////////////////////////////////////
  543. defm : SKXWriteResPair<WriteFHAdd, [SKXPort5,SKXPort015], 6, [2,1], 3, 6>;
  544. defm : SKXWriteResPair<WriteFHAddY, [SKXPort5,SKXPort015], 6, [2,1], 3, 7>;
  545. defm : SKXWriteResPair<WritePHAdd, [SKXPort5,SKXPort05], 3, [2,1], 3, 5>;
  546. defm : SKXWriteResPair<WritePHAddX, [SKXPort5,SKXPort015], 3, [2,1], 3, 6>;
  547. defm : SKXWriteResPair<WritePHAddY, [SKXPort5,SKXPort015], 3, [2,1], 3, 7>;
  548. // Remaining instrs.
  549. def SKXWriteResGroup1 : SchedWriteRes<[SKXPort0]> {
  550. let Latency = 1;
  551. let NumMicroOps = 1;
  552. let ResourceCycles = [1];
  553. }
  554. def: InstRW<[SKXWriteResGroup1], (instregex "KAND(B|D|Q|W)rr",
  555. "KANDN(B|D|Q|W)rr",
  556. "KMOV(B|D|Q|W)kk",
  557. "KNOT(B|D|Q|W)rr",
  558. "KOR(B|D|Q|W)rr",
  559. "KXNOR(B|D|Q|W)rr",
  560. "KXOR(B|D|Q|W)rr",
  561. "KSET0(B|D|Q|W)", // Same as KXOR
  562. "KSET1(B|D|Q|W)", // Same as KXNOR
  563. "MMX_PADDS(B|W)rr",
  564. "MMX_PADDUS(B|W)rr",
  565. "MMX_PAVG(B|W)rr",
  566. "MMX_PCMPEQ(B|D|W)rr",
  567. "MMX_PCMPGT(B|D|W)rr",
  568. "MMX_P(MAX|MIN)SWrr",
  569. "MMX_P(MAX|MIN)UBrr",
  570. "MMX_PSUBS(B|W)rr",
  571. "MMX_PSUBUS(B|W)rr",
  572. "VPMOVB2M(Z|Z128|Z256)rr",
  573. "VPMOVD2M(Z|Z128|Z256)rr",
  574. "VPMOVQ2M(Z|Z128|Z256)rr",
  575. "VPMOVW2M(Z|Z128|Z256)rr")>;
  576. def SKXWriteResGroup3 : SchedWriteRes<[SKXPort5]> {
  577. let Latency = 1;
  578. let NumMicroOps = 1;
  579. let ResourceCycles = [1];
  580. }
  581. def: InstRW<[SKXWriteResGroup3], (instregex "COM(P?)_FST0r",
  582. "KMOV(B|D|Q|W)kr",
  583. "UCOM_F(P?)r")>;
  584. def SKXWriteResGroup4 : SchedWriteRes<[SKXPort6]> {
  585. let Latency = 1;
  586. let NumMicroOps = 1;
  587. let ResourceCycles = [1];
  588. }
  589. def: InstRW<[SKXWriteResGroup4], (instregex "JMP(16|32|64)r")>;
  590. def SKXWriteResGroup6 : SchedWriteRes<[SKXPort05]> {
  591. let Latency = 1;
  592. let NumMicroOps = 1;
  593. let ResourceCycles = [1];
  594. }
  595. def: InstRW<[SKXWriteResGroup6], (instrs FINCSTP, FNOP)>;
  596. def SKXWriteResGroup7 : SchedWriteRes<[SKXPort06]> {
  597. let Latency = 1;
  598. let NumMicroOps = 1;
  599. let ResourceCycles = [1];
  600. }
  601. def: InstRW<[SKXWriteResGroup7], (instrs CDQ, CQO, CLAC, STAC)>;
  602. def SKXWriteResGroup8 : SchedWriteRes<[SKXPort15]> {
  603. let Latency = 1;
  604. let NumMicroOps = 1;
  605. let ResourceCycles = [1];
  606. }
  607. def: InstRW<[SKXWriteResGroup8], (instregex "ANDN(32|64)rr")>;
  608. def SKXWriteResGroup9 : SchedWriteRes<[SKXPort015]> {
  609. let Latency = 1;
  610. let NumMicroOps = 1;
  611. let ResourceCycles = [1];
  612. }
  613. def: InstRW<[SKXWriteResGroup9], (instregex "VBLENDMPD(Z128|Z256)rr",
  614. "VBLENDMPS(Z128|Z256)rr",
  615. "VPADD(B|D|Q|W)(Y|Z|Z128|Z256)rr",
  616. "(V?)PADD(B|D|Q|W)rr",
  617. "VPBLENDD(Y?)rri",
  618. "VPBLENDMB(Z128|Z256)rr",
  619. "VPBLENDMD(Z128|Z256)rr",
  620. "VPBLENDMQ(Z128|Z256)rr",
  621. "VPBLENDMW(Z128|Z256)rr",
  622. "VPSUB(B|D|Q|W)(Y|Z|Z128|Z256)rrk",
  623. "VPTERNLOGD(Z|Z128|Z256)rri",
  624. "VPTERNLOGQ(Z|Z128|Z256)rri")>;
  625. def SKXWriteResGroup10 : SchedWriteRes<[SKXPort0156]> {
  626. let Latency = 1;
  627. let NumMicroOps = 1;
  628. let ResourceCycles = [1];
  629. }
  630. def: InstRW<[SKXWriteResGroup10], (instrs SGDT64m,
  631. SIDT64m,
  632. SMSW16m,
  633. STRm,
  634. SYSCALL)>;
  635. def SKXWriteResGroup11 : SchedWriteRes<[SKXPort4,SKXPort237]> {
  636. let Latency = 1;
  637. let NumMicroOps = 2;
  638. let ResourceCycles = [1,1];
  639. }
  640. def: InstRW<[SKXWriteResGroup11], (instrs FBSTPm, VMPTRSTm)>;
  641. def: InstRW<[SKXWriteResGroup11], (instregex "KMOV(B|D|Q|W)mk",
  642. "ST_FP(32|64|80)m")>;
  643. def SKXWriteResGroup13 : SchedWriteRes<[SKXPort5]> {
  644. let Latency = 2;
  645. let NumMicroOps = 2;
  646. let ResourceCycles = [2];
  647. }
  648. def: InstRW<[SKXWriteResGroup13], (instrs MMX_MOVQ2DQrr)>;
  649. def SKXWriteResGroup14 : SchedWriteRes<[SKXPort05]> {
  650. let Latency = 2;
  651. let NumMicroOps = 2;
  652. let ResourceCycles = [2];
  653. }
  654. def: InstRW<[SKXWriteResGroup14], (instrs FDECSTP,
  655. MMX_MOVDQ2Qrr)>;
  656. def SKXWriteResGroup17 : SchedWriteRes<[SKXPort0156]> {
  657. let Latency = 2;
  658. let NumMicroOps = 2;
  659. let ResourceCycles = [2];
  660. }
  661. def: InstRW<[SKXWriteResGroup17], (instrs LFENCE,
  662. WAIT,
  663. XGETBV)>;
  664. def SKXWriteResGroup20 : SchedWriteRes<[SKXPort6,SKXPort0156]> {
  665. let Latency = 2;
  666. let NumMicroOps = 2;
  667. let ResourceCycles = [1,1];
  668. }
  669. def: InstRW<[SKXWriteResGroup20], (instregex "CLFLUSH")>;
  670. def SKXWriteResGroup21 : SchedWriteRes<[SKXPort237,SKXPort0156]> {
  671. let Latency = 2;
  672. let NumMicroOps = 2;
  673. let ResourceCycles = [1,1];
  674. }
  675. def: InstRW<[SKXWriteResGroup21], (instrs SFENCE)>;
  676. def SKXWriteResGroup23 : SchedWriteRes<[SKXPort06,SKXPort0156]> {
  677. let Latency = 2;
  678. let NumMicroOps = 2;
  679. let ResourceCycles = [1,1];
  680. }
  681. def: InstRW<[SKXWriteResGroup23], (instrs CWD,
  682. JCXZ, JECXZ, JRCXZ,
  683. ADC8i8, SBB8i8,
  684. ADC16i16, SBB16i16,
  685. ADC32i32, SBB32i32,
  686. ADC64i32, SBB64i32)>;
  687. def SKXWriteResGroup25 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort237]> {
  688. let Latency = 2;
  689. let NumMicroOps = 3;
  690. let ResourceCycles = [1,1,1];
  691. }
  692. def: InstRW<[SKXWriteResGroup25], (instrs FNSTCW16m)>;
  693. def SKXWriteResGroup27 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort15]> {
  694. let Latency = 2;
  695. let NumMicroOps = 3;
  696. let ResourceCycles = [1,1,1];
  697. }
  698. def: InstRW<[SKXWriteResGroup27], (instregex "MOVBE(16|32|64)mr")>;
  699. def SKXWriteResGroup28 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort0156]> {
  700. let Latency = 2;
  701. let NumMicroOps = 3;
  702. let ResourceCycles = [1,1,1];
  703. }
  704. def: InstRW<[SKXWriteResGroup28], (instrs PUSH16r, PUSH32r, PUSH64r, PUSH64i8,
  705. STOSB, STOSL, STOSQ, STOSW)>;
  706. def: InstRW<[SKXWriteResGroup28], (instregex "PUSH(16|32|64)rmr")>;
  707. def SKXWriteResGroup29 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort15]> {
  708. let Latency = 2;
  709. let NumMicroOps = 5;
  710. let ResourceCycles = [2,2,1];
  711. }
  712. def: InstRW<[SKXWriteResGroup29], (instregex "VMOVDQU8Zmr(b?)")>;
  713. def SKXWriteResGroup30 : SchedWriteRes<[SKXPort0]> {
  714. let Latency = 3;
  715. let NumMicroOps = 1;
  716. let ResourceCycles = [1];
  717. }
  718. def: InstRW<[SKXWriteResGroup30], (instregex "KMOV(B|D|Q|W)rk",
  719. "KORTEST(B|D|Q|W)rr",
  720. "KTEST(B|D|Q|W)rr")>;
  721. def SKXWriteResGroup31 : SchedWriteRes<[SKXPort1]> {
  722. let Latency = 3;
  723. let NumMicroOps = 1;
  724. let ResourceCycles = [1];
  725. }
  726. def: InstRW<[SKXWriteResGroup31], (instregex "PDEP(32|64)rr",
  727. "PEXT(32|64)rr")>;
  728. def SKXWriteResGroup32 : SchedWriteRes<[SKXPort5]> {
  729. let Latency = 3;
  730. let NumMicroOps = 1;
  731. let ResourceCycles = [1];
  732. }
  733. def: InstRW<[SKXWriteResGroup32], (instregex "(ADD|SUB|SUBR)_(FPrST0|FST0r|FrST0)",
  734. "VALIGND(Z|Z128|Z256)rri",
  735. "VALIGNQ(Z|Z128|Z256)rri",
  736. "VPBROADCAST(B|W)rr",
  737. "VP(MAX|MIN)(S|U)Q(Z|Z128|Z256)rr")>;
  738. def SKXWriteResGroup33 : SchedWriteRes<[SKXPort5]> {
  739. let Latency = 4;
  740. let NumMicroOps = 1;
  741. let ResourceCycles = [1];
  742. }
  743. def: InstRW<[SKXWriteResGroup33], (instregex "KADD(B|D|Q|W)rr",
  744. "KSHIFTL(B|D|Q|W)ri",
  745. "KSHIFTR(B|D|Q|W)ri",
  746. "KUNPCK(BW|DQ|WD)rr",
  747. "VCMPPD(Z|Z128|Z256)rri",
  748. "VCMPPS(Z|Z128|Z256)rri",
  749. "VCMP(SD|SS)Zrr",
  750. "VFPCLASS(PD|PS)(Z|Z128|Z256)rr",
  751. "VFPCLASS(SD|SS)Zrr",
  752. "VPCMPB(Z|Z128|Z256)rri",
  753. "VPCMPD(Z|Z128|Z256)rri",
  754. "VPCMPEQ(B|D|Q|W)(Z|Z128|Z256)rr",
  755. "VPCMPGT(B|D|Q|W)(Z|Z128|Z256)rr",
  756. "VPCMPQ(Z|Z128|Z256)rri",
  757. "VPCMPU(B|D|Q|W)(Z|Z128|Z256)rri",
  758. "VPCMPW(Z|Z128|Z256)rri",
  759. "VPTEST(N?)M(B|D|Q|W)(Z|Z128|Z256)rr")>;
  760. def SKXWriteResGroup34 : SchedWriteRes<[SKXPort0,SKXPort0156]> {
  761. let Latency = 3;
  762. let NumMicroOps = 2;
  763. let ResourceCycles = [1,1];
  764. }
  765. def: InstRW<[SKXWriteResGroup34], (instrs FNSTSW16r)>;
  766. def SKXWriteResGroup37 : SchedWriteRes<[SKXPort0,SKXPort5]> {
  767. let Latency = 3;
  768. let NumMicroOps = 3;
  769. let ResourceCycles = [1,2];
  770. }
  771. def: InstRW<[SKXWriteResGroup37], (instregex "MMX_PH(ADD|SUB)SWrr")>;
  772. def SKXWriteResGroup38 : SchedWriteRes<[SKXPort5,SKXPort01]> {
  773. let Latency = 3;
  774. let NumMicroOps = 3;
  775. let ResourceCycles = [2,1];
  776. }
  777. def: InstRW<[SKXWriteResGroup38], (instregex "(V?)PH(ADD|SUB)SW(Y?)rr")>;
  778. def SKXWriteResGroup41 : SchedWriteRes<[SKXPort5,SKXPort0156]> {
  779. let Latency = 3;
  780. let NumMicroOps = 3;
  781. let ResourceCycles = [2,1];
  782. }
  783. def: InstRW<[SKXWriteResGroup41], (instrs MMX_PACKSSDWrr,
  784. MMX_PACKSSWBrr,
  785. MMX_PACKUSWBrr)>;
  786. def SKXWriteResGroup42 : SchedWriteRes<[SKXPort6,SKXPort0156]> {
  787. let Latency = 3;
  788. let NumMicroOps = 3;
  789. let ResourceCycles = [1,2];
  790. }
  791. def: InstRW<[SKXWriteResGroup42], (instregex "CLD")>;
  792. def SKXWriteResGroup43 : SchedWriteRes<[SKXPort237,SKXPort0156]> {
  793. let Latency = 3;
  794. let NumMicroOps = 3;
  795. let ResourceCycles = [1,2];
  796. }
  797. def: InstRW<[SKXWriteResGroup43], (instrs MFENCE)>;
  798. def SKXWriteResGroup44 : SchedWriteRes<[SKXPort06,SKXPort0156]> {
  799. let Latency = 2;
  800. let NumMicroOps = 3;
  801. let ResourceCycles = [1,2];
  802. }
  803. def: InstRW<[SKXWriteResGroup44], (instrs RCL8r1, RCL16r1, RCL32r1, RCL64r1,
  804. RCR8r1, RCR16r1, RCR32r1, RCR64r1)>;
  805. def SKXWriteResGroup44b : SchedWriteRes<[SKXPort1,SKXPort06,SKXPort0156]> {
  806. let Latency = 5;
  807. let NumMicroOps = 8;
  808. let ResourceCycles = [2,4,2];
  809. }
  810. def: InstRW<[SKXWriteResGroup44b], (instrs RCR8ri, RCR16ri, RCR32ri, RCR64ri)>;
  811. def SKXWriteResGroup44c : SchedWriteRes<[SKXPort1,SKXPort06,SKXPort0156]> {
  812. let Latency = 6;
  813. let NumMicroOps = 8;
  814. let ResourceCycles = [2,4,2];
  815. }
  816. def: InstRW<[SKXWriteResGroup44c], (instrs RCL8ri, RCL16ri, RCL32ri, RCL64ri)>;
  817. def SKXWriteResGroup45 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort237]> {
  818. let Latency = 3;
  819. let NumMicroOps = 3;
  820. let ResourceCycles = [1,1,1];
  821. }
  822. def: InstRW<[SKXWriteResGroup45], (instrs FNSTSWm)>;
  823. def SKXWriteResGroup47 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort237,SKXPort0156]> {
  824. let Latency = 3;
  825. let NumMicroOps = 4;
  826. let ResourceCycles = [1,1,1,1];
  827. }
  828. def: InstRW<[SKXWriteResGroup47], (instregex "CALL(16|32|64)r")>;
  829. def SKXWriteResGroup48 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort06,SKXPort0156]> {
  830. let Latency = 3;
  831. let NumMicroOps = 4;
  832. let ResourceCycles = [1,1,1,1];
  833. }
  834. def: InstRW<[SKXWriteResGroup48], (instrs CALL64pcrel32)>;
  835. def SKXWriteResGroup49 : SchedWriteRes<[SKXPort0]> {
  836. let Latency = 4;
  837. let NumMicroOps = 1;
  838. let ResourceCycles = [1];
  839. }
  840. def: InstRW<[SKXWriteResGroup49], (instregex "MUL_(FPrST0|FST0r|FrST0)")>;
  841. def SKXWriteResGroup50 : SchedWriteRes<[SKXPort01]> {
  842. let Latency = 4;
  843. let NumMicroOps = 1;
  844. let ResourceCycles = [1];
  845. }
  846. def: InstRW<[SKXWriteResGroup50], (instregex "VCVTPD2QQ(Z128|Z256)rr",
  847. "VCVTPD2UQQ(Z128|Z256)rr",
  848. "VCVTPS2DQ(Y|Z128|Z256)rr",
  849. "(V?)CVTPS2DQrr",
  850. "VCVTPS2UDQ(Z128|Z256)rr",
  851. "VCVTTPD2QQ(Z128|Z256)rr",
  852. "VCVTTPD2UQQ(Z128|Z256)rr",
  853. "VCVTTPS2DQ(Z128|Z256)rr",
  854. "(V?)CVTTPS2DQrr",
  855. "VCVTTPS2UDQ(Z128|Z256)rr")>;
  856. def SKXWriteResGroup50z : SchedWriteRes<[SKXPort05]> {
  857. let Latency = 4;
  858. let NumMicroOps = 1;
  859. let ResourceCycles = [1];
  860. }
  861. def: InstRW<[SKXWriteResGroup50z], (instrs VCVTPD2QQZrr,
  862. VCVTPD2UQQZrr,
  863. VCVTPS2DQZrr,
  864. VCVTPS2UDQZrr,
  865. VCVTTPD2QQZrr,
  866. VCVTTPD2UQQZrr,
  867. VCVTTPS2DQZrr,
  868. VCVTTPS2UDQZrr)>;
  869. def SKXWriteResGroup51 : SchedWriteRes<[SKXPort5]> {
  870. let Latency = 4;
  871. let NumMicroOps = 2;
  872. let ResourceCycles = [2];
  873. }
  874. def: InstRW<[SKXWriteResGroup51], (instregex "VEXPANDPD(Z|Z128|Z256)rr",
  875. "VEXPANDPS(Z|Z128|Z256)rr",
  876. "VPEXPANDD(Z|Z128|Z256)rr",
  877. "VPEXPANDQ(Z|Z128|Z256)rr",
  878. "VPMOVDB(Z|Z128|Z256)rr",
  879. "VPMOVDW(Z|Z128|Z256)rr",
  880. "VPMOVQB(Z|Z128|Z256)rr",
  881. "VPMOVQW(Z|Z128|Z256)rr",
  882. "VPMOVSDB(Z|Z128|Z256)rr",
  883. "VPMOVSDW(Z|Z128|Z256)rr",
  884. "VPMOVSQB(Z|Z128|Z256)rr",
  885. "VPMOVSQD(Z|Z128|Z256)rr",
  886. "VPMOVSQW(Z|Z128|Z256)rr",
  887. "VPMOVSWB(Z|Z128|Z256)rr",
  888. "VPMOVUSDB(Z|Z128|Z256)rr",
  889. "VPMOVUSDW(Z|Z128|Z256)rr",
  890. "VPMOVUSQB(Z|Z128|Z256)rr",
  891. "VPMOVUSQD(Z|Z128|Z256)rr",
  892. "VPMOVUSWB(Z|Z128|Z256)rr",
  893. "VPMOVWB(Z|Z128|Z256)rr")>;
  894. def SKXWriteResGroup54 : SchedWriteRes<[SKXPort4,SKXPort5,SKXPort237]> {
  895. let Latency = 4;
  896. let NumMicroOps = 3;
  897. let ResourceCycles = [1,1,1];
  898. }
  899. def: InstRW<[SKXWriteResGroup54], (instregex "IST(T?)_FP(16|32|64)m",
  900. "IST_F(16|32)m",
  901. "VPMOVQD(Z|Z128|Z256)mr(b?)")>;
  902. def SKXWriteResGroup55 : SchedWriteRes<[SKXPort0156]> {
  903. let Latency = 4;
  904. let NumMicroOps = 4;
  905. let ResourceCycles = [4];
  906. }
  907. def: InstRW<[SKXWriteResGroup55], (instrs FNCLEX)>;
  908. def SKXWriteResGroup56 : SchedWriteRes<[]> {
  909. let Latency = 0;
  910. let NumMicroOps = 4;
  911. let ResourceCycles = [];
  912. }
  913. def: InstRW<[SKXWriteResGroup56], (instrs VZEROUPPER)>;
  914. def SKXWriteResGroup57 : SchedWriteRes<[SKXPort1,SKXPort6,SKXPort0156]> {
  915. let Latency = 4;
  916. let NumMicroOps = 4;
  917. let ResourceCycles = [1,1,2];
  918. }
  919. def: InstRW<[SKXWriteResGroup57], (instregex "LAR(16|32|64)rr")>;
  920. def SKXWriteResGroup61 : SchedWriteRes<[SKXPort5,SKXPort01]> {
  921. let Latency = 5;
  922. let NumMicroOps = 2;
  923. let ResourceCycles = [1,1];
  924. }
  925. def: InstRW<[SKXWriteResGroup61], (instregex "MMX_CVT(T?)PD2PIrr",
  926. "MMX_CVT(T?)PS2PIrr",
  927. "VCVTDQ2PDZ128rr",
  928. "VCVTPD2DQZ128rr",
  929. "(V?)CVT(T?)PD2DQrr",
  930. "VCVTPD2UDQZ128rr",
  931. "VCVTPS2PDZ128rr",
  932. "(V?)CVTPS2PDrr",
  933. "VCVTPS2QQZ128rr",
  934. "VCVTPS2UQQZ128rr",
  935. "VCVTQQ2PSZ128rr",
  936. "(V?)CVTSI(64)?2SDrr",
  937. "VCVTSI2SSZrr",
  938. "(V?)CVTSI2SSrr",
  939. "VCVTSI(64)?2SDZrr",
  940. "VCVTSS2SDZrr",
  941. "(V?)CVTSS2SDrr",
  942. "VCVTTPD2DQZ128rr",
  943. "VCVTTPD2UDQZ128rr",
  944. "VCVTTPS2QQZ128rr",
  945. "VCVTTPS2UQQZ128rr",
  946. "VCVTUDQ2PDZ128rr",
  947. "VCVTUQQ2PSZ128rr",
  948. "VCVTUSI2SSZrr",
  949. "VCVTUSI(64)?2SDZrr")>;
  950. def SKXWriteResGroup62 : SchedWriteRes<[SKXPort5,SKXPort015]> {
  951. let Latency = 5;
  952. let NumMicroOps = 3;
  953. let ResourceCycles = [2,1];
  954. }
  955. def: InstRW<[SKXWriteResGroup62], (instregex "VPCONFLICTQZ128rr")>;
  956. def SKXWriteResGroup63 : SchedWriteRes<[SKXPort1,SKXPort6,SKXPort06]> {
  957. let Latency = 5;
  958. let NumMicroOps = 3;
  959. let ResourceCycles = [1,1,1];
  960. }
  961. def: InstRW<[SKXWriteResGroup63], (instregex "STR(16|32|64)r")>;
  962. def SKXWriteResGroup65 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort01]> {
  963. let Latency = 5;
  964. let NumMicroOps = 3;
  965. let ResourceCycles = [1,1,1];
  966. }
  967. def: InstRW<[SKXWriteResGroup65], (instregex "VCVTPS2PHZ128mr(b?)",
  968. "VCVTPS2PHZ256mr(b?)",
  969. "VCVTPS2PHZmr(b?)")>;
  970. def SKXWriteResGroup66 : SchedWriteRes<[SKXPort4,SKXPort5,SKXPort237]> {
  971. let Latency = 5;
  972. let NumMicroOps = 4;
  973. let ResourceCycles = [1,2,1];
  974. }
  975. def: InstRW<[SKXWriteResGroup66], (instregex "VPMOVDB(Z|Z128|Z256)mr(b?)",
  976. "VPMOVDW(Z|Z128|Z256)mr(b?)",
  977. "VPMOVQB(Z|Z128|Z256)mr(b?)",
  978. "VPMOVQW(Z|Z128|Z256)mr(b?)",
  979. "VPMOVSDB(Z|Z128|Z256)mr(b?)",
  980. "VPMOVSDW(Z|Z128|Z256)mr(b?)",
  981. "VPMOVSQB(Z|Z128|Z256)mr(b?)",
  982. "VPMOVSQD(Z|Z128|Z256)mr(b?)",
  983. "VPMOVSQW(Z|Z128|Z256)mr(b?)",
  984. "VPMOVSWB(Z|Z128|Z256)mr(b?)",
  985. "VPMOVUSDB(Z|Z128|Z256)mr(b?)",
  986. "VPMOVUSDW(Z|Z128|Z256)mr(b?)",
  987. "VPMOVUSQB(Z|Z128|Z256)mr(b?)",
  988. "VPMOVUSQD(Z|Z128|Z256)mr(b?)",
  989. "VPMOVUSQW(Z|Z128|Z256)mr(b?)",
  990. "VPMOVUSWB(Z|Z128|Z256)mr(b?)",
  991. "VPMOVWB(Z|Z128|Z256)mr(b?)")>;
  992. def SKXWriteResGroup67 : SchedWriteRes<[SKXPort06,SKXPort0156]> {
  993. let Latency = 5;
  994. let NumMicroOps = 5;
  995. let ResourceCycles = [1,4];
  996. }
  997. def: InstRW<[SKXWriteResGroup67], (instrs XSETBV)>;
  998. def SKXWriteResGroup69 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort0156]> {
  999. let Latency = 5;
  1000. let NumMicroOps = 6;
  1001. let ResourceCycles = [1,1,4];
  1002. }
  1003. def: InstRW<[SKXWriteResGroup69], (instregex "PUSHF(16|64)")>;
  1004. def SKXWriteResGroup71 : SchedWriteRes<[SKXPort23]> {
  1005. let Latency = 6;
  1006. let NumMicroOps = 1;
  1007. let ResourceCycles = [1];
  1008. }
  1009. def: InstRW<[SKXWriteResGroup71], (instrs VBROADCASTSSrm,
  1010. VPBROADCASTDrm,
  1011. VPBROADCASTQrm)>;
  1012. def: InstRW<[SKXWriteResGroup71], (instregex "(V?)MOVSHDUPrm",
  1013. "(V?)MOVSLDUPrm",
  1014. "(V?)MOVDDUPrm")>;
  1015. def SKXWriteResGroup72 : SchedWriteRes<[SKXPort5]> {
  1016. let Latency = 6;
  1017. let NumMicroOps = 2;
  1018. let ResourceCycles = [2];
  1019. }
  1020. def: InstRW<[SKXWriteResGroup72], (instrs MMX_CVTPI2PSrr)>;
  1021. def: InstRW<[SKXWriteResGroup72], (instregex "VCOMPRESSPD(Z|Z128|Z256)rr",
  1022. "VCOMPRESSPS(Z|Z128|Z256)rr",
  1023. "VPCOMPRESSD(Z|Z128|Z256)rr",
  1024. "VPCOMPRESSQ(Z|Z128|Z256)rr",
  1025. "VPERMW(Z|Z128|Z256)rr")>;
  1026. def SKXWriteResGroup73 : SchedWriteRes<[SKXPort0,SKXPort23]> {
  1027. let Latency = 6;
  1028. let NumMicroOps = 2;
  1029. let ResourceCycles = [1,1];
  1030. }
  1031. def: InstRW<[SKXWriteResGroup73], (instrs MMX_PADDSBrm,
  1032. MMX_PADDSWrm,
  1033. MMX_PADDUSBrm,
  1034. MMX_PADDUSWrm,
  1035. MMX_PAVGBrm,
  1036. MMX_PAVGWrm,
  1037. MMX_PCMPEQBrm,
  1038. MMX_PCMPEQDrm,
  1039. MMX_PCMPEQWrm,
  1040. MMX_PCMPGTBrm,
  1041. MMX_PCMPGTDrm,
  1042. MMX_PCMPGTWrm,
  1043. MMX_PMAXSWrm,
  1044. MMX_PMAXUBrm,
  1045. MMX_PMINSWrm,
  1046. MMX_PMINUBrm,
  1047. MMX_PSUBSBrm,
  1048. MMX_PSUBSWrm,
  1049. MMX_PSUBUSBrm,
  1050. MMX_PSUBUSWrm)>;
  1051. def SKXWriteResGroup76 : SchedWriteRes<[SKXPort6,SKXPort23]> {
  1052. let Latency = 6;
  1053. let NumMicroOps = 2;
  1054. let ResourceCycles = [1,1];
  1055. }
  1056. def: InstRW<[SKXWriteResGroup76], (instrs FARJMP64m)>;
  1057. def: InstRW<[SKXWriteResGroup76], (instregex "JMP(16|32|64)m")>;
  1058. def SKXWriteResGroup79 : SchedWriteRes<[SKXPort23,SKXPort15]> {
  1059. let Latency = 6;
  1060. let NumMicroOps = 2;
  1061. let ResourceCycles = [1,1];
  1062. }
  1063. def: InstRW<[SKXWriteResGroup79], (instregex "ANDN(32|64)rm",
  1064. "MOVBE(16|32|64)rm")>;
  1065. def SKXWriteResGroup80 : SchedWriteRes<[SKXPort23,SKXPort015]> {
  1066. let Latency = 6;
  1067. let NumMicroOps = 2;
  1068. let ResourceCycles = [1,1];
  1069. }
  1070. def: InstRW<[SKXWriteResGroup80], (instregex "VMOV(64to|QI2)PQIZrm(b?)")>;
  1071. def: InstRW<[SKXWriteResGroup80], (instrs VMOVDI2PDIZrm)>;
  1072. def SKXWriteResGroup81 : SchedWriteRes<[SKXPort23,SKXPort0156]> {
  1073. let Latency = 6;
  1074. let NumMicroOps = 2;
  1075. let ResourceCycles = [1,1];
  1076. }
  1077. def: InstRW<[SKXWriteResGroup81], (instrs POP16r, POP32r, POP64r)>;
  1078. def: InstRW<[SKXWriteResGroup81], (instregex "POP(16|32|64)rmr")>;
  1079. def SKXWriteResGroup82 : SchedWriteRes<[SKXPort5,SKXPort01]> {
  1080. let Latency = 6;
  1081. let NumMicroOps = 3;
  1082. let ResourceCycles = [2,1];
  1083. }
  1084. def: InstRW<[SKXWriteResGroup82], (instregex "(V?)CVTSI642SSrr",
  1085. "VCVTSI642SSZrr",
  1086. "VCVTUSI642SSZrr")>;
  1087. def SKXWriteResGroup84 : SchedWriteRes<[SKXPort1,SKXPort6,SKXPort06,SKXPort0156]> {
  1088. let Latency = 6;
  1089. let NumMicroOps = 4;
  1090. let ResourceCycles = [1,1,1,1];
  1091. }
  1092. def: InstRW<[SKXWriteResGroup84], (instregex "SLDT(16|32|64)r")>;
  1093. def SKXWriteResGroup86 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort06]> {
  1094. let Latency = 6;
  1095. let NumMicroOps = 4;
  1096. let ResourceCycles = [1,1,1,1];
  1097. }
  1098. def: InstRW<[SKXWriteResGroup86], (instregex "SAR(8|16|32|64)m(1|i)",
  1099. "SHL(8|16|32|64)m(1|i)",
  1100. "SHR(8|16|32|64)m(1|i)")>;
  1101. def SKXWriteResGroup87 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort0156]> {
  1102. let Latency = 6;
  1103. let NumMicroOps = 4;
  1104. let ResourceCycles = [1,1,1,1];
  1105. }
  1106. def: InstRW<[SKXWriteResGroup87], (instregex "POP(16|32|64)rmm",
  1107. "PUSH(16|32|64)rmm")>;
  1108. def SKXWriteResGroup88 : SchedWriteRes<[SKXPort6,SKXPort0156]> {
  1109. let Latency = 6;
  1110. let NumMicroOps = 6;
  1111. let ResourceCycles = [1,5];
  1112. }
  1113. def: InstRW<[SKXWriteResGroup88], (instrs STD)>;
  1114. def SKXWriteResGroup89 : SchedWriteRes<[SKXPort23]> {
  1115. let Latency = 7;
  1116. let NumMicroOps = 1;
  1117. let ResourceCycles = [1];
  1118. }
  1119. def: InstRW<[SKXWriteResGroup89], (instregex "LD_F(32|64|80)m")>;
  1120. def: InstRW<[SKXWriteResGroup89], (instrs VBROADCASTF128,
  1121. VBROADCASTI128,
  1122. VBROADCASTSDYrm,
  1123. VBROADCASTSSYrm,
  1124. VMOVDDUPYrm,
  1125. VMOVSHDUPYrm,
  1126. VMOVSLDUPYrm,
  1127. VPBROADCASTDYrm,
  1128. VPBROADCASTQYrm)>;
  1129. def SKXWriteResGroup90 : SchedWriteRes<[SKXPort01,SKXPort5]> {
  1130. let Latency = 7;
  1131. let NumMicroOps = 2;
  1132. let ResourceCycles = [1,1];
  1133. }
  1134. def: InstRW<[SKXWriteResGroup90], (instrs VCVTDQ2PDYrr)>;
  1135. def SKXWriteResGroup92 : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1136. let Latency = 7;
  1137. let NumMicroOps = 2;
  1138. let ResourceCycles = [1,1];
  1139. }
  1140. def: InstRW<[SKXWriteResGroup92], (instregex "VMOVSDZrm(b?)",
  1141. "VMOVSSZrm(b?)")>;
  1142. def SKXWriteResGroup92a : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1143. let Latency = 6;
  1144. let NumMicroOps = 2;
  1145. let ResourceCycles = [1,1];
  1146. }
  1147. def: InstRW<[SKXWriteResGroup92a], (instregex "(V?)PMOV(SX|ZX)BDrm",
  1148. "(V?)PMOV(SX|ZX)BQrm",
  1149. "(V?)PMOV(SX|ZX)BWrm",
  1150. "(V?)PMOV(SX|ZX)DQrm",
  1151. "(V?)PMOV(SX|ZX)WDrm",
  1152. "(V?)PMOV(SX|ZX)WQrm")>;
  1153. def SKXWriteResGroup93 : SchedWriteRes<[SKXPort5,SKXPort01]> {
  1154. let Latency = 7;
  1155. let NumMicroOps = 2;
  1156. let ResourceCycles = [1,1];
  1157. }
  1158. def: InstRW<[SKXWriteResGroup93], (instregex "VCVTDQ2PDZ256rr",
  1159. "VCVTPD2DQ(Y|Z256)rr",
  1160. "VCVTPD2UDQZ256rr",
  1161. "VCVTPS2PD(Y|Z256)rr",
  1162. "VCVTPS2QQZ256rr",
  1163. "VCVTPS2UQQZ256rr",
  1164. "VCVTQQ2PSZ256rr",
  1165. "VCVTTPD2DQ(Y|Z256)rr",
  1166. "VCVTTPD2UDQZ256rr",
  1167. "VCVTTPS2QQZ256rr",
  1168. "VCVTTPS2UQQZ256rr",
  1169. "VCVTUDQ2PDZ256rr",
  1170. "VCVTUQQ2PSZ256rr")>;
  1171. def SKXWriteResGroup93z : SchedWriteRes<[SKXPort5,SKXPort05]> {
  1172. let Latency = 7;
  1173. let NumMicroOps = 2;
  1174. let ResourceCycles = [1,1];
  1175. }
  1176. def: InstRW<[SKXWriteResGroup93z], (instrs VCVTDQ2PDZrr,
  1177. VCVTPD2DQZrr,
  1178. VCVTPD2UDQZrr,
  1179. VCVTPS2PDZrr,
  1180. VCVTPS2QQZrr,
  1181. VCVTPS2UQQZrr,
  1182. VCVTQQ2PSZrr,
  1183. VCVTTPD2DQZrr,
  1184. VCVTTPD2UDQZrr,
  1185. VCVTTPS2QQZrr,
  1186. VCVTTPS2UQQZrr,
  1187. VCVTUDQ2PDZrr,
  1188. VCVTUQQ2PSZrr)>;
  1189. def SKXWriteResGroup95 : SchedWriteRes<[SKXPort23,SKXPort015]> {
  1190. let Latency = 7;
  1191. let NumMicroOps = 2;
  1192. let ResourceCycles = [1,1];
  1193. }
  1194. def: InstRW<[SKXWriteResGroup95], (instrs VMOVNTDQAZ128rm,
  1195. VPBLENDDrmi)>;
  1196. def: InstRW<[SKXWriteResGroup95, ReadAfterVecXLd],
  1197. (instregex "VBLENDMPDZ128rm(b?)",
  1198. "VBLENDMPSZ128rm(b?)",
  1199. "VBROADCASTI32X2Z128rm(b?)",
  1200. "VBROADCASTSSZ128rm(b?)",
  1201. "VINSERT(F|I)128rm",
  1202. "VMOVAPDZ128rm(b?)",
  1203. "VMOVAPSZ128rm(b?)",
  1204. "VMOVDDUPZ128rm(b?)",
  1205. "VMOVDQA32Z128rm(b?)",
  1206. "VMOVDQA64Z128rm(b?)",
  1207. "VMOVDQU16Z128rm(b?)",
  1208. "VMOVDQU32Z128rm(b?)",
  1209. "VMOVDQU64Z128rm(b?)",
  1210. "VMOVDQU8Z128rm(b?)",
  1211. "VMOVSHDUPZ128rm(b?)",
  1212. "VMOVSLDUPZ128rm(b?)",
  1213. "VMOVUPDZ128rm(b?)",
  1214. "VMOVUPSZ128rm(b?)",
  1215. "VPADD(B|D|Q|W)Z128rm(b?)",
  1216. "(V?)PADD(B|D|Q|W)rm",
  1217. "VPBLENDM(B|D|Q|W)Z128rm(b?)",
  1218. "VPBROADCASTDZ128rm(b?)",
  1219. "VPBROADCASTQZ128rm(b?)",
  1220. "VPSUB(B|D|Q|W)Z128rm(b?)",
  1221. "(V?)PSUB(B|D|Q|W)rm",
  1222. "VPTERNLOGDZ128rm(b?)i",
  1223. "VPTERNLOGQZ128rm(b?)i")>;
  1224. def SKXWriteResGroup96 : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1225. let Latency = 7;
  1226. let NumMicroOps = 3;
  1227. let ResourceCycles = [2,1];
  1228. }
  1229. def: InstRW<[SKXWriteResGroup96], (instrs MMX_PACKSSDWrm,
  1230. MMX_PACKSSWBrm,
  1231. MMX_PACKUSWBrm)>;
  1232. def SKXWriteResGroup97 : SchedWriteRes<[SKXPort5,SKXPort015]> {
  1233. let Latency = 7;
  1234. let NumMicroOps = 3;
  1235. let ResourceCycles = [2,1];
  1236. }
  1237. def: InstRW<[SKXWriteResGroup97], (instregex "VPERMI2W128rr",
  1238. "VPERMI2W256rr",
  1239. "VPERMI2Wrr",
  1240. "VPERMT2W128rr",
  1241. "VPERMT2W256rr",
  1242. "VPERMT2Wrr")>;
  1243. def SKXWriteResGroup99 : SchedWriteRes<[SKXPort23,SKXPort0156]> {
  1244. let Latency = 7;
  1245. let NumMicroOps = 3;
  1246. let ResourceCycles = [1,2];
  1247. }
  1248. def: InstRW<[SKXWriteResGroup99], (instrs LEAVE, LEAVE64,
  1249. SCASB, SCASL, SCASQ, SCASW)>;
  1250. def SKXWriteResGroup100 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort01]> {
  1251. let Latency = 7;
  1252. let NumMicroOps = 3;
  1253. let ResourceCycles = [1,1,1];
  1254. }
  1255. def: InstRW<[SKXWriteResGroup100], (instregex "(V?)CVT(T?)SS2SI64(Z?)rr",
  1256. "VCVT(T?)SS2USI64Zrr")>;
  1257. def SKXWriteResGroup101 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort05]> {
  1258. let Latency = 7;
  1259. let NumMicroOps = 3;
  1260. let ResourceCycles = [1,1,1];
  1261. }
  1262. def: InstRW<[SKXWriteResGroup101], (instrs FLDCW16m)>;
  1263. def SKXWriteResGroup103 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort0156]> {
  1264. let Latency = 7;
  1265. let NumMicroOps = 3;
  1266. let ResourceCycles = [1,1,1];
  1267. }
  1268. def: InstRW<[SKXWriteResGroup103], (instregex "KMOV(B|D|Q|W)km")>;
  1269. def SKXWriteResGroup104 : SchedWriteRes<[SKXPort6,SKXPort23,SKXPort0156]> {
  1270. let Latency = 7;
  1271. let NumMicroOps = 3;
  1272. let ResourceCycles = [1,1,1];
  1273. }
  1274. def: InstRW<[SKXWriteResGroup104], (instrs LRET64, RET64)>;
  1275. def SKXWriteResGroup106 : SchedWriteRes<[SKXPort4,SKXPort5,SKXPort237]> {
  1276. let Latency = 7;
  1277. let NumMicroOps = 4;
  1278. let ResourceCycles = [1,2,1];
  1279. }
  1280. def: InstRW<[SKXWriteResGroup106], (instregex "VCOMPRESSPD(Z|Z128|Z256)mr(b?)",
  1281. "VCOMPRESSPS(Z|Z128|Z256)mr(b?)",
  1282. "VPCOMPRESSD(Z|Z128|Z256)mr(b?)",
  1283. "VPCOMPRESSQ(Z|Z128|Z256)mr(b?)")>;
  1284. def SKXWriteResGroup107 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort06]> {
  1285. let Latency = 7;
  1286. let NumMicroOps = 5;
  1287. let ResourceCycles = [1,1,1,2];
  1288. }
  1289. def: InstRW<[SKXWriteResGroup107], (instregex "ROL(8|16|32|64)m(1|i)",
  1290. "ROR(8|16|32|64)m(1|i)")>;
  1291. def SKXWriteResGroup107_1 : SchedWriteRes<[SKXPort06]> {
  1292. let Latency = 2;
  1293. let NumMicroOps = 2;
  1294. let ResourceCycles = [2];
  1295. }
  1296. def: InstRW<[SKXWriteResGroup107_1], (instrs ROL8r1, ROL16r1, ROL32r1, ROL64r1,
  1297. ROR8r1, ROR16r1, ROR32r1, ROR64r1)>;
  1298. def SKXWriteResGroup108 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort0156]> {
  1299. let Latency = 7;
  1300. let NumMicroOps = 5;
  1301. let ResourceCycles = [1,1,1,2];
  1302. }
  1303. def: InstRW<[SKXWriteResGroup108], (instregex "XADD(8|16|32|64)rm")>;
  1304. def SKXWriteResGroup109 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort23,SKXPort237,SKXPort0156]> {
  1305. let Latency = 7;
  1306. let NumMicroOps = 5;
  1307. let ResourceCycles = [1,1,1,1,1];
  1308. }
  1309. def: InstRW<[SKXWriteResGroup109], (instregex "CALL(16|32|64)m")>;
  1310. def: InstRW<[SKXWriteResGroup109], (instrs FARCALL64m)>;
  1311. def SKXWriteResGroup110 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort237,SKXPort0156]> {
  1312. let Latency = 7;
  1313. let NumMicroOps = 7;
  1314. let ResourceCycles = [1,2,2,2];
  1315. }
  1316. def: InstRW<[SKXWriteResGroup110], (instrs VPSCATTERDQZ128mr,
  1317. VPSCATTERQQZ128mr,
  1318. VSCATTERDPDZ128mr,
  1319. VSCATTERQPDZ128mr)>;
  1320. def SKXWriteResGroup111 : SchedWriteRes<[SKXPort6,SKXPort06,SKXPort15,SKXPort0156]> {
  1321. let Latency = 7;
  1322. let NumMicroOps = 7;
  1323. let ResourceCycles = [1,3,1,2];
  1324. }
  1325. def: InstRW<[SKXWriteResGroup111], (instrs LOOP)>;
  1326. def SKXWriteResGroup112 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort237,SKXPort0156]> {
  1327. let Latency = 7;
  1328. let NumMicroOps = 11;
  1329. let ResourceCycles = [1,4,4,2];
  1330. }
  1331. def: InstRW<[SKXWriteResGroup112], (instrs VPSCATTERDQZ256mr,
  1332. VPSCATTERQQZ256mr,
  1333. VSCATTERDPDZ256mr,
  1334. VSCATTERQPDZ256mr)>;
  1335. def SKXWriteResGroup113 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort237,SKXPort0156]> {
  1336. let Latency = 7;
  1337. let NumMicroOps = 19;
  1338. let ResourceCycles = [1,8,8,2];
  1339. }
  1340. def: InstRW<[SKXWriteResGroup113], (instrs VPSCATTERDQZmr,
  1341. VPSCATTERQQZmr,
  1342. VSCATTERDPDZmr,
  1343. VSCATTERQPDZmr)>;
  1344. def SKXWriteResGroup114 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort237,SKXPort0156]> {
  1345. let Latency = 7;
  1346. let NumMicroOps = 36;
  1347. let ResourceCycles = [1,16,1,16,2];
  1348. }
  1349. def: InstRW<[SKXWriteResGroup114], (instrs VSCATTERDPSZmr)>;
  1350. def SKXWriteResGroup118 : SchedWriteRes<[SKXPort1,SKXPort23]> {
  1351. let Latency = 8;
  1352. let NumMicroOps = 2;
  1353. let ResourceCycles = [1,1];
  1354. }
  1355. def: InstRW<[SKXWriteResGroup118], (instregex "PDEP(32|64)rm",
  1356. "PEXT(32|64)rm")>;
  1357. def SKXWriteResGroup119 : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1358. let Latency = 8;
  1359. let NumMicroOps = 2;
  1360. let ResourceCycles = [1,1];
  1361. }
  1362. def: InstRW<[SKXWriteResGroup119], (instregex "FCOM(P?)(32|64)m",
  1363. "VPBROADCASTB(Z|Z256)rm(b?)",
  1364. "VPBROADCASTW(Z|Z256)rm(b?)")>;
  1365. def: InstRW<[SKXWriteResGroup119], (instrs VPBROADCASTBYrm,
  1366. VPBROADCASTWYrm,
  1367. VPMOVSXBDYrm,
  1368. VPMOVSXBQYrm,
  1369. VPMOVSXWQYrm)>;
  1370. def SKXWriteResGroup121 : SchedWriteRes<[SKXPort23,SKXPort015]> {
  1371. let Latency = 8;
  1372. let NumMicroOps = 2;
  1373. let ResourceCycles = [1,1];
  1374. }
  1375. def: InstRW<[SKXWriteResGroup121], (instrs VMOVNTDQAZ256rm,
  1376. VPBLENDDYrmi)>;
  1377. def: InstRW<[SKXWriteResGroup121, ReadAfterVecYLd],
  1378. (instregex "VBLENDMPD(Z|Z256)rm(b?)",
  1379. "VBLENDMPS(Z|Z256)rm(b?)",
  1380. "VBROADCASTF32X2Z256rm(b?)",
  1381. "VBROADCASTF32X2Zrm(b?)",
  1382. "VBROADCASTF32X4Z256rm(b?)",
  1383. "VBROADCASTF32X4rm(b?)",
  1384. "VBROADCASTF32X8rm(b?)",
  1385. "VBROADCASTF64X2Z128rm(b?)",
  1386. "VBROADCASTF64X2rm(b?)",
  1387. "VBROADCASTF64X4rm(b?)",
  1388. "VBROADCASTI32X2Z256rm(b?)",
  1389. "VBROADCASTI32X2Zrm(b?)",
  1390. "VBROADCASTI32X4Z256rm(b?)",
  1391. "VBROADCASTI32X4rm(b?)",
  1392. "VBROADCASTI32X8rm(b?)",
  1393. "VBROADCASTI64X2Z128rm(b?)",
  1394. "VBROADCASTI64X2rm(b?)",
  1395. "VBROADCASTI64X4rm(b?)",
  1396. "VBROADCASTSD(Z|Z256)rm(b?)",
  1397. "VBROADCASTSS(Z|Z256)rm(b?)",
  1398. "VINSERTF32x4(Z|Z256)rm(b?)",
  1399. "VINSERTF32x8Zrm(b?)",
  1400. "VINSERTF64x2(Z|Z256)rm(b?)",
  1401. "VINSERTF64x4Zrm(b?)",
  1402. "VINSERTI32x4(Z|Z256)rm(b?)",
  1403. "VINSERTI32x8Zrm(b?)",
  1404. "VINSERTI64x2(Z|Z256)rm(b?)",
  1405. "VINSERTI64x4Zrm(b?)",
  1406. "VMOVAPD(Z|Z256)rm(b?)",
  1407. "VMOVAPS(Z|Z256)rm(b?)",
  1408. "VMOVDDUP(Z|Z256)rm(b?)",
  1409. "VMOVDQA32(Z|Z256)rm(b?)",
  1410. "VMOVDQA64(Z|Z256)rm(b?)",
  1411. "VMOVDQU16(Z|Z256)rm(b?)",
  1412. "VMOVDQU32(Z|Z256)rm(b?)",
  1413. "VMOVDQU64(Z|Z256)rm(b?)",
  1414. "VMOVDQU8(Z|Z256)rm(b?)",
  1415. "VMOVSHDUP(Z|Z256)rm(b?)",
  1416. "VMOVSLDUP(Z|Z256)rm(b?)",
  1417. "VMOVUPD(Z|Z256)rm(b?)",
  1418. "VMOVUPS(Z|Z256)rm(b?)",
  1419. "VPADD(B|D|Q|W)Yrm",
  1420. "VPADD(B|D|Q|W)(Z|Z256)rm(b?)",
  1421. "VPBLENDM(B|D|Q|W)(Z|Z256)rm(b?)",
  1422. "VPBROADCASTD(Z|Z256)rm(b?)",
  1423. "VPBROADCASTQ(Z|Z256)rm(b?)",
  1424. "VPSUB(B|D|Q|W)Yrm",
  1425. "VPSUB(B|D|Q|W)(Z|Z256)rm(b?)",
  1426. "VPTERNLOGD(Z|Z256)rm(b?)i",
  1427. "VPTERNLOGQ(Z|Z256)rm(b?)i")>;
  1428. def SKXWriteResGroup123 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
  1429. let Latency = 8;
  1430. let NumMicroOps = 4;
  1431. let ResourceCycles = [1,2,1];
  1432. }
  1433. def: InstRW<[SKXWriteResGroup123], (instregex "MMX_PH(ADD|SUB)SWrm")>;
  1434. def SKXWriteResGroup127 : SchedWriteRes<[SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
  1435. let Latency = 8;
  1436. let NumMicroOps = 5;
  1437. let ResourceCycles = [1,1,1,2];
  1438. }
  1439. def: InstRW<[SKXWriteResGroup127], (instregex "RCL(8|16|32|64)m(1|i)",
  1440. "RCR(8|16|32|64)m(1|i)")>;
  1441. def SKXWriteResGroup128 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort06]> {
  1442. let Latency = 8;
  1443. let NumMicroOps = 6;
  1444. let ResourceCycles = [1,1,1,3];
  1445. }
  1446. def: InstRW<[SKXWriteResGroup128], (instregex "ROL(8|16|32|64)mCL",
  1447. "ROR(8|16|32|64)mCL",
  1448. "SAR(8|16|32|64)mCL",
  1449. "SHL(8|16|32|64)mCL",
  1450. "SHR(8|16|32|64)mCL")>;
  1451. def SKXWriteResGroup130 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
  1452. let Latency = 8;
  1453. let NumMicroOps = 6;
  1454. let ResourceCycles = [1,1,1,2,1];
  1455. }
  1456. def: SchedAlias<WriteADCRMW, SKXWriteResGroup130>;
  1457. def SKXWriteResGroup131 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort237,SKXPort0156]> {
  1458. let Latency = 8;
  1459. let NumMicroOps = 8;
  1460. let ResourceCycles = [1,2,1,2,2];
  1461. }
  1462. def: InstRW<[SKXWriteResGroup131], (instrs VPSCATTERQDZ128mr,
  1463. VPSCATTERQDZ256mr,
  1464. VSCATTERQPSZ128mr,
  1465. VSCATTERQPSZ256mr)>;
  1466. def SKXWriteResGroup132 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort237,SKXPort0156]> {
  1467. let Latency = 8;
  1468. let NumMicroOps = 12;
  1469. let ResourceCycles = [1,4,1,4,2];
  1470. }
  1471. def: InstRW<[SKXWriteResGroup132], (instrs VPSCATTERDDZ128mr,
  1472. VSCATTERDPSZ128mr)>;
  1473. def SKXWriteResGroup133 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort237,SKXPort0156]> {
  1474. let Latency = 8;
  1475. let NumMicroOps = 20;
  1476. let ResourceCycles = [1,8,1,8,2];
  1477. }
  1478. def: InstRW<[SKXWriteResGroup133], (instrs VPSCATTERDDZ256mr,
  1479. VSCATTERDPSZ256mr)>;
  1480. def SKXWriteResGroup134 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort237,SKXPort0156]> {
  1481. let Latency = 8;
  1482. let NumMicroOps = 36;
  1483. let ResourceCycles = [1,16,1,16,2];
  1484. }
  1485. def: InstRW<[SKXWriteResGroup134], (instrs VPSCATTERDDZmr)>;
  1486. def SKXWriteResGroup135 : SchedWriteRes<[SKXPort0,SKXPort23]> {
  1487. let Latency = 9;
  1488. let NumMicroOps = 2;
  1489. let ResourceCycles = [1,1];
  1490. }
  1491. def: InstRW<[SKXWriteResGroup135], (instrs MMX_CVTPI2PSrm)>;
  1492. def SKXWriteResGroup136 : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1493. let Latency = 9;
  1494. let NumMicroOps = 2;
  1495. let ResourceCycles = [1,1];
  1496. }
  1497. def: InstRW<[SKXWriteResGroup136], (instrs VPMOVSXBWYrm,
  1498. VPMOVSXDQYrm,
  1499. VPMOVSXWDYrm,
  1500. VPMOVZXWDYrm)>;
  1501. def: InstRW<[SKXWriteResGroup136], (instregex "VALIGN(D|Q)Z128rm(b?)i",
  1502. "VFPCLASSSDZrm(b?)",
  1503. "VFPCLASSSSZrm(b?)",
  1504. "(V?)PCMPGTQrm",
  1505. "VPERMI2D128rm(b?)",
  1506. "VPERMI2PD128rm(b?)",
  1507. "VPERMI2PS128rm(b?)",
  1508. "VPERMI2Q128rm(b?)",
  1509. "VPERMT2D128rm(b?)",
  1510. "VPERMT2PD128rm(b?)",
  1511. "VPERMT2PS128rm(b?)",
  1512. "VPERMT2Q128rm(b?)",
  1513. "VPMAXSQZ128rm(b?)",
  1514. "VPMAXUQZ128rm(b?)",
  1515. "VPMINSQZ128rm(b?)",
  1516. "VPMINUQZ128rm(b?)")>;
  1517. def SKXWriteResGroup136_2 : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1518. let Latency = 10;
  1519. let NumMicroOps = 2;
  1520. let ResourceCycles = [1,1];
  1521. }
  1522. def: InstRW<[SKXWriteResGroup136_2], (instregex "VCMP(PD|PS)Z128rm(b?)i",
  1523. "VCMP(SD|SS)Zrm",
  1524. "VFPCLASSPDZ128rm(b?)",
  1525. "VFPCLASSPSZ128rm(b?)",
  1526. "VPCMPBZ128rmi(b?)",
  1527. "VPCMPDZ128rmi(b?)",
  1528. "VPCMPEQ(B|D|Q|W)Z128rm(b?)",
  1529. "VPCMPGT(B|D|Q|W)Z128rm(b?)",
  1530. "VPCMPQZ128rmi(b?)",
  1531. "VPCMPU(B|D|Q|W)Z128rmi(b?)",
  1532. "VPCMPWZ128rmi(b?)",
  1533. "VPTESTMBZ128rm(b?)",
  1534. "VPTESTMDZ128rm(b?)",
  1535. "VPTESTMQZ128rm(b?)",
  1536. "VPTESTMWZ128rm(b?)",
  1537. "VPTESTNMBZ128rm(b?)",
  1538. "VPTESTNMDZ128rm(b?)",
  1539. "VPTESTNMQZ128rm(b?)",
  1540. "VPTESTNMWZ128rm(b?)")>;
  1541. def SKXWriteResGroup137 : SchedWriteRes<[SKXPort23,SKXPort01]> {
  1542. let Latency = 9;
  1543. let NumMicroOps = 2;
  1544. let ResourceCycles = [1,1];
  1545. }
  1546. def: InstRW<[SKXWriteResGroup137], (instregex "MMX_CVT(T?)PS2PIrm",
  1547. "(V?)CVTPS2PDrm")>;
  1548. def SKXWriteResGroup143 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort23]> {
  1549. let Latency = 9;
  1550. let NumMicroOps = 4;
  1551. let ResourceCycles = [2,1,1];
  1552. }
  1553. def: InstRW<[SKXWriteResGroup143], (instregex "(V?)PHADDSWrm",
  1554. "(V?)PHSUBSWrm")>;
  1555. def SKXWriteResGroup146 : SchedWriteRes<[SKXPort1,SKXPort6,SKXPort23,SKXPort0156]> {
  1556. let Latency = 9;
  1557. let NumMicroOps = 5;
  1558. let ResourceCycles = [1,2,1,1];
  1559. }
  1560. def: InstRW<[SKXWriteResGroup146], (instregex "LAR(16|32|64)rm",
  1561. "LSL(16|32|64)rm")>;
  1562. def SKXWriteResGroup148 : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1563. let Latency = 10;
  1564. let NumMicroOps = 2;
  1565. let ResourceCycles = [1,1];
  1566. }
  1567. def: InstRW<[SKXWriteResGroup148], (instrs VPCMPGTQYrm)>;
  1568. def: InstRW<[SKXWriteResGroup148], (instregex "(ADD|SUB|SUBR)_F(32|64)m",
  1569. "ILD_F(16|32|64)m",
  1570. "VALIGND(Z|Z256)rm(b?)i",
  1571. "VALIGNQ(Z|Z256)rm(b?)i",
  1572. "VPMAXSQ(Z|Z256)rm(b?)",
  1573. "VPMAXUQ(Z|Z256)rm(b?)",
  1574. "VPMINSQ(Z|Z256)rm(b?)",
  1575. "VPMINUQ(Z|Z256)rm(b?)")>;
  1576. def SKXWriteResGroup148_2 : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1577. let Latency = 11;
  1578. let NumMicroOps = 2;
  1579. let ResourceCycles = [1,1];
  1580. }
  1581. def: InstRW<[SKXWriteResGroup148_2], (instregex "VCMPPD(Z|Z256)rm(b?)i",
  1582. "VCMPPS(Z|Z256)rm(b?)i",
  1583. "VFPCLASSPD(Z|Z256)rm(b?)",
  1584. "VFPCLASSPS(Z|Z256)rm(b?)",
  1585. "VPCMPB(Z|Z256)rmi(b?)",
  1586. "VPCMPD(Z|Z256)rmi(b?)",
  1587. "VPCMPEQB(Z|Z256)rm(b?)",
  1588. "VPCMPEQD(Z|Z256)rm(b?)",
  1589. "VPCMPEQQ(Z|Z256)rm(b?)",
  1590. "VPCMPEQW(Z|Z256)rm(b?)",
  1591. "VPCMPGTB(Z|Z256)rm(b?)",
  1592. "VPCMPGTD(Z|Z256)rm(b?)",
  1593. "VPCMPGTQ(Z|Z256)rm(b?)",
  1594. "VPCMPGTW(Z|Z256)rm(b?)",
  1595. "VPCMPQ(Z|Z256)rmi(b?)",
  1596. "VPCMPU(B|D|Q|W)Z256rmi(b?)",
  1597. "VPCMPU(B|D|Q|W)Zrmi(b?)",
  1598. "VPCMPW(Z|Z256)rmi(b?)",
  1599. "VPTESTM(B|D|Q|W)Z256rm(b?)",
  1600. "VPTESTM(B|D|Q|W)Zrm(b?)",
  1601. "VPTESTNM(B|D|Q|W)Z256rm(b?)",
  1602. "VPTESTNM(B|D|Q|W)Zrm(b?)")>;
  1603. def SKXWriteResGroup149 : SchedWriteRes<[SKXPort23,SKXPort01]> {
  1604. let Latency = 10;
  1605. let NumMicroOps = 2;
  1606. let ResourceCycles = [1,1];
  1607. }
  1608. def: InstRW<[SKXWriteResGroup149], (instregex "VCVTDQ2PDZ128rm(b?)",
  1609. "VCVTDQ2PSZ128rm(b?)",
  1610. "(V?)CVTDQ2PSrm",
  1611. "VCVTPD2QQZ128rm(b?)",
  1612. "VCVTPD2UQQZ128rm(b?)",
  1613. "VCVTPH2PSZ128rm(b?)",
  1614. "VCVTPS2DQZ128rm(b?)",
  1615. "(V?)CVTPS2DQrm",
  1616. "VCVTPS2PDZ128rm(b?)",
  1617. "VCVTPS2QQZ128rm(b?)",
  1618. "VCVTPS2UDQZ128rm(b?)",
  1619. "VCVTPS2UQQZ128rm(b?)",
  1620. "VCVTQQ2PDZ128rm(b?)",
  1621. "VCVTQQ2PSZ128rm(b?)",
  1622. "VCVTSS2SDZrm",
  1623. "(V?)CVTSS2SDrm",
  1624. "VCVTTPD2QQZ128rm(b?)",
  1625. "VCVTTPD2UQQZ128rm(b?)",
  1626. "VCVTTPS2DQZ128rm(b?)",
  1627. "(V?)CVTTPS2DQrm",
  1628. "VCVTTPS2QQZ128rm(b?)",
  1629. "VCVTTPS2UDQZ128rm(b?)",
  1630. "VCVTTPS2UQQZ128rm(b?)",
  1631. "VCVTUDQ2PDZ128rm(b?)",
  1632. "VCVTUDQ2PSZ128rm(b?)",
  1633. "VCVTUQQ2PDZ128rm(b?)",
  1634. "VCVTUQQ2PSZ128rm(b?)")>;
  1635. def SKXWriteResGroup151 : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1636. let Latency = 10;
  1637. let NumMicroOps = 3;
  1638. let ResourceCycles = [2,1];
  1639. }
  1640. def: InstRW<[SKXWriteResGroup151], (instregex "VEXPANDPDZ128rm(b?)",
  1641. "VEXPANDPSZ128rm(b?)",
  1642. "VPEXPANDDZ128rm(b?)",
  1643. "VPEXPANDQZ128rm(b?)")>;
  1644. def SKXWriteResGroup154 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort23]> {
  1645. let Latency = 10;
  1646. let NumMicroOps = 4;
  1647. let ResourceCycles = [2,1,1];
  1648. }
  1649. def: InstRW<[SKXWriteResGroup154], (instrs VPHADDSWYrm,
  1650. VPHSUBSWYrm)>;
  1651. def SKXWriteResGroup157 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
  1652. let Latency = 10;
  1653. let NumMicroOps = 8;
  1654. let ResourceCycles = [1,1,1,1,1,3];
  1655. }
  1656. def: InstRW<[SKXWriteResGroup157], (instregex "XCHG(8|16|32|64)rm")>;
  1657. def SKXWriteResGroup160 : SchedWriteRes<[SKXPort0,SKXPort23]> {
  1658. let Latency = 11;
  1659. let NumMicroOps = 2;
  1660. let ResourceCycles = [1,1];
  1661. }
  1662. def: InstRW<[SKXWriteResGroup160], (instregex "MUL_F(32|64)m")>;
  1663. def SKXWriteResGroup161 : SchedWriteRes<[SKXPort23,SKXPort01]> {
  1664. let Latency = 11;
  1665. let NumMicroOps = 2;
  1666. let ResourceCycles = [1,1];
  1667. }
  1668. def: InstRW<[SKXWriteResGroup161], (instrs VCVTDQ2PSYrm,
  1669. VCVTPS2PDYrm)>;
  1670. def: InstRW<[SKXWriteResGroup161], (instregex "VCVTDQ2(PD|PS)(Z|Z256)rm(b?)",
  1671. "VCVTPH2PS(Z|Z256)rm(b?)",
  1672. "VCVTPS2PD(Z|Z256)rm(b?)",
  1673. "VCVTQQ2PD(Z|Z256)rm(b?)",
  1674. "VCVTQQ2PSZ256rm(b?)",
  1675. "VCVT(T?)PD2QQ(Z|Z256)rm(b?)",
  1676. "VCVT(T?)PD2UQQ(Z|Z256)rm(b?)",
  1677. "VCVT(T?)PS2DQYrm",
  1678. "VCVT(T?)PS2DQ(Z|Z256)rm(b?)",
  1679. "VCVT(T?)PS2QQZ256rm(b?)",
  1680. "VCVT(T?)PS2UDQ(Z|Z256)rm(b?)",
  1681. "VCVT(T?)PS2UQQZ256rm(b?)",
  1682. "VCVTUDQ2(PD|PS)(Z|Z256)rm(b?)",
  1683. "VCVTUQQ2PD(Z|Z256)rm(b?)",
  1684. "VCVTUQQ2PSZ256rm(b?)")>;
  1685. def SKXWriteResGroup162 : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1686. let Latency = 11;
  1687. let NumMicroOps = 3;
  1688. let ResourceCycles = [2,1];
  1689. }
  1690. def: InstRW<[SKXWriteResGroup162], (instregex "FICOM(P?)(16|32)m",
  1691. "VEXPANDPD(Z|Z256)rm(b?)",
  1692. "VEXPANDPS(Z|Z256)rm(b?)",
  1693. "VPEXPANDD(Z|Z256)rm(b?)",
  1694. "VPEXPANDQ(Z|Z256)rm(b?)")>;
  1695. def SKXWriteResGroup164 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
  1696. let Latency = 11;
  1697. let NumMicroOps = 3;
  1698. let ResourceCycles = [1,1,1];
  1699. }
  1700. def: InstRW<[SKXWriteResGroup164], (instregex "(V?)CVTDQ2PDrm")>;
  1701. def SKXWriteResGroup166 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort01]> {
  1702. let Latency = 11;
  1703. let NumMicroOps = 3;
  1704. let ResourceCycles = [1,1,1];
  1705. }
  1706. def: InstRW<[SKXWriteResGroup166], (instrs CVTPD2DQrm,
  1707. CVTTPD2DQrm,
  1708. MMX_CVTPD2PIrm,
  1709. MMX_CVTTPD2PIrm)>;
  1710. def SKXWriteResGroup167 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort015]> {
  1711. let Latency = 11;
  1712. let NumMicroOps = 4;
  1713. let ResourceCycles = [2,1,1];
  1714. }
  1715. def: InstRW<[SKXWriteResGroup167], (instregex "VPCONFLICTQZ128rm(b?)")>;
  1716. def SKXWriteResGroup169 : SchedWriteRes<[SKXPort1,SKXPort06,SKXPort0156]> {
  1717. let Latency = 11;
  1718. let NumMicroOps = 7;
  1719. let ResourceCycles = [2,3,2];
  1720. }
  1721. def: InstRW<[SKXWriteResGroup169], (instregex "RCL(16|32|64)rCL",
  1722. "RCR(16|32|64)rCL")>;
  1723. def SKXWriteResGroup170 : SchedWriteRes<[SKXPort1,SKXPort06,SKXPort15,SKXPort0156]> {
  1724. let Latency = 11;
  1725. let NumMicroOps = 9;
  1726. let ResourceCycles = [1,5,1,2];
  1727. }
  1728. def: InstRW<[SKXWriteResGroup170], (instrs RCL8rCL)>;
  1729. def SKXWriteResGroup171 : SchedWriteRes<[SKXPort06,SKXPort0156]> {
  1730. let Latency = 11;
  1731. let NumMicroOps = 11;
  1732. let ResourceCycles = [2,9];
  1733. }
  1734. def: InstRW<[SKXWriteResGroup171], (instrs LOOPE, LOOPNE)>;
  1735. def SKXWriteResGroup174 : SchedWriteRes<[SKXPort01]> {
  1736. let Latency = 15;
  1737. let NumMicroOps = 3;
  1738. let ResourceCycles = [3];
  1739. }
  1740. def: InstRW<[SKXWriteResGroup174], (instregex "VPMULLQ(Z128|Z256)rr")>;
  1741. def SKXWriteResGroup174z : SchedWriteRes<[SKXPort05]> {
  1742. let Latency = 15;
  1743. let NumMicroOps = 3;
  1744. let ResourceCycles = [3];
  1745. }
  1746. def: InstRW<[SKXWriteResGroup174z], (instregex "VPMULLQZrr")>;
  1747. def SKXWriteResGroup175 : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1748. let Latency = 12;
  1749. let NumMicroOps = 3;
  1750. let ResourceCycles = [2,1];
  1751. }
  1752. def: InstRW<[SKXWriteResGroup175], (instregex "VPERMWZ128rm(b?)")>;
  1753. def SKXWriteResGroup176 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort01]> {
  1754. let Latency = 12;
  1755. let NumMicroOps = 3;
  1756. let ResourceCycles = [1,1,1];
  1757. }
  1758. def: InstRW<[SKXWriteResGroup176], (instregex "VCVT(T?)SD2USIZrm(b?)",
  1759. "VCVT(T?)SS2USI64Zrm(b?)")>;
  1760. def SKXWriteResGroup177 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort01]> {
  1761. let Latency = 12;
  1762. let NumMicroOps = 3;
  1763. let ResourceCycles = [1,1,1];
  1764. }
  1765. def: InstRW<[SKXWriteResGroup177], (instregex "VCVT(T?)PS2QQZrm(b?)",
  1766. "VCVT(T?)PS2UQQZrm(b?)")>;
  1767. def SKXWriteResGroup180 : SchedWriteRes<[SKXPort5,SKXPort23]> {
  1768. let Latency = 13;
  1769. let NumMicroOps = 3;
  1770. let ResourceCycles = [2,1];
  1771. }
  1772. def: InstRW<[SKXWriteResGroup180], (instregex "(ADD|SUB|SUBR)_FI(16|32)m",
  1773. "VPERMWZ256rm(b?)",
  1774. "VPERMWZrm(b?)")>;
  1775. def SKXWriteResGroup181 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
  1776. let Latency = 13;
  1777. let NumMicroOps = 3;
  1778. let ResourceCycles = [1,1,1];
  1779. }
  1780. def: InstRW<[SKXWriteResGroup181], (instrs VCVTDQ2PDYrm)>;
  1781. def SKXWriteResGroup183 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort015]> {
  1782. let Latency = 13;
  1783. let NumMicroOps = 4;
  1784. let ResourceCycles = [2,1,1];
  1785. }
  1786. def: InstRW<[SKXWriteResGroup183], (instregex "VPERMI2W128rm(b?)",
  1787. "VPERMT2W128rm(b?)")>;
  1788. def SKXWriteResGroup187 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
  1789. let Latency = 14;
  1790. let NumMicroOps = 3;
  1791. let ResourceCycles = [1,1,1];
  1792. }
  1793. def: InstRW<[SKXWriteResGroup187], (instregex "MUL_FI(16|32)m")>;
  1794. def SKXWriteResGroup188 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort01]> {
  1795. let Latency = 14;
  1796. let NumMicroOps = 3;
  1797. let ResourceCycles = [1,1,1];
  1798. }
  1799. def: InstRW<[SKXWriteResGroup188], (instregex "VCVTPD2DQZrm(b?)",
  1800. "VCVTPD2UDQZrm(b?)",
  1801. "VCVTQQ2PSZrm(b?)",
  1802. "VCVTTPD2DQZrm(b?)",
  1803. "VCVTTPD2UDQZrm(b?)",
  1804. "VCVTUQQ2PSZrm(b?)")>;
  1805. def SKXWriteResGroup189 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort015]> {
  1806. let Latency = 14;
  1807. let NumMicroOps = 4;
  1808. let ResourceCycles = [2,1,1];
  1809. }
  1810. def: InstRW<[SKXWriteResGroup189], (instregex "VPERMI2W256rm(b?)",
  1811. "VPERMI2Wrm(b?)",
  1812. "VPERMT2W256rm(b?)",
  1813. "VPERMT2Wrm(b?)")>;
  1814. def SKXWriteResGroup190 : SchedWriteRes<[SKXPort1,SKXPort06,SKXPort15,SKXPort0156]> {
  1815. let Latency = 14;
  1816. let NumMicroOps = 10;
  1817. let ResourceCycles = [2,4,1,3];
  1818. }
  1819. def: InstRW<[SKXWriteResGroup190], (instrs RCR8rCL)>;
  1820. def SKXWriteResGroup191 : SchedWriteRes<[SKXPort0]> {
  1821. let Latency = 15;
  1822. let NumMicroOps = 1;
  1823. let ResourceCycles = [1];
  1824. }
  1825. def: InstRW<[SKXWriteResGroup191], (instregex "DIVR_(FPrST0|FST0r|FrST0)")>;
  1826. def SKXWriteResGroup194 : SchedWriteRes<[SKXPort1,SKXPort5,SKXPort01,SKXPort23,SKXPort015]> {
  1827. let Latency = 15;
  1828. let NumMicroOps = 8;
  1829. let ResourceCycles = [1,2,2,1,2];
  1830. }
  1831. def: InstRW<[SKXWriteResGroup194], (instregex "VPCONFLICTDZ128rm(b?)")>;
  1832. def SKXWriteResGroup195 : SchedWriteRes<[SKXPort1,SKXPort23,SKXPort237,SKXPort06,SKXPort15,SKXPort0156]> {
  1833. let Latency = 15;
  1834. let NumMicroOps = 10;
  1835. let ResourceCycles = [1,1,1,5,1,1];
  1836. }
  1837. def: InstRW<[SKXWriteResGroup195], (instregex "RCL(8|16|32|64)mCL")>;
  1838. def SKXWriteResGroup199 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort06,SKXPort15,SKXPort0156]> {
  1839. let Latency = 16;
  1840. let NumMicroOps = 14;
  1841. let ResourceCycles = [1,1,1,4,2,5];
  1842. }
  1843. def: InstRW<[SKXWriteResGroup199], (instrs CMPXCHG8B)>;
  1844. def SKXWriteResGroup200 : SchedWriteRes<[SKXPort1, SKXPort05, SKXPort6]> {
  1845. let Latency = 12;
  1846. let NumMicroOps = 34;
  1847. let ResourceCycles = [1, 4, 5];
  1848. }
  1849. def: InstRW<[SKXWriteResGroup200], (instrs VZEROALL)>;
  1850. def SKXWriteResGroup202 : SchedWriteRes<[SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort05,SKXPort0156]> {
  1851. let Latency = 17;
  1852. let NumMicroOps = 15;
  1853. let ResourceCycles = [2,1,2,4,2,4];
  1854. }
  1855. def: InstRW<[SKXWriteResGroup202], (instrs XCH_F)>;
  1856. def SKXWriteResGroup205 : SchedWriteRes<[SKXPort23,SKXPort01]> {
  1857. let Latency = 21;
  1858. let NumMicroOps = 4;
  1859. let ResourceCycles = [1,3];
  1860. }
  1861. def: InstRW<[SKXWriteResGroup205], (instregex "VPMULLQZ128rm(b?)")>;
  1862. def SKXWriteResGroup207 : SchedWriteRes<[SKXPort5,SKXPort6,SKXPort06,SKXPort0156]> {
  1863. let Latency = 18;
  1864. let NumMicroOps = 8;
  1865. let ResourceCycles = [1,1,1,5];
  1866. }
  1867. def: InstRW<[SKXWriteResGroup207], (instrs CPUID, RDTSC)>;
  1868. def SKXWriteResGroup208 : SchedWriteRes<[SKXPort1,SKXPort23,SKXPort237,SKXPort06,SKXPort15,SKXPort0156]> {
  1869. let Latency = 18;
  1870. let NumMicroOps = 11;
  1871. let ResourceCycles = [2,1,1,4,1,2];
  1872. }
  1873. def: InstRW<[SKXWriteResGroup208], (instregex "RCR(8|16|32|64)mCL")>;
  1874. def SKXWriteResGroup211 : SchedWriteRes<[SKXPort23,SKXPort01]> {
  1875. let Latency = 22;
  1876. let NumMicroOps = 4;
  1877. let ResourceCycles = [1,3];
  1878. }
  1879. def: InstRW<[SKXWriteResGroup211], (instregex "VPMULLQZ256rm(b?)")>;
  1880. def SKXWriteResGroup211_1 : SchedWriteRes<[SKXPort23,SKXPort05]> {
  1881. let Latency = 22;
  1882. let NumMicroOps = 4;
  1883. let ResourceCycles = [1,3];
  1884. }
  1885. def: InstRW<[SKXWriteResGroup211_1], (instregex "VPMULLQZrm(b?)")>;
  1886. def SKXWriteResGroup215 : SchedWriteRes<[SKXPort0]> {
  1887. let Latency = 20;
  1888. let NumMicroOps = 1;
  1889. let ResourceCycles = [1];
  1890. }
  1891. def: InstRW<[SKXWriteResGroup215], (instregex "DIV_(FPrST0|FST0r|FrST0)")>;
  1892. def SKXWriteGatherEVEX2 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort015,SKXPort0156]> {
  1893. let Latency = 17;
  1894. let NumMicroOps = 5; // 2 uops perform multiple loads
  1895. let ResourceCycles = [1,2,1,1];
  1896. }
  1897. def: InstRW<[SKXWriteGatherEVEX2], (instrs VGATHERQPSZ128rm, VPGATHERQDZ128rm,
  1898. VGATHERDPDZ128rm, VPGATHERDQZ128rm,
  1899. VGATHERQPDZ128rm, VPGATHERQQZ128rm)>;
  1900. def SKXWriteGatherEVEX4 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort015,SKXPort0156]> {
  1901. let Latency = 19;
  1902. let NumMicroOps = 5; // 2 uops perform multiple loads
  1903. let ResourceCycles = [1,4,1,1];
  1904. }
  1905. def: InstRW<[SKXWriteGatherEVEX4], (instrs VGATHERQPSZ256rm, VPGATHERQDZ256rm,
  1906. VGATHERQPDZ256rm, VPGATHERQQZ256rm,
  1907. VGATHERDPSZ128rm, VPGATHERDDZ128rm,
  1908. VGATHERDPDZ256rm, VPGATHERDQZ256rm)>;
  1909. def SKXWriteGatherEVEX8 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort015,SKXPort0156]> {
  1910. let Latency = 21;
  1911. let NumMicroOps = 5; // 2 uops perform multiple loads
  1912. let ResourceCycles = [1,8,1,1];
  1913. }
  1914. def: InstRW<[SKXWriteGatherEVEX8], (instrs VGATHERDPSZ256rm, VPGATHERDDZ256rm,
  1915. VGATHERDPDZrm, VPGATHERDQZrm,
  1916. VGATHERQPDZrm, VPGATHERQQZrm,
  1917. VGATHERQPSZrm, VPGATHERQDZrm)>;
  1918. def SKXWriteGatherEVEX16 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort015,SKXPort0156]> {
  1919. let Latency = 25;
  1920. let NumMicroOps = 5; // 2 uops perform multiple loads
  1921. let ResourceCycles = [1,16,1,1];
  1922. }
  1923. def: InstRW<[SKXWriteGatherEVEX16], (instrs VGATHERDPSZrm, VPGATHERDDZrm)>;
  1924. def SKXWriteResGroup219 : SchedWriteRes<[SKXPort4,SKXPort5,SKXPort6,SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
  1925. let Latency = 20;
  1926. let NumMicroOps = 8;
  1927. let ResourceCycles = [1,1,1,1,1,1,2];
  1928. }
  1929. def: InstRW<[SKXWriteResGroup219], (instrs INSB, INSL, INSW)>;
  1930. def SKXWriteResGroup220 : SchedWriteRes<[SKXPort5,SKXPort6,SKXPort0156]> {
  1931. let Latency = 20;
  1932. let NumMicroOps = 10;
  1933. let ResourceCycles = [1,2,7];
  1934. }
  1935. def: InstRW<[SKXWriteResGroup220], (instrs MWAITrr)>;
  1936. def SKXWriteResGroup223 : SchedWriteRes<[SKXPort0,SKXPort23]> {
  1937. let Latency = 22;
  1938. let NumMicroOps = 2;
  1939. let ResourceCycles = [1,1];
  1940. }
  1941. def: InstRW<[SKXWriteResGroup223], (instregex "DIV_F(32|64)m")>;
  1942. def SKXWriteResGroupVEX2 : SchedWriteRes<[SKXPort0, SKXPort23, SKXPort5, SKXPort015]> {
  1943. let Latency = 18;
  1944. let NumMicroOps = 5; // 2 uops perform multiple loads
  1945. let ResourceCycles = [1,2,1,1];
  1946. }
  1947. def: InstRW<[SKXWriteResGroupVEX2], (instrs VGATHERDPDrm, VPGATHERDQrm,
  1948. VGATHERQPDrm, VPGATHERQQrm,
  1949. VGATHERQPSrm, VPGATHERQDrm)>;
  1950. def SKXWriteResGroupVEX4 : SchedWriteRes<[SKXPort0, SKXPort23, SKXPort5, SKXPort015]> {
  1951. let Latency = 20;
  1952. let NumMicroOps = 5; // 2 uops peform multiple loads
  1953. let ResourceCycles = [1,4,1,1];
  1954. }
  1955. def: InstRW<[SKXWriteResGroupVEX4], (instrs VGATHERDPDYrm, VPGATHERDQYrm,
  1956. VGATHERDPSrm, VPGATHERDDrm,
  1957. VGATHERQPDYrm, VPGATHERQQYrm,
  1958. VGATHERQPSYrm, VPGATHERQDYrm)>;
  1959. def SKXWriteResGroupVEX8 : SchedWriteRes<[SKXPort0, SKXPort23, SKXPort5, SKXPort015]> {
  1960. let Latency = 22;
  1961. let NumMicroOps = 5; // 2 uops perform multiple loads
  1962. let ResourceCycles = [1,8,1,1];
  1963. }
  1964. def: InstRW<[SKXWriteResGroupVEX8], (instrs VGATHERDPSYrm, VPGATHERDDYrm)>;
  1965. def SKXWriteResGroup225 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort015]> {
  1966. let Latency = 22;
  1967. let NumMicroOps = 14;
  1968. let ResourceCycles = [5,5,4];
  1969. }
  1970. def: InstRW<[SKXWriteResGroup225], (instregex "VPCONFLICTDZ128rr",
  1971. "VPCONFLICTQZ256rr")>;
  1972. def SKXWriteResGroup228 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
  1973. let Latency = 23;
  1974. let NumMicroOps = 19;
  1975. let ResourceCycles = [2,1,4,1,1,4,6];
  1976. }
  1977. def: InstRW<[SKXWriteResGroup228], (instrs CMPXCHG16B)>;
  1978. def SKXWriteResGroup233 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
  1979. let Latency = 25;
  1980. let NumMicroOps = 3;
  1981. let ResourceCycles = [1,1,1];
  1982. }
  1983. def: InstRW<[SKXWriteResGroup233], (instregex "DIV_FI(16|32)m")>;
  1984. def SKXWriteResGroup239 : SchedWriteRes<[SKXPort0,SKXPort23]> {
  1985. let Latency = 27;
  1986. let NumMicroOps = 2;
  1987. let ResourceCycles = [1,1];
  1988. }
  1989. def: InstRW<[SKXWriteResGroup239], (instregex "DIVR_F(32|64)m")>;
  1990. def SKXWriteResGroup242 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort23,SKXPort015]> {
  1991. let Latency = 29;
  1992. let NumMicroOps = 15;
  1993. let ResourceCycles = [5,5,1,4];
  1994. }
  1995. def: InstRW<[SKXWriteResGroup242], (instregex "VPCONFLICTQZ256rm(b?)")>;
  1996. def SKXWriteResGroup243 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
  1997. let Latency = 30;
  1998. let NumMicroOps = 3;
  1999. let ResourceCycles = [1,1,1];
  2000. }
  2001. def: InstRW<[SKXWriteResGroup243], (instregex "DIVR_FI(16|32)m")>;
  2002. def SKXWriteResGroup247 : SchedWriteRes<[SKXPort5,SKXPort6,SKXPort23,SKXPort06,SKXPort0156]> {
  2003. let Latency = 35;
  2004. let NumMicroOps = 23;
  2005. let ResourceCycles = [1,5,3,4,10];
  2006. }
  2007. def: InstRW<[SKXWriteResGroup247], (instregex "IN(8|16|32)ri",
  2008. "IN(8|16|32)rr")>;
  2009. def SKXWriteResGroup248 : SchedWriteRes<[SKXPort5,SKXPort6,SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
  2010. let Latency = 35;
  2011. let NumMicroOps = 23;
  2012. let ResourceCycles = [1,5,2,1,4,10];
  2013. }
  2014. def: InstRW<[SKXWriteResGroup248], (instregex "OUT(8|16|32)ir",
  2015. "OUT(8|16|32)rr")>;
  2016. def SKXWriteResGroup249 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort015]> {
  2017. let Latency = 37;
  2018. let NumMicroOps = 21;
  2019. let ResourceCycles = [9,7,5];
  2020. }
  2021. def: InstRW<[SKXWriteResGroup249], (instregex "VPCONFLICTDZ256rr",
  2022. "VPCONFLICTQZrr")>;
  2023. def SKXWriteResGroup250 : SchedWriteRes<[SKXPort1,SKXPort6,SKXPort23,SKXPort0156]> {
  2024. let Latency = 37;
  2025. let NumMicroOps = 31;
  2026. let ResourceCycles = [1,8,1,21];
  2027. }
  2028. def: InstRW<[SKXWriteResGroup250], (instregex "XRSTOR(64)?")>;
  2029. def SKXWriteResGroup252 : SchedWriteRes<[SKXPort1,SKXPort4,SKXPort5,SKXPort6,SKXPort23,SKXPort237,SKXPort15,SKXPort0156]> {
  2030. let Latency = 40;
  2031. let NumMicroOps = 18;
  2032. let ResourceCycles = [1,1,2,3,1,1,1,8];
  2033. }
  2034. def: InstRW<[SKXWriteResGroup252], (instrs VMCLEARm)>;
  2035. def SKXWriteResGroup253 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort23,SKXPort237,SKXPort0156]> {
  2036. let Latency = 41;
  2037. let NumMicroOps = 39;
  2038. let ResourceCycles = [1,10,1,1,26];
  2039. }
  2040. def: InstRW<[SKXWriteResGroup253], (instrs XSAVE64)>;
  2041. def SKXWriteResGroup254 : SchedWriteRes<[SKXPort5,SKXPort0156]> {
  2042. let Latency = 42;
  2043. let NumMicroOps = 22;
  2044. let ResourceCycles = [2,20];
  2045. }
  2046. def: InstRW<[SKXWriteResGroup254], (instrs RDTSCP)>;
  2047. def SKXWriteResGroup255 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort23,SKXPort237,SKXPort0156]> {
  2048. let Latency = 42;
  2049. let NumMicroOps = 40;
  2050. let ResourceCycles = [1,11,1,1,26];
  2051. }
  2052. def: InstRW<[SKXWriteResGroup255], (instrs XSAVE)>;
  2053. def: InstRW<[SKXWriteResGroup255], (instregex "XSAVEC", "XSAVES", "XSAVEOPT")>;
  2054. def SKXWriteResGroup256 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort23,SKXPort015]> {
  2055. let Latency = 44;
  2056. let NumMicroOps = 22;
  2057. let ResourceCycles = [9,7,1,5];
  2058. }
  2059. def: InstRW<[SKXWriteResGroup256], (instregex "VPCONFLICTDZ256rm(b?)",
  2060. "VPCONFLICTQZrm(b?)")>;
  2061. def SKXWriteResGroup258 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort05,SKXPort06,SKXPort0156]> {
  2062. let Latency = 62;
  2063. let NumMicroOps = 64;
  2064. let ResourceCycles = [2,8,5,10,39];
  2065. }
  2066. def: InstRW<[SKXWriteResGroup258], (instrs FLDENVm)>;
  2067. def SKXWriteResGroup259 : SchedWriteRes<[SKXPort0,SKXPort6,SKXPort23,SKXPort05,SKXPort06,SKXPort15,SKXPort0156]> {
  2068. let Latency = 63;
  2069. let NumMicroOps = 88;
  2070. let ResourceCycles = [4,4,31,1,2,1,45];
  2071. }
  2072. def: InstRW<[SKXWriteResGroup259], (instrs FXRSTOR64)>;
  2073. def SKXWriteResGroup260 : SchedWriteRes<[SKXPort0,SKXPort6,SKXPort23,SKXPort05,SKXPort06,SKXPort15,SKXPort0156]> {
  2074. let Latency = 63;
  2075. let NumMicroOps = 90;
  2076. let ResourceCycles = [4,2,33,1,2,1,47];
  2077. }
  2078. def: InstRW<[SKXWriteResGroup260], (instrs FXRSTOR)>;
  2079. def SKXWriteResGroup261 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort015]> {
  2080. let Latency = 67;
  2081. let NumMicroOps = 35;
  2082. let ResourceCycles = [17,11,7];
  2083. }
  2084. def: InstRW<[SKXWriteResGroup261], (instregex "VPCONFLICTDZrr")>;
  2085. def SKXWriteResGroup262 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort23,SKXPort015]> {
  2086. let Latency = 74;
  2087. let NumMicroOps = 36;
  2088. let ResourceCycles = [17,11,1,7];
  2089. }
  2090. def: InstRW<[SKXWriteResGroup262], (instregex "VPCONFLICTDZrm(b?)")>;
  2091. def SKXWriteResGroup263 : SchedWriteRes<[SKXPort5,SKXPort05,SKXPort0156]> {
  2092. let Latency = 75;
  2093. let NumMicroOps = 15;
  2094. let ResourceCycles = [6,3,6];
  2095. }
  2096. def: InstRW<[SKXWriteResGroup263], (instrs FNINIT)>;
  2097. def SKXWriteResGroup266 : SchedWriteRes<[SKXPort0,SKXPort1,SKXPort4,SKXPort5,SKXPort6,SKXPort237,SKXPort06,SKXPort0156]> {
  2098. let Latency = 106;
  2099. let NumMicroOps = 100;
  2100. let ResourceCycles = [9,1,11,16,1,11,21,30];
  2101. }
  2102. def: InstRW<[SKXWriteResGroup266], (instrs FSTENVm)>;
  2103. def SKXWriteResGroup267 : SchedWriteRes<[SKXPort6,SKXPort0156]> {
  2104. let Latency = 140;
  2105. let NumMicroOps = 4;
  2106. let ResourceCycles = [1,3];
  2107. }
  2108. def: InstRW<[SKXWriteResGroup267], (instrs PAUSE)>;
  2109. def: InstRW<[WriteZero], (instrs CLC)>;
  2110. // Instruction variants handled by the renamer. These might not need execution
  2111. // ports in certain conditions.
  2112. // See Agner's Fog "The microarchitecture of Intel, AMD and VIA CPUs",
  2113. // section "Skylake Pipeline" > "Register allocation and renaming".
  2114. // These can be investigated with llvm-exegesis, e.g.
  2115. // echo 'pxor %mm0, %mm0' | /tmp/llvm-exegesis -mode=uops -snippets-file=-
  2116. // echo 'vxorpd %xmm0, %xmm0, %xmm1' | /tmp/llvm-exegesis -mode=uops -snippets-file=-
  2117. def SKXWriteZeroLatency : SchedWriteRes<[]> {
  2118. let Latency = 0;
  2119. }
  2120. def SKXWriteZeroIdiom : SchedWriteVariant<[
  2121. SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
  2122. SchedVar<NoSchedPred, [WriteALU]>
  2123. ]>;
  2124. def : InstRW<[SKXWriteZeroIdiom], (instrs SUB32rr, SUB64rr,
  2125. XOR32rr, XOR64rr)>;
  2126. def SKXWriteFZeroIdiom : SchedWriteVariant<[
  2127. SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
  2128. SchedVar<NoSchedPred, [WriteFLogic]>
  2129. ]>;
  2130. def : InstRW<[SKXWriteFZeroIdiom], (instrs XORPSrr, VXORPSrr,
  2131. XORPDrr, VXORPDrr,
  2132. VXORPSZ128rr,
  2133. VXORPDZ128rr)>;
  2134. def SKXWriteFZeroIdiomY : SchedWriteVariant<[
  2135. SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
  2136. SchedVar<NoSchedPred, [WriteFLogicY]>
  2137. ]>;
  2138. def : InstRW<[SKXWriteFZeroIdiomY], (instrs VXORPSYrr, VXORPDYrr,
  2139. VXORPSZ256rr, VXORPDZ256rr)>;
  2140. def SKXWriteFZeroIdiomZ : SchedWriteVariant<[
  2141. SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
  2142. SchedVar<NoSchedPred, [WriteFLogicZ]>
  2143. ]>;
  2144. def : InstRW<[SKXWriteFZeroIdiomZ], (instrs VXORPSZrr, VXORPDZrr)>;
  2145. def SKXWriteVZeroIdiomLogicX : SchedWriteVariant<[
  2146. SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
  2147. SchedVar<NoSchedPred, [WriteVecLogicX]>
  2148. ]>;
  2149. def : InstRW<[SKXWriteVZeroIdiomLogicX], (instrs PXORrr, VPXORrr,
  2150. VPXORDZ128rr, VPXORQZ128rr)>;
  2151. def SKXWriteVZeroIdiomLogicY : SchedWriteVariant<[
  2152. SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
  2153. SchedVar<NoSchedPred, [WriteVecLogicY]>
  2154. ]>;
  2155. def : InstRW<[SKXWriteVZeroIdiomLogicY], (instrs VPXORYrr,
  2156. VPXORDZ256rr, VPXORQZ256rr)>;
  2157. def SKXWriteVZeroIdiomLogicZ : SchedWriteVariant<[
  2158. SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
  2159. SchedVar<NoSchedPred, [WriteVecLogicZ]>
  2160. ]>;
  2161. def : InstRW<[SKXWriteVZeroIdiomLogicZ], (instrs VPXORDZrr, VPXORQZrr)>;
  2162. def SKXWriteVZeroIdiomALUX : SchedWriteVariant<[
  2163. SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
  2164. SchedVar<NoSchedPred, [WriteVecALUX]>
  2165. ]>;
  2166. def : InstRW<[SKXWriteVZeroIdiomALUX], (instrs PCMPGTBrr, VPCMPGTBrr,
  2167. PCMPGTDrr, VPCMPGTDrr,
  2168. PCMPGTWrr, VPCMPGTWrr)>;
  2169. def SKXWriteVZeroIdiomALUY : SchedWriteVariant<[
  2170. SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
  2171. SchedVar<NoSchedPred, [WriteVecALUY]>
  2172. ]>;
  2173. def : InstRW<[SKXWriteVZeroIdiomALUY], (instrs VPCMPGTBYrr,
  2174. VPCMPGTDYrr,
  2175. VPCMPGTWYrr)>;
  2176. def SKXWritePSUB : SchedWriteRes<[SKXPort015]> {
  2177. let Latency = 1;
  2178. let NumMicroOps = 1;
  2179. let ResourceCycles = [1];
  2180. }
  2181. def SKXWriteVZeroIdiomPSUB : SchedWriteVariant<[
  2182. SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
  2183. SchedVar<NoSchedPred, [SKXWritePSUB]>
  2184. ]>;
  2185. def : InstRW<[SKXWriteVZeroIdiomPSUB], (instrs PSUBBrr, VPSUBBrr, VPSUBBZ128rr,
  2186. PSUBDrr, VPSUBDrr, VPSUBDZ128rr,
  2187. PSUBQrr, VPSUBQrr, VPSUBQZ128rr,
  2188. PSUBWrr, VPSUBWrr, VPSUBWZ128rr,
  2189. VPSUBBYrr, VPSUBBZ256rr,
  2190. VPSUBDYrr, VPSUBDZ256rr,
  2191. VPSUBQYrr, VPSUBQZ256rr,
  2192. VPSUBWYrr, VPSUBWZ256rr,
  2193. VPSUBBZrr,
  2194. VPSUBDZrr,
  2195. VPSUBQZrr,
  2196. VPSUBWZrr)>;
  2197. def SKXWritePCMPGTQ : SchedWriteRes<[SKXPort5]> {
  2198. let Latency = 3;
  2199. let NumMicroOps = 1;
  2200. let ResourceCycles = [1];
  2201. }
  2202. def SKXWriteVZeroIdiomPCMPGTQ : SchedWriteVariant<[
  2203. SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
  2204. SchedVar<NoSchedPred, [SKXWritePCMPGTQ]>
  2205. ]>;
  2206. def : InstRW<[SKXWriteVZeroIdiomPCMPGTQ], (instrs PCMPGTQrr, VPCMPGTQrr,
  2207. VPCMPGTQYrr)>;
  2208. // CMOVs that use both Z and C flag require an extra uop.
  2209. def SKXWriteCMOVA_CMOVBErr : SchedWriteRes<[SKXPort06]> {
  2210. let Latency = 2;
  2211. let ResourceCycles = [2];
  2212. let NumMicroOps = 2;
  2213. }
  2214. def SKXWriteCMOVA_CMOVBErm : SchedWriteRes<[SKXPort23,SKXPort06]> {
  2215. let Latency = 7;
  2216. let ResourceCycles = [1,2];
  2217. let NumMicroOps = 3;
  2218. }
  2219. def SKXCMOVA_CMOVBErr : SchedWriteVariant<[
  2220. SchedVar<MCSchedPredicate<IsCMOVArr_Or_CMOVBErr>, [SKXWriteCMOVA_CMOVBErr]>,
  2221. SchedVar<NoSchedPred, [WriteCMOV]>
  2222. ]>;
  2223. def SKXCMOVA_CMOVBErm : SchedWriteVariant<[
  2224. SchedVar<MCSchedPredicate<IsCMOVArm_Or_CMOVBErm>, [SKXWriteCMOVA_CMOVBErm]>,
  2225. SchedVar<NoSchedPred, [WriteCMOV.Folded]>
  2226. ]>;
  2227. def : InstRW<[SKXCMOVA_CMOVBErr], (instrs CMOV16rr, CMOV32rr, CMOV64rr)>;
  2228. def : InstRW<[SKXCMOVA_CMOVBErm], (instrs CMOV16rm, CMOV32rm, CMOV64rm)>;
  2229. // SETCCs that use both Z and C flag require an extra uop.
  2230. def SKXWriteSETA_SETBEr : SchedWriteRes<[SKXPort06]> {
  2231. let Latency = 2;
  2232. let ResourceCycles = [2];
  2233. let NumMicroOps = 2;
  2234. }
  2235. def SKXWriteSETA_SETBEm : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort06]> {
  2236. let Latency = 3;
  2237. let ResourceCycles = [1,1,2];
  2238. let NumMicroOps = 4;
  2239. }
  2240. def SKXSETA_SETBErr : SchedWriteVariant<[
  2241. SchedVar<MCSchedPredicate<IsSETAr_Or_SETBEr>, [SKXWriteSETA_SETBEr]>,
  2242. SchedVar<NoSchedPred, [WriteSETCC]>
  2243. ]>;
  2244. def SKXSETA_SETBErm : SchedWriteVariant<[
  2245. SchedVar<MCSchedPredicate<IsSETAm_Or_SETBEm>, [SKXWriteSETA_SETBEm]>,
  2246. SchedVar<NoSchedPred, [WriteSETCCStore]>
  2247. ]>;
  2248. def : InstRW<[SKXSETA_SETBErr], (instrs SETCCr)>;
  2249. def : InstRW<[SKXSETA_SETBErm], (instrs SETCCm)>;
  2250. ///////////////////////////////////////////////////////////////////////////////
  2251. // Dependency breaking instructions.
  2252. ///////////////////////////////////////////////////////////////////////////////
  2253. def : IsZeroIdiomFunction<[
  2254. // GPR Zero-idioms.
  2255. DepBreakingClass<[ SUB32rr, SUB64rr, XOR32rr, XOR64rr ], ZeroIdiomPredicate>,
  2256. // SSE Zero-idioms.
  2257. DepBreakingClass<[
  2258. // fp variants.
  2259. XORPSrr, XORPDrr,
  2260. // int variants.
  2261. PXORrr,
  2262. PSUBBrr, PSUBWrr, PSUBDrr, PSUBQrr,
  2263. PCMPGTBrr, PCMPGTDrr, PCMPGTQrr, PCMPGTWrr
  2264. ], ZeroIdiomPredicate>,
  2265. // AVX Zero-idioms.
  2266. DepBreakingClass<[
  2267. // xmm fp variants.
  2268. VXORPSrr, VXORPDrr,
  2269. // xmm int variants.
  2270. VPXORrr,
  2271. VPSUBBrr, VPSUBWrr, VPSUBDrr, VPSUBQrr,
  2272. VPCMPGTBrr, VPCMPGTWrr, VPCMPGTDrr, VPCMPGTQrr,
  2273. // ymm variants.
  2274. VXORPSYrr, VXORPDYrr, VPXORYrr,
  2275. VPSUBBYrr, VPSUBWYrr, VPSUBDYrr, VPSUBQYrr,
  2276. VPCMPGTBYrr, VPCMPGTWYrr, VPCMPGTDYrr, VPCMPGTQYrr,
  2277. // zmm variants.
  2278. VXORPSZrr, VXORPDZrr, VPXORDZrr, VPXORQZrr,
  2279. VXORPSZ128rr, VXORPDZ128rr, VPXORDZ128rr, VPXORQZ128rr,
  2280. VXORPSZ256rr, VXORPDZ256rr, VPXORDZ256rr, VPXORQZ256rr,
  2281. VPSUBBZrr, VPSUBWZrr, VPSUBDZrr, VPSUBQZrr,
  2282. VPSUBBZ128rr, VPSUBWZ128rr, VPSUBDZ128rr, VPSUBQZ128rr,
  2283. VPSUBBZ256rr, VPSUBWZ256rr, VPSUBDZ256rr, VPSUBQZ256rr,
  2284. ], ZeroIdiomPredicate>,
  2285. ]>;
  2286. } // SchedModel