X86ScheduleAtom.td 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942
  1. //===- X86ScheduleAtom.td - X86 Atom Scheduling Definitions -*- 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 schedule class data for the Intel Atom
  10. // in order (Saltwell-32nm/Bonnell-45nm) processors.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // Scheduling information derived from the "Intel 64 and IA32 Architectures
  15. // Optimization Reference Manual", Chapter 13, Section 4.
  16. // Atom machine model.
  17. def AtomModel : SchedMachineModel {
  18. let IssueWidth = 2; // Allows 2 instructions per scheduling group.
  19. let MicroOpBufferSize = 0; // In-order execution, always hide latency.
  20. let LoadLatency = 3; // Expected cycles, may be overriden.
  21. let HighLatency = 30;// Expected, may be overriden.
  22. // On the Atom, the throughput for taken branches is 2 cycles. For small
  23. // simple loops, expand by a small factor to hide the backedge cost.
  24. let LoopMicroOpBufferSize = 10;
  25. let PostRAScheduler = 1;
  26. let CompleteModel = 0;
  27. }
  28. let SchedModel = AtomModel in {
  29. // Functional Units
  30. def AtomPort0 : ProcResource<1>; // ALU: ALU0, shift/rotate, load/store
  31. // SIMD/FP: SIMD ALU, Shuffle,SIMD/FP multiply, divide
  32. def AtomPort1 : ProcResource<1>; // ALU: ALU1, bit processing, jump, and LEA
  33. // SIMD/FP: SIMD ALU, FP Adder
  34. // NOTE: This is for ops that can use EITHER port, not for ops that require BOTH ports.
  35. def AtomPort01 : ProcResGroup<[AtomPort0, AtomPort1]>;
  36. // Loads are 3 cycles, so ReadAfterLd registers needn't be available until 3
  37. // cycles after the memory operand.
  38. def : ReadAdvance<ReadAfterLd, 3>;
  39. def : ReadAdvance<ReadAfterVecLd, 3>;
  40. def : ReadAdvance<ReadAfterVecXLd, 3>;
  41. def : ReadAdvance<ReadAfterVecYLd, 3>;
  42. def : ReadAdvance<ReadInt2Fpu, 0>;
  43. // This multiclass defines the resource usage for variants with and without
  44. // folded loads.
  45. multiclass AtomWriteResPair<X86FoldableSchedWrite SchedRW,
  46. list<ProcResourceKind> RRPorts,
  47. list<ProcResourceKind> RMPorts,
  48. int RRLat = 1, int RMLat = 1,
  49. list<int> RRRes = [1],
  50. list<int> RMRes = [1],
  51. int RRUOps = 1,
  52. int RMUOps = 1> {
  53. // Register variant.
  54. def : WriteRes<SchedRW, RRPorts> {
  55. let Latency = RRLat;
  56. let ResourceCycles = RRRes;
  57. let NumMicroOps = RRUOps;
  58. }
  59. // Memory variant.
  60. def : WriteRes<SchedRW.Folded, RMPorts> {
  61. let Latency = RMLat;
  62. let ResourceCycles = RMRes;
  63. let NumMicroOps = RMUOps;
  64. }
  65. }
  66. // A folded store needs a cycle on Port0 for the store data.
  67. def : WriteRes<WriteRMW, [AtomPort0]>;
  68. ////////////////////////////////////////////////////////////////////////////////
  69. // Arithmetic.
  70. ////////////////////////////////////////////////////////////////////////////////
  71. defm : AtomWriteResPair<WriteALU, [AtomPort01], [AtomPort0]>;
  72. defm : AtomWriteResPair<WriteADC, [AtomPort01], [AtomPort0]>;
  73. defm : AtomWriteResPair<WriteIMul8, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 7, 7, [7,7], [7,7], 3, 3>;
  74. defm : AtomWriteResPair<WriteIMul16, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 7, 8, [7,7], [8,8], 4, 5>;
  75. defm : AtomWriteResPair<WriteIMul16Imm, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 6, 7, [6,6], [7,7], 2, 3>;
  76. defm : AtomWriteResPair<WriteIMul16Reg, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 6, 7, [6,6], [7,7], 2, 3>;
  77. defm : AtomWriteResPair<WriteIMul32, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 6, 7, [6,6], [7,7], 3, 4>;
  78. defm : AtomWriteResPair<WriteIMul32Imm, [AtomPort0], [AtomPort0], 5, 5, [5], [5]>;
  79. defm : AtomWriteResPair<WriteIMul32Reg, [AtomPort0], [AtomPort0], 5, 5, [5], [5]>;
  80. defm : AtomWriteResPair<WriteIMul64, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 12, 12, [12,12], [12,12], 8, 8>;
  81. defm : AtomWriteResPair<WriteIMul64Imm, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 14, 14, [14,14], [14,14], 7, 7>;
  82. defm : AtomWriteResPair<WriteIMul64Reg, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 12, 12, [12,12], [12,12], 6, 6>;
  83. defm : X86WriteResUnsupported<WriteIMulH>;
  84. defm : X86WriteResUnsupported<WriteIMulHLd>;
  85. defm : X86WriteResPairUnsupported<WriteMULX32>;
  86. defm : X86WriteResPairUnsupported<WriteMULX64>;
  87. defm : X86WriteRes<WriteXCHG, [AtomPort01], 2, [2], 1>;
  88. defm : X86WriteRes<WriteBSWAP32, [AtomPort0], 1, [1], 1>;
  89. defm : X86WriteRes<WriteBSWAP64, [AtomPort0], 1, [1], 1>;
  90. defm : AtomWriteResPair<WriteCMPXCHG, [AtomPort01], [AtomPort01], 15, 15, [15]>;
  91. defm : X86WriteRes<WriteCMPXCHGRMW, [AtomPort01, AtomPort0], 1, [1, 1], 1>;
  92. defm : AtomWriteResPair<WriteDiv8, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 50, 68, [50,50], [68,68], 9, 9>;
  93. defm : AtomWriteResPair<WriteDiv16, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 50, 50, [50,50], [50,50], 12, 12>;
  94. defm : AtomWriteResPair<WriteDiv32, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 50, 50, [50,50], [50,50], 12, 12>;
  95. defm : AtomWriteResPair<WriteDiv64, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1],130,130,[130,130],[130,130], 38, 38>;
  96. defm : AtomWriteResPair<WriteIDiv8, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 62, 62, [62,62], [62,62], 26, 26>;
  97. defm : AtomWriteResPair<WriteIDiv16, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 62, 62, [62,62], [62,62], 29, 29>;
  98. defm : AtomWriteResPair<WriteIDiv32, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 62, 62, [62,62], [62,62], 29, 29>;
  99. defm : AtomWriteResPair<WriteIDiv64, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1],130,130,[130,130],[130,130], 60, 60>;
  100. defm : X86WriteResPairUnsupported<WriteCRC32>;
  101. defm : AtomWriteResPair<WriteCMOV, [AtomPort01], [AtomPort0]>;
  102. defm : X86WriteRes<WriteFCMOV, [AtomPort01], 9, [9], 1>; // x87 conditional move.
  103. def : WriteRes<WriteSETCC, [AtomPort01]>;
  104. def : WriteRes<WriteSETCCStore, [AtomPort01]> {
  105. let Latency = 2;
  106. let ResourceCycles = [2];
  107. }
  108. def : WriteRes<WriteLAHFSAHF, [AtomPort01]> {
  109. let Latency = 2;
  110. let ResourceCycles = [2];
  111. }
  112. defm : X86WriteRes<WriteBitTest, [AtomPort1], 1, [1], 1>;
  113. defm : X86WriteRes<WriteBitTestImmLd, [AtomPort0], 1, [1], 1>;
  114. defm : X86WriteRes<WriteBitTestRegLd, [AtomPort01], 9, [9], 1>;
  115. defm : X86WriteRes<WriteBitTestSet, [AtomPort1], 1, [1], 1>;
  116. //defm : X86WriteRes<WriteBitTestSetImmLd, [AtomPort1], 1, [1], 1>;
  117. //defm : X86WriteRes<WriteBitTestSetRegLd, [AtomPort1], 1, [1], 1>;
  118. // This is for simple LEAs with one or two input operands.
  119. def : WriteRes<WriteLEA, [AtomPort1]>;
  120. // Bit counts.
  121. defm : AtomWriteResPair<WriteBSF, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 16, 16, [16,16], [16,16], 10, 10>;
  122. defm : AtomWriteResPair<WriteBSR, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 16, 16, [16,16], [16,16], 10, 10>;
  123. defm : X86WriteResPairUnsupported<WritePOPCNT>;
  124. defm : X86WriteResPairUnsupported<WriteLZCNT>;
  125. defm : X86WriteResPairUnsupported<WriteTZCNT>;
  126. // BMI1 BEXTR/BLS, BMI2 BZHI
  127. defm : X86WriteResPairUnsupported<WriteBEXTR>;
  128. defm : X86WriteResPairUnsupported<WriteBLS>;
  129. defm : X86WriteResPairUnsupported<WriteBZHI>;
  130. ////////////////////////////////////////////////////////////////////////////////
  131. // Integer shifts and rotates.
  132. ////////////////////////////////////////////////////////////////////////////////
  133. defm : AtomWriteResPair<WriteShift, [AtomPort0], [AtomPort0]>;
  134. defm : AtomWriteResPair<WriteShiftCL, [AtomPort0], [AtomPort0]>;
  135. defm : AtomWriteResPair<WriteRotate, [AtomPort0], [AtomPort0]>;
  136. defm : AtomWriteResPair<WriteRotateCL, [AtomPort0], [AtomPort0]>;
  137. defm : X86WriteRes<WriteSHDrri, [AtomPort01], 2, [2], 1>;
  138. defm : X86WriteRes<WriteSHDrrcl,[AtomPort01], 2, [2], 1>;
  139. defm : X86WriteRes<WriteSHDmri, [AtomPort01], 4, [4], 1>;
  140. defm : X86WriteRes<WriteSHDmrcl,[AtomPort01], 4, [4], 1>;
  141. ////////////////////////////////////////////////////////////////////////////////
  142. // Loads, stores, and moves, not folded with other operations.
  143. ////////////////////////////////////////////////////////////////////////////////
  144. def : WriteRes<WriteLoad, [AtomPort0]>;
  145. def : WriteRes<WriteStore, [AtomPort0]>;
  146. def : WriteRes<WriteStoreNT, [AtomPort0]>;
  147. def : WriteRes<WriteMove, [AtomPort01]>;
  148. defm : X86WriteResUnsupported<WriteVecMaskedGatherWriteback>;
  149. // Treat misc copies as a move.
  150. def : InstRW<[WriteMove], (instrs COPY)>;
  151. ////////////////////////////////////////////////////////////////////////////////
  152. // Idioms that clear a register, like xorps %xmm0, %xmm0.
  153. // These can often bypass execution ports completely.
  154. ////////////////////////////////////////////////////////////////////////////////
  155. def : WriteRes<WriteZero, []>;
  156. ////////////////////////////////////////////////////////////////////////////////
  157. // Branches don't produce values, so they have no latency, but they still
  158. // consume resources. Indirect branches can fold loads.
  159. ////////////////////////////////////////////////////////////////////////////////
  160. defm : AtomWriteResPair<WriteJump, [AtomPort1], [AtomPort1]>;
  161. ////////////////////////////////////////////////////////////////////////////////
  162. // Special case scheduling classes.
  163. ////////////////////////////////////////////////////////////////////////////////
  164. def : WriteRes<WriteSystem, [AtomPort01]> { let Latency = 100; }
  165. def : WriteRes<WriteMicrocoded, [AtomPort01]> { let Latency = 100; }
  166. def : WriteRes<WriteFence, [AtomPort0]>;
  167. // Nops don't have dependencies, so there's no actual latency, but we set this
  168. // to '1' to tell the scheduler that the nop uses an ALU slot for a cycle.
  169. def : WriteRes<WriteNop, [AtomPort01]>;
  170. ////////////////////////////////////////////////////////////////////////////////
  171. // Floating point. This covers both scalar and vector operations.
  172. ////////////////////////////////////////////////////////////////////////////////
  173. defm : X86WriteRes<WriteFLD0, [AtomPort01], 1, [1], 1>;
  174. defm : X86WriteRes<WriteFLD1, [AtomPort01], 6, [6], 1>;
  175. def : WriteRes<WriteFLoad, [AtomPort0]>;
  176. def : WriteRes<WriteFLoadX, [AtomPort0]>;
  177. defm : X86WriteResUnsupported<WriteFLoadY>;
  178. defm : X86WriteResUnsupported<WriteFMaskedLoad>;
  179. defm : X86WriteResUnsupported<WriteFMaskedLoadY>;
  180. def : WriteRes<WriteFStore, [AtomPort0]>;
  181. def : WriteRes<WriteFStoreX, [AtomPort0]>;
  182. defm : X86WriteResUnsupported<WriteFStoreY>;
  183. def : WriteRes<WriteFStoreNT, [AtomPort0]>;
  184. def : WriteRes<WriteFStoreNTX, [AtomPort0]>;
  185. defm : X86WriteResUnsupported<WriteFStoreNTY>;
  186. defm : X86WriteResUnsupported<WriteFMaskedStore32>;
  187. defm : X86WriteResUnsupported<WriteFMaskedStore32Y>;
  188. defm : X86WriteResUnsupported<WriteFMaskedStore64>;
  189. defm : X86WriteResUnsupported<WriteFMaskedStore64Y>;
  190. def : WriteRes<WriteFMove, [AtomPort01]>;
  191. def : WriteRes<WriteFMoveX, [AtomPort01]>;
  192. defm : X86WriteResUnsupported<WriteFMoveY>;
  193. defm : X86WriteResUnsupported<WriteFMoveZ>;
  194. defm : X86WriteRes<WriteEMMS, [AtomPort01], 5, [5], 1>;
  195. defm : AtomWriteResPair<WriteFAdd, [AtomPort1], [AtomPort0,AtomPort1], 5, 5, [1], [1,1]>;
  196. defm : AtomWriteResPair<WriteFAddX, [AtomPort1], [AtomPort0,AtomPort1], 5, 5, [1], [1,1]>;
  197. defm : X86WriteResPairUnsupported<WriteFAddY>;
  198. defm : X86WriteResPairUnsupported<WriteFAddZ>;
  199. defm : AtomWriteResPair<WriteFAdd64, [AtomPort1], [AtomPort0,AtomPort1], 5, 5, [1], [1,1]>;
  200. defm : AtomWriteResPair<WriteFAdd64X, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 6, 7, [5,5], [6,6], 3, 4>;
  201. defm : X86WriteResPairUnsupported<WriteFAdd64Y>;
  202. defm : X86WriteResPairUnsupported<WriteFAdd64Z>;
  203. defm : AtomWriteResPair<WriteFCmp, [AtomPort1], [AtomPort0,AtomPort1], 5, 5, [1], [1,1]>;
  204. defm : AtomWriteResPair<WriteFCmpX, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 6, 7, [5,5], [6,6], 3, 4>;
  205. defm : X86WriteResPairUnsupported<WriteFCmpY>;
  206. defm : X86WriteResPairUnsupported<WriteFCmpZ>;
  207. defm : AtomWriteResPair<WriteFCmp64, [AtomPort1], [AtomPort0,AtomPort1], 5, 5, [1], [1,1]>;
  208. defm : AtomWriteResPair<WriteFCmp64X, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 6, 7, [5,5], [6,6], 3, 4>;
  209. defm : X86WriteResPairUnsupported<WriteFCmp64Y>;
  210. defm : X86WriteResPairUnsupported<WriteFCmp64Z>;
  211. defm : AtomWriteResPair<WriteFCom, [AtomPort0], [AtomPort0], 5, 5, [5], [5]>;
  212. defm : AtomWriteResPair<WriteFComX, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 9, 10, [9,9],[10,10], 4, 5>;
  213. defm : AtomWriteResPair<WriteFMul, [AtomPort0], [AtomPort0], 4, 4, [2], [2]>;
  214. defm : AtomWriteResPair<WriteFMulX, [AtomPort0], [AtomPort0], 5, 5, [2], [2]>;
  215. defm : X86WriteResPairUnsupported<WriteFMulY>;
  216. defm : X86WriteResPairUnsupported<WriteFMulZ>;
  217. defm : AtomWriteResPair<WriteFMul64, [AtomPort0], [AtomPort0], 5, 5, [2], [2]>;
  218. defm : AtomWriteResPair<WriteFMul64X, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 9, 10, [9,9],[10,10], 6, 7>;
  219. defm : X86WriteResPairUnsupported<WriteFMul64Y>;
  220. defm : X86WriteResPairUnsupported<WriteFMul64Z>;
  221. defm : AtomWriteResPair<WriteFRcp, [AtomPort0], [AtomPort0], 4, 4, [4], [4]>;
  222. defm : AtomWriteResPair<WriteFRcpX, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 9, 10, [9,9], [10,10], 5, 6>;
  223. defm : X86WriteResPairUnsupported<WriteFRcpY>;
  224. defm : X86WriteResPairUnsupported<WriteFRcpZ>;
  225. defm : AtomWriteResPair<WriteFRsqrt, [AtomPort0], [AtomPort0], 4, 4, [4], [4]>;
  226. defm : AtomWriteResPair<WriteFRsqrtX, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 9, 10, [9,9], [10,10], 5, 6>;
  227. defm : X86WriteResPairUnsupported<WriteFRsqrtY>;
  228. defm : X86WriteResPairUnsupported<WriteFRsqrtZ>;
  229. defm : AtomWriteResPair<WriteFDiv, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 34, 34, [34,34], [34,34], 3, 4>;
  230. defm : AtomWriteResPair<WriteFDivX, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 70, 70, [70,70], [70,70], 6, 7>;
  231. defm : X86WriteResPairUnsupported<WriteFDivY>;
  232. defm : X86WriteResPairUnsupported<WriteFDivZ>;
  233. defm : AtomWriteResPair<WriteFDiv64, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 62, 62, [62,62], [62,62], 3, 4>;
  234. defm : AtomWriteResPair<WriteFDiv64X, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1],125,125,[125,125],[125,125], 6, 7>;
  235. defm : X86WriteResPairUnsupported<WriteFDiv64Y>;
  236. defm : X86WriteResPairUnsupported<WriteFDiv64Z>;
  237. defm : AtomWriteResPair<WriteFSqrt, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 34, 34, [34,34], [34,34], 3, 4>;
  238. defm : AtomWriteResPair<WriteFSqrtX, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 70, 70, [70,70], [70,70], 5, 6>;
  239. defm : X86WriteResPairUnsupported<WriteFSqrtY>;
  240. defm : X86WriteResPairUnsupported<WriteFSqrtZ>;
  241. defm : AtomWriteResPair<WriteFSqrt64, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 62, 62, [62,62], [62,62], 3, 4>;
  242. defm : AtomWriteResPair<WriteFSqrt64X, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1],125,125,[125,125],[125,125], 5, 6>;
  243. defm : X86WriteResPairUnsupported<WriteFSqrt64Y>;
  244. defm : X86WriteResPairUnsupported<WriteFSqrt64Z>;
  245. defm : AtomWriteResPair<WriteFSqrt80, [AtomPort0], [AtomPort0], 71, 71, [71], [71]>;
  246. defm : AtomWriteResPair<WriteFSign, [AtomPort1], [AtomPort1]>;
  247. defm : AtomWriteResPair<WriteFRnd, [AtomPort0], [AtomPort0], 5, 5, [5], [5]>;
  248. defm : X86WriteResPairUnsupported<WriteFRndY>;
  249. defm : X86WriteResPairUnsupported<WriteFRndZ>;
  250. defm : AtomWriteResPair<WriteFLogic, [AtomPort01], [AtomPort0]>;
  251. defm : X86WriteResPairUnsupported<WriteFLogicY>;
  252. defm : X86WriteResPairUnsupported<WriteFLogicZ>;
  253. defm : AtomWriteResPair<WriteFTest, [AtomPort01], [AtomPort0]>;
  254. defm : X86WriteResPairUnsupported<WriteFTestY>;
  255. defm : X86WriteResPairUnsupported<WriteFTestZ>;
  256. defm : AtomWriteResPair<WriteFShuffle, [AtomPort0], [AtomPort0]>;
  257. defm : X86WriteResPairUnsupported<WriteFShuffleY>;
  258. defm : X86WriteResPairUnsupported<WriteFShuffleZ>;
  259. defm : X86WriteResPairUnsupported<WriteFVarShuffle>;
  260. defm : X86WriteResPairUnsupported<WriteFVarShuffleY>;
  261. defm : X86WriteResPairUnsupported<WriteFVarShuffleZ>;
  262. defm : X86WriteResPairUnsupported<WriteFMA>;
  263. defm : X86WriteResPairUnsupported<WriteFMAX>;
  264. defm : X86WriteResPairUnsupported<WriteFMAY>;
  265. defm : X86WriteResPairUnsupported<WriteFMAZ>;
  266. defm : X86WriteResPairUnsupported<WriteDPPD>;
  267. defm : X86WriteResPairUnsupported<WriteDPPS>;
  268. defm : X86WriteResPairUnsupported<WriteDPPSY>;
  269. defm : X86WriteResPairUnsupported<WriteFBlend>;
  270. defm : X86WriteResPairUnsupported<WriteFBlendY>;
  271. defm : X86WriteResPairUnsupported<WriteFBlendZ>;
  272. defm : X86WriteResPairUnsupported<WriteFVarBlend>;
  273. defm : X86WriteResPairUnsupported<WriteFVarBlendY>;
  274. defm : X86WriteResPairUnsupported<WriteFVarBlendZ>;
  275. defm : X86WriteResPairUnsupported<WriteFShuffle256>;
  276. defm : X86WriteResPairUnsupported<WriteFVarShuffle256>;
  277. ////////////////////////////////////////////////////////////////////////////////
  278. // Conversions.
  279. ////////////////////////////////////////////////////////////////////////////////
  280. defm : AtomWriteResPair<WriteCvtSS2I, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 8, 9, [8,8], [9,9], 3, 4>;
  281. defm : AtomWriteResPair<WriteCvtPS2I, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 6, 7, [6,6], [7,7], 3, 4>;
  282. defm : X86WriteResPairUnsupported<WriteCvtPS2IY>;
  283. defm : X86WriteResPairUnsupported<WriteCvtPS2IZ>;
  284. defm : AtomWriteResPair<WriteCvtSD2I, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 8, 9, [8,8],[10,10], 3, 4>;
  285. defm : AtomWriteResPair<WriteCvtPD2I, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 7, 8, [7,7], [8,8], 4, 5>;
  286. defm : X86WriteResPairUnsupported<WriteCvtPD2IY>;
  287. defm : X86WriteResPairUnsupported<WriteCvtPD2IZ>;
  288. defm : AtomWriteResPair<WriteCvtI2SS, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 6, 7, [6,6], [6,6], 3, 1>;
  289. defm : AtomWriteResPair<WriteCvtI2PS, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 6, 7, [6,6], [7,7], 3, 4>;
  290. defm : X86WriteResPairUnsupported<WriteCvtI2PSY>;
  291. defm : X86WriteResPairUnsupported<WriteCvtI2PSZ>;
  292. defm : AtomWriteResPair<WriteCvtI2SD, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 6, 7, [6,6], [7,7], 3, 3>;
  293. defm : AtomWriteResPair<WriteCvtI2PD, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 7, 8, [6,6], [7,7], 3, 4>;
  294. defm : X86WriteResPairUnsupported<WriteCvtI2PDY>;
  295. defm : X86WriteResPairUnsupported<WriteCvtI2PDZ>;
  296. defm : AtomWriteResPair<WriteCvtSS2SD, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 6, 7, [6,6], [7,7], 3, 4>;
  297. defm : AtomWriteResPair<WriteCvtPS2PD, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 7, 8, [6,6], [7,7], 4, 5>;
  298. defm : X86WriteResPairUnsupported<WriteCvtPS2PDY>;
  299. defm : X86WriteResPairUnsupported<WriteCvtPS2PDZ>;
  300. defm : AtomWriteResPair<WriteCvtSD2SS, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 10, 11,[10,10],[12,12], 3, 4>;
  301. defm : AtomWriteResPair<WriteCvtPD2PS, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 11, 12,[11,11],[12,12], 4, 5>;
  302. defm : X86WriteResPairUnsupported<WriteCvtPD2PSY>;
  303. defm : X86WriteResPairUnsupported<WriteCvtPD2PSZ>;
  304. defm : X86WriteResPairUnsupported<WriteCvtPH2PS>;
  305. defm : X86WriteResPairUnsupported<WriteCvtPH2PSY>;
  306. defm : X86WriteResPairUnsupported<WriteCvtPH2PSZ>;
  307. defm : X86WriteResUnsupported<WriteCvtPS2PH>;
  308. defm : X86WriteResUnsupported<WriteCvtPS2PHSt>;
  309. defm : X86WriteResUnsupported<WriteCvtPS2PHY>;
  310. defm : X86WriteResUnsupported<WriteCvtPS2PHZ>;
  311. defm : X86WriteResUnsupported<WriteCvtPS2PHYSt>;
  312. defm : X86WriteResUnsupported<WriteCvtPS2PHZSt>;
  313. ////////////////////////////////////////////////////////////////////////////////
  314. // Vector integer operations.
  315. ////////////////////////////////////////////////////////////////////////////////
  316. def : WriteRes<WriteVecLoad, [AtomPort0]>;
  317. def : WriteRes<WriteVecLoadX, [AtomPort0]>;
  318. defm : X86WriteResUnsupported<WriteVecLoadY>;
  319. def : WriteRes<WriteVecLoadNT, [AtomPort0]>;
  320. defm : X86WriteResUnsupported<WriteVecLoadNTY>;
  321. defm : X86WriteResUnsupported<WriteVecMaskedLoad>;
  322. defm : X86WriteResUnsupported<WriteVecMaskedLoadY>;
  323. def : WriteRes<WriteVecStore, [AtomPort0]>;
  324. def : WriteRes<WriteVecStoreX, [AtomPort0]>;
  325. defm : X86WriteResUnsupported<WriteVecStoreY>;
  326. def : WriteRes<WriteVecStoreNT, [AtomPort0]>;
  327. defm : X86WriteResUnsupported<WriteVecStoreNTY>;
  328. defm : X86WriteResUnsupported<WriteVecMaskedStore32>;
  329. defm : X86WriteResUnsupported<WriteVecMaskedStore64>;
  330. defm : X86WriteResUnsupported<WriteVecMaskedStore32Y>;
  331. defm : X86WriteResUnsupported<WriteVecMaskedStore64Y>;
  332. def : WriteRes<WriteVecMove, [AtomPort0]>;
  333. def : WriteRes<WriteVecMoveX, [AtomPort01]>;
  334. defm : X86WriteResUnsupported<WriteVecMoveY>;
  335. defm : X86WriteResUnsupported<WriteVecMoveZ>;
  336. defm : X86WriteRes<WriteVecMoveToGpr, [AtomPort0], 3, [3], 1>;
  337. defm : X86WriteRes<WriteVecMoveFromGpr, [AtomPort0], 1, [1], 1>;
  338. defm : AtomWriteResPair<WriteVecALU, [AtomPort01], [AtomPort0], 1, 1>;
  339. defm : AtomWriteResPair<WriteVecALUX, [AtomPort01], [AtomPort0], 1, 1>;
  340. defm : X86WriteResPairUnsupported<WriteVecALUY>;
  341. defm : X86WriteResPairUnsupported<WriteVecALUZ>;
  342. defm : AtomWriteResPair<WriteVecLogic, [AtomPort01], [AtomPort0], 1, 1>;
  343. defm : AtomWriteResPair<WriteVecLogicX, [AtomPort01], [AtomPort0], 1, 1>;
  344. defm : X86WriteResPairUnsupported<WriteVecLogicY>;
  345. defm : X86WriteResPairUnsupported<WriteVecLogicZ>;
  346. defm : X86WriteResPairUnsupported<WriteVecTest>;
  347. defm : X86WriteResPairUnsupported<WriteVecTestY>;
  348. defm : X86WriteResPairUnsupported<WriteVecTestZ>;
  349. defm : AtomWriteResPair<WriteVecShift, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 2, 3, [1,1], [2,2], 2, 3>;
  350. defm : AtomWriteResPair<WriteVecShiftX, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 2, 3, [1,1], [2,2], 2, 3>;
  351. defm : X86WriteResPairUnsupported<WriteVecShiftY>;
  352. defm : X86WriteResPairUnsupported<WriteVecShiftZ>;
  353. defm : AtomWriteResPair<WriteVecShiftImm, [AtomPort0], [AtomPort0], 1, 1>;
  354. defm : AtomWriteResPair<WriteVecShiftImmX, [AtomPort0], [AtomPort0], 1, 1>;
  355. defm : X86WriteResPairUnsupported<WriteVecShiftImmY>;
  356. defm : X86WriteResPairUnsupported<WriteVecShiftImmZ>;
  357. defm : AtomWriteResPair<WriteVecIMul, [AtomPort0], [AtomPort0], 4, 4, [1], [1]>;
  358. defm : AtomWriteResPair<WriteVecIMulX, [AtomPort0], [AtomPort0], 5, 5, [2], [2]>;
  359. defm : X86WriteResPairUnsupported<WriteVecIMulY>;
  360. defm : X86WriteResPairUnsupported<WriteVecIMulZ>;
  361. defm : X86WriteResPairUnsupported<WritePMULLD>;
  362. defm : X86WriteResPairUnsupported<WritePMULLDY>;
  363. defm : X86WriteResPairUnsupported<WritePMULLDZ>;
  364. defm : X86WriteResPairUnsupported<WritePHMINPOS>;
  365. defm : X86WriteResPairUnsupported<WriteMPSAD>;
  366. defm : X86WriteResPairUnsupported<WriteMPSADY>;
  367. defm : X86WriteResPairUnsupported<WriteMPSADZ>;
  368. defm : AtomWriteResPair<WritePSADBW, [AtomPort0], [AtomPort0], 4, 4, [1], [1]>;
  369. defm : AtomWriteResPair<WritePSADBWX, [AtomPort0], [AtomPort0], 5, 5, [2], [2]>;
  370. defm : X86WriteResPairUnsupported<WritePSADBWY>;
  371. defm : X86WriteResPairUnsupported<WritePSADBWZ>;
  372. defm : AtomWriteResPair<WriteShuffle, [AtomPort0], [AtomPort0], 1, 1>;
  373. defm : AtomWriteResPair<WriteShuffleX, [AtomPort0], [AtomPort0], 1, 1>;
  374. defm : X86WriteResPairUnsupported<WriteShuffleY>;
  375. defm : X86WriteResPairUnsupported<WriteShuffleZ>;
  376. defm : AtomWriteResPair<WriteVarShuffle, [AtomPort0], [AtomPort0], 1, 1>;
  377. defm : AtomWriteResPair<WriteVarShuffleX, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 4, 5, [3,3], [4,4], 4, 5>;
  378. defm : X86WriteResPairUnsupported<WriteVarShuffleY>;
  379. defm : X86WriteResPairUnsupported<WriteVarShuffleZ>;
  380. defm : X86WriteResPairUnsupported<WriteBlend>;
  381. defm : X86WriteResPairUnsupported<WriteBlendY>;
  382. defm : X86WriteResPairUnsupported<WriteBlendZ>;
  383. defm : X86WriteResPairUnsupported<WriteVarBlend>;
  384. defm : X86WriteResPairUnsupported<WriteVarBlendY>;
  385. defm : X86WriteResPairUnsupported<WriteVarBlendZ>;
  386. defm : X86WriteResPairUnsupported<WriteShuffle256>;
  387. defm : X86WriteResPairUnsupported<WriteVPMOV256>;
  388. defm : X86WriteResPairUnsupported<WriteVarShuffle256>;
  389. defm : X86WriteResPairUnsupported<WriteVarVecShift>;
  390. defm : X86WriteResPairUnsupported<WriteVarVecShiftY>;
  391. defm : X86WriteResPairUnsupported<WriteVarVecShiftZ>;
  392. ////////////////////////////////////////////////////////////////////////////////
  393. // Vector insert/extract operations.
  394. ////////////////////////////////////////////////////////////////////////////////
  395. defm : AtomWriteResPair<WriteVecInsert, [AtomPort0], [AtomPort0], 1, 1>;
  396. def : WriteRes<WriteVecExtract, [AtomPort0]>;
  397. def : WriteRes<WriteVecExtractSt, [AtomPort0]>;
  398. ////////////////////////////////////////////////////////////////////////////////
  399. // SSE42 String instructions.
  400. ////////////////////////////////////////////////////////////////////////////////
  401. defm : X86WriteResPairUnsupported<WritePCmpIStrI>;
  402. defm : X86WriteResPairUnsupported<WritePCmpIStrM>;
  403. defm : X86WriteResPairUnsupported<WritePCmpEStrI>;
  404. defm : X86WriteResPairUnsupported<WritePCmpEStrM>;
  405. ////////////////////////////////////////////////////////////////////////////////
  406. // MOVMSK Instructions.
  407. ////////////////////////////////////////////////////////////////////////////////
  408. def : WriteRes<WriteFMOVMSK, [AtomPort0]> { let Latency = 3; let ResourceCycles = [3]; }
  409. def : WriteRes<WriteVecMOVMSK, [AtomPort0]> { let Latency = 3; let ResourceCycles = [3]; }
  410. defm : X86WriteResUnsupported<WriteVecMOVMSKY>;
  411. def : WriteRes<WriteMMXMOVMSK, [AtomPort0]> { let Latency = 3; let ResourceCycles = [3]; }
  412. ////////////////////////////////////////////////////////////////////////////////
  413. // AES instructions.
  414. ////////////////////////////////////////////////////////////////////////////////
  415. defm : X86WriteResPairUnsupported<WriteAESIMC>;
  416. defm : X86WriteResPairUnsupported<WriteAESKeyGen>;
  417. defm : X86WriteResPairUnsupported<WriteAESDecEnc>;
  418. ////////////////////////////////////////////////////////////////////////////////
  419. // Horizontal add/sub instructions.
  420. ////////////////////////////////////////////////////////////////////////////////
  421. defm : AtomWriteResPair<WriteFHAdd, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 8, 9, [8,8], [9,9], 5, 6>;
  422. defm : X86WriteResPairUnsupported<WriteFHAddY>;
  423. defm : AtomWriteResPair<WritePHAdd, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 3, 4, [3,3], [4,4], 3, 4>;
  424. defm : AtomWriteResPair<WritePHAddX, [AtomPort0,AtomPort1], [AtomPort0,AtomPort1], 7, 8, [7,7], [8,8], 3, 4>;
  425. defm : X86WriteResPairUnsupported<WritePHAddY>;
  426. ////////////////////////////////////////////////////////////////////////////////
  427. // Carry-less multiplication instructions.
  428. ////////////////////////////////////////////////////////////////////////////////
  429. defm : X86WriteResPairUnsupported<WriteCLMul>;
  430. ////////////////////////////////////////////////////////////////////////////////
  431. // Load/store MXCSR.
  432. ////////////////////////////////////////////////////////////////////////////////
  433. defm : X86WriteRes<WriteLDMXCSR, [AtomPort0,AtomPort1], 5, [5,5], 4>;
  434. defm : X86WriteRes<WriteSTMXCSR, [AtomPort0,AtomPort1], 15, [15,15], 4>;
  435. ////////////////////////////////////////////////////////////////////////////////
  436. // Special Cases.
  437. ////////////////////////////////////////////////////////////////////////////////
  438. // Port0
  439. def AtomWrite0_1 : SchedWriteRes<[AtomPort0]> {
  440. let Latency = 1;
  441. let ResourceCycles = [1];
  442. }
  443. def : InstRW<[AtomWrite0_1], (instrs XAM_F, LD_Frr,
  444. MOVSX64rr32)>;
  445. def : SchedAlias<WriteALURMW, AtomWrite0_1>;
  446. def : SchedAlias<WriteADCRMW, AtomWrite0_1>;
  447. def : InstRW<[AtomWrite0_1], (instregex "(RCL|RCR|ROL|ROR|SAR|SHL|SHR)(8|16|32|64)m",
  448. "MOV(S|Z)X(32|64)rr(8|8_NOREX|16)")>;
  449. // Port1
  450. def AtomWrite1_1 : SchedWriteRes<[AtomPort1]> {
  451. let Latency = 1;
  452. let ResourceCycles = [1];
  453. }
  454. def : InstRW<[AtomWrite1_1], (instrs FCOMPP)>;
  455. def : InstRW<[AtomWrite1_1], (instregex "UCOM_F(P|PP)?r")>;
  456. def AtomWrite1_5 : SchedWriteRes<[AtomPort1]> {
  457. let Latency = 5;
  458. let ResourceCycles = [5];
  459. }
  460. def : InstRW<[AtomWrite1_5], (instrs MMX_CVTPI2PSrr, MMX_CVTPI2PSrm,
  461. MMX_CVTPS2PIrr, MMX_CVTTPS2PIrr)>;
  462. // Port0 and Port1
  463. def AtomWrite0_1_1 : SchedWriteRes<[AtomPort0, AtomPort1]> {
  464. let Latency = 1;
  465. let ResourceCycles = [1, 1];
  466. }
  467. def : InstRW<[AtomWrite0_1_1], (instrs POP32r, POP64r,
  468. POP16rmr, POP32rmr, POP64rmr,
  469. PUSH16r, PUSH32r, PUSH64r,
  470. PUSHi16, PUSHi32,
  471. PUSH16rmr, PUSH32rmr, PUSH64rmr,
  472. PUSH16i8, PUSH32i8, PUSH64i8, PUSH64i32,
  473. XCH_F)>;
  474. def : InstRW<[AtomWrite0_1_1], (instregex "RETI(16|32|64)$",
  475. "IRET(16|32|64)?")>;
  476. def AtomWrite0_1_5 : SchedWriteRes<[AtomPort0, AtomPort1]> {
  477. let Latency = 5;
  478. let ResourceCycles = [5, 5];
  479. }
  480. def : InstRW<[AtomWrite0_1_5], (instrs MMX_CVTPS2PIrm, MMX_CVTTPS2PIrm)>;
  481. def : InstRW<[AtomWrite0_1_5], (instregex "ILD_F(16|32|64)")>;
  482. def AtomWrite0_1_7 : SchedWriteRes<[AtomPort0,AtomPort1]> {
  483. let Latency = 7;
  484. let ResourceCycles = [6,6];
  485. }
  486. def : InstRW<[AtomWrite0_1_7], (instregex "CVTSI642SDrm(_Int)?")>;
  487. def AtomWrite0_1_7_4 : SchedWriteRes<[AtomPort0,AtomPort1]> {
  488. let Latency = 7;
  489. let ResourceCycles = [8,8];
  490. let NumMicroOps = 4;
  491. }
  492. def : InstRW<[AtomWrite0_1_7_4], (instregex "CVTSI642SSrr(_Int)?")>;
  493. def AtomWrite0_1_8_4 : SchedWriteRes<[AtomPort0,AtomPort1]> {
  494. let Latency = 8;
  495. let ResourceCycles = [8,8];
  496. let NumMicroOps = 4;
  497. }
  498. def : InstRW<[AtomWrite0_1_7_4], (instregex "CVTSI642SSrm(_Int)?")>;
  499. def AtomWrite0_1_9 : SchedWriteRes<[AtomPort0,AtomPort1]> {
  500. let Latency = 9;
  501. let ResourceCycles = [9,9];
  502. let NumMicroOps = 4;
  503. }
  504. def : InstRW<[AtomWrite0_1_9], (instregex "CVT(T)?SS2SI64rr(_Int)?")>;
  505. def AtomWrite0_1_10 : SchedWriteRes<[AtomPort0,AtomPort1]> {
  506. let Latency = 10;
  507. let ResourceCycles = [11,11];
  508. let NumMicroOps = 5;
  509. }
  510. def : InstRW<[AtomWrite0_1_10], (instregex "CVT(T)?SS2SI64rm(_Int)?")>;
  511. // Port0 or Port1
  512. def AtomWrite01_1 : SchedWriteRes<[AtomPort01]> {
  513. let Latency = 1;
  514. let ResourceCycles = [1];
  515. }
  516. def : InstRW<[AtomWrite01_1], (instrs FDECSTP, FFREE, FFREEP, FINCSTP, WAIT,
  517. LFENCE,
  518. STOSB, STOSL, STOSQ, STOSW,
  519. MOVSSrr, MOVSSrr_REV)>;
  520. def AtomWrite01_2 : SchedWriteRes<[AtomPort01]> {
  521. let Latency = 2;
  522. let ResourceCycles = [2];
  523. }
  524. def : InstRW<[AtomWrite01_2], (instrs LEAVE, LEAVE64, POP16r,
  525. PUSH16rmm, PUSH32rmm, PUSH64rmm,
  526. LODSB, LODSL, LODSQ, LODSW,
  527. SCASB, SCASL, SCASQ, SCASW)>;
  528. def : InstRW<[AtomWrite01_2], (instregex "PUSH(CS|DS|ES|FS|GS|SS)(16|32|64)",
  529. "(ST|ISTT)_F(P)?(16|32|64)?(m|rr)",
  530. "MMX_P(ADD|SUB)Qrr",
  531. "MOV(S|Z)X16rr8",
  532. "MOV(UPS|UPD|DQU)mr",
  533. "MASKMOVDQU(64)?",
  534. "P(ADD|SUB)Qrr")>;
  535. def : SchedAlias<WriteBitTestSetImmRMW, AtomWrite01_2>;
  536. def AtomWrite01_3 : SchedWriteRes<[AtomPort01]> {
  537. let Latency = 3;
  538. let ResourceCycles = [3];
  539. }
  540. def : InstRW<[AtomWrite01_3], (instrs CLD, LDDQUrm,
  541. CMPSB, CMPSL, CMPSQ, CMPSW,
  542. MOVSB, MOVSL, MOVSQ, MOVSW,
  543. POP16rmm, POP32rmm, POP64rmm)>;
  544. def : InstRW<[AtomWrite01_3], (instregex "XADD(8|16|32|64)rm",
  545. "XCHG(8|16|32|64)rm",
  546. "PH(ADD|SUB)Drr",
  547. "MOV(S|Z)X16rm8",
  548. "MMX_P(ADD|SUB)Qrm",
  549. "MOV(UPS|UPD|DQU)rm",
  550. "P(ADD|SUB)Qrm")>;
  551. def AtomWrite01_4 : SchedWriteRes<[AtomPort01]> {
  552. let Latency = 4;
  553. let ResourceCycles = [4];
  554. }
  555. def : InstRW<[AtomWrite01_4], (instrs CBW, CWD, CWDE, CDQ, CDQE, CQO,
  556. JCXZ, JECXZ, JRCXZ,
  557. LD_F80m)>;
  558. def : InstRW<[AtomWrite01_4], (instregex "PH(ADD|SUB)Drm",
  559. "(MMX_)?PEXTRWrr(_REV)?")>;
  560. def AtomWrite01_5 : SchedWriteRes<[AtomPort01]> {
  561. let Latency = 5;
  562. let ResourceCycles = [5];
  563. }
  564. def : InstRW<[AtomWrite01_5], (instrs FLDCW16m, ST_FP80m)>;
  565. def : InstRW<[AtomWrite01_5], (instregex "MMX_PH(ADD|SUB)S?Wrr")>;
  566. def AtomWrite01_6 : SchedWriteRes<[AtomPort01]> {
  567. let Latency = 6;
  568. let ResourceCycles = [6];
  569. }
  570. def : InstRW<[AtomWrite01_6], (instrs CMPXCHG8rm, INTO, XLAT,
  571. SHLD16rrCL, SHRD16rrCL,
  572. SHLD16rri8, SHRD16rri8,
  573. SHLD16mrCL, SHRD16mrCL,
  574. SHLD16mri8, SHRD16mri8)>;
  575. def : InstRW<[AtomWrite01_6], (instregex "IST_F(P)?(16|32|64)?m",
  576. "MMX_PH(ADD|SUB)S?Wrm")>;
  577. def AtomWrite01_7 : SchedWriteRes<[AtomPort01]> {
  578. let Latency = 7;
  579. let ResourceCycles = [7];
  580. }
  581. def : InstRW<[AtomWrite01_7], (instrs AAD8i8)>;
  582. def AtomWrite01_8 : SchedWriteRes<[AtomPort01]> {
  583. let Latency = 8;
  584. let ResourceCycles = [8];
  585. }
  586. def : InstRW<[AtomWrite01_8], (instrs LOOPE,
  587. PUSHA16, PUSHA32,
  588. SHLD64rrCL, SHRD64rrCL,
  589. FNSTCW16m)>;
  590. def AtomWrite01_9 : SchedWriteRes<[AtomPort01]> {
  591. let Latency = 9;
  592. let ResourceCycles = [9];
  593. }
  594. def : InstRW<[AtomWrite01_9], (instrs POPA16, POPA32,
  595. PUSHF16, PUSHF32, PUSHF64,
  596. SHLD64mrCL, SHRD64mrCL,
  597. SHLD64mri8, SHRD64mri8,
  598. SHLD64rri8, SHRD64rri8,
  599. CMPXCHG8rr)>;
  600. def : InstRW<[AtomWrite01_9], (instregex "(U)?COM_FI", "TST_F")>;
  601. def AtomWrite01_10 : SchedWriteRes<[AtomPort01]> {
  602. let Latency = 10;
  603. let ResourceCycles = [10];
  604. }
  605. def : SchedAlias<WriteFLDC, AtomWrite01_10>;
  606. def AtomWrite01_11 : SchedWriteRes<[AtomPort01]> {
  607. let Latency = 11;
  608. let ResourceCycles = [11];
  609. }
  610. def : InstRW<[AtomWrite01_11], (instrs BOUNDS16rm, BOUNDS32rm)>;
  611. def : SchedAlias<WriteBitTestSetRegRMW, AtomWrite01_11>;
  612. def AtomWrite01_13 : SchedWriteRes<[AtomPort01]> {
  613. let Latency = 13;
  614. let ResourceCycles = [13];
  615. }
  616. def : InstRW<[AtomWrite01_13], (instrs AAA, AAS)>;
  617. def AtomWrite01_14 : SchedWriteRes<[AtomPort01]> {
  618. let Latency = 14;
  619. let ResourceCycles = [14];
  620. }
  621. def : InstRW<[AtomWrite01_14], (instrs CMPXCHG16rm, CMPXCHG32rm, CMPXCHG64rm)>;
  622. def AtomWrite01_17 : SchedWriteRes<[AtomPort01]> {
  623. let Latency = 17;
  624. let ResourceCycles = [17];
  625. }
  626. def : InstRW<[AtomWrite01_17], (instrs LOOPNE, PAUSE)>;
  627. def AtomWrite01_18 : SchedWriteRes<[AtomPort01]> {
  628. let Latency = 18;
  629. let ResourceCycles = [18];
  630. }
  631. def : InstRW<[AtomWrite01_18], (instrs CMPXCHG8B, DAA, LOOP)>;
  632. def AtomWrite01_20 : SchedWriteRes<[AtomPort01]> {
  633. let Latency = 20;
  634. let ResourceCycles = [20];
  635. }
  636. def : InstRW<[AtomWrite01_20], (instrs DAS)>;
  637. def AtomWrite01_21 : SchedWriteRes<[AtomPort01]> {
  638. let Latency = 21;
  639. let ResourceCycles = [21];
  640. }
  641. def : InstRW<[AtomWrite01_21], (instrs AAM8i8, STD)>;
  642. def AtomWrite01_22 : SchedWriteRes<[AtomPort01]> {
  643. let Latency = 22;
  644. let ResourceCycles = [22];
  645. }
  646. def : InstRW<[AtomWrite01_22], (instrs CMPXCHG16B)>;
  647. def AtomWrite01_23 : SchedWriteRes<[AtomPort01]> {
  648. let Latency = 23;
  649. let ResourceCycles = [23];
  650. }
  651. def : InstRW<[AtomWrite01_23], (instrs ARPL16mr, ARPL16rr)>;
  652. def AtomWrite01_25 : SchedWriteRes<[AtomPort01]> {
  653. let Latency = 25;
  654. let ResourceCycles = [25];
  655. }
  656. def : InstRW<[AtomWrite01_25], (instrs FNCLEX, FXTRACT)>;
  657. def AtomWrite01_26 : SchedWriteRes<[AtomPort01]> {
  658. let Latency = 26;
  659. let ResourceCycles = [26];
  660. }
  661. def : InstRW<[AtomWrite01_26], (instrs POPF32, POPF64)>;
  662. def AtomWrite01_29 : SchedWriteRes<[AtomPort01]> {
  663. let Latency = 29;
  664. let ResourceCycles = [29];
  665. }
  666. def : InstRW<[AtomWrite01_29], (instregex "POP(DS|ES|FS|GS)(16|32|64)")>;
  667. def AtomWrite01_30 : SchedWriteRes<[AtomPort01]> {
  668. let Latency = 30;
  669. let ResourceCycles = [30];
  670. }
  671. def : InstRW<[AtomWrite01_30], (instrs RDTSC, RDTSCP)>;
  672. def AtomWrite01_32 : SchedWriteRes<[AtomPort01]> {
  673. let Latency = 32;
  674. let ResourceCycles = [32];
  675. }
  676. def : InstRW<[AtomWrite01_32], (instrs ENTER, POPF16)>;
  677. def AtomWrite01_45 : SchedWriteRes<[AtomPort01]> {
  678. let Latency = 45;
  679. let ResourceCycles = [45];
  680. }
  681. def : InstRW<[AtomWrite01_45], (instrs MONITOR32rrr, MONITOR64rrr)>;
  682. def AtomWrite01_46 : SchedWriteRes<[AtomPort01]> {
  683. let Latency = 46;
  684. let ResourceCycles = [46];
  685. }
  686. def : InstRW<[AtomWrite01_46], (instrs FRNDINT, MWAITrr, RDPMC)>;
  687. def AtomWrite01_48 : SchedWriteRes<[AtomPort01]> {
  688. let Latency = 48;
  689. let ResourceCycles = [48];
  690. }
  691. def : InstRW<[AtomWrite01_48], (instrs POPSS16, POPSS32)>;
  692. def AtomWrite01_55 : SchedWriteRes<[AtomPort01]> {
  693. let Latency = 55;
  694. let ResourceCycles = [55];
  695. }
  696. def : InstRW<[AtomWrite01_55], (instrs FPREM)>;
  697. def AtomWrite01_59 : SchedWriteRes<[AtomPort01]> {
  698. let Latency = 59;
  699. let ResourceCycles = [59];
  700. }
  701. def : InstRW<[AtomWrite01_59], (instrs INSB, INSL, INSW)>;
  702. def AtomWrite01_63 : SchedWriteRes<[AtomPort01]> {
  703. let Latency = 63;
  704. let ResourceCycles = [63];
  705. }
  706. def : InstRW<[AtomWrite01_63], (instrs FNINIT)>;
  707. def AtomWrite01_68 : SchedWriteRes<[AtomPort01]> {
  708. let Latency = 68;
  709. let ResourceCycles = [68];
  710. }
  711. def : InstRW<[AtomWrite01_68], (instrs OUT8rr, OUT16rr, OUT32rr)>;
  712. def AtomWrite01_71 : SchedWriteRes<[AtomPort01]> {
  713. let Latency = 71;
  714. let ResourceCycles = [71];
  715. }
  716. def : InstRW<[AtomWrite01_71], (instrs FPREM1,
  717. INVLPG, INVLPGA32, INVLPGA64)>;
  718. def AtomWrite01_72 : SchedWriteRes<[AtomPort01]> {
  719. let Latency = 72;
  720. let ResourceCycles = [72];
  721. }
  722. def : InstRW<[AtomWrite01_72], (instrs OUT8ir, OUT16ir, OUT32ir)>;
  723. def AtomWrite01_74 : SchedWriteRes<[AtomPort01]> {
  724. let Latency = 74;
  725. let ResourceCycles = [74];
  726. }
  727. def : InstRW<[AtomWrite01_74], (instrs OUTSB, OUTSL, OUTSW)>;
  728. def AtomWrite01_77 : SchedWriteRes<[AtomPort01]> {
  729. let Latency = 77;
  730. let ResourceCycles = [77];
  731. }
  732. def : InstRW<[AtomWrite01_77], (instrs FSCALE)>;
  733. def AtomWrite01_78 : SchedWriteRes<[AtomPort01]> {
  734. let Latency = 78;
  735. let ResourceCycles = [78];
  736. }
  737. def : InstRW<[AtomWrite01_78], (instrs RDMSR)>;
  738. def AtomWrite01_79 : SchedWriteRes<[AtomPort01]> {
  739. let Latency = 79;
  740. let ResourceCycles = [79];
  741. }
  742. def : InstRW<[AtomWrite01_79], (instregex "RET(16|32|64)?$",
  743. "LRETI?(16|32|64)")>;
  744. def AtomWrite01_92 : SchedWriteRes<[AtomPort01]> {
  745. let Latency = 92;
  746. let ResourceCycles = [92];
  747. }
  748. def : InstRW<[AtomWrite01_92], (instrs IN8ri, IN16ri, IN32ri)>;
  749. def AtomWrite01_94 : SchedWriteRes<[AtomPort01]> {
  750. let Latency = 94;
  751. let ResourceCycles = [94];
  752. }
  753. def : InstRW<[AtomWrite01_94], (instrs IN8rr, IN16rr, IN32rr)>;
  754. def AtomWrite01_99 : SchedWriteRes<[AtomPort01]> {
  755. let Latency = 99;
  756. let ResourceCycles = [99];
  757. }
  758. def : InstRW<[AtomWrite01_99], (instrs F2XM1)>;
  759. def AtomWrite01_121 : SchedWriteRes<[AtomPort01]> {
  760. let Latency = 121;
  761. let ResourceCycles = [121];
  762. }
  763. def : InstRW<[AtomWrite01_121], (instrs CPUID)>;
  764. def AtomWrite01_127 : SchedWriteRes<[AtomPort01]> {
  765. let Latency = 127;
  766. let ResourceCycles = [127];
  767. }
  768. def : InstRW<[AtomWrite01_127], (instrs INT)>;
  769. def AtomWrite01_130 : SchedWriteRes<[AtomPort01]> {
  770. let Latency = 130;
  771. let ResourceCycles = [130];
  772. }
  773. def : InstRW<[AtomWrite01_130], (instrs INT3)>;
  774. def AtomWrite01_140 : SchedWriteRes<[AtomPort01]> {
  775. let Latency = 140;
  776. let ResourceCycles = [140];
  777. }
  778. def : InstRW<[AtomWrite01_140], (instrs FXSAVE, FXSAVE64)>;
  779. def AtomWrite01_141 : SchedWriteRes<[AtomPort01]> {
  780. let Latency = 141;
  781. let ResourceCycles = [141];
  782. }
  783. def : InstRW<[AtomWrite01_141], (instrs FXRSTOR, FXRSTOR64)>;
  784. def AtomWrite01_146 : SchedWriteRes<[AtomPort01]> {
  785. let Latency = 146;
  786. let ResourceCycles = [146];
  787. }
  788. def : InstRW<[AtomWrite01_146], (instrs FYL2X)>;
  789. def AtomWrite01_147 : SchedWriteRes<[AtomPort01]> {
  790. let Latency = 147;
  791. let ResourceCycles = [147];
  792. }
  793. def : InstRW<[AtomWrite01_147], (instrs FYL2XP1)>;
  794. def AtomWrite01_168 : SchedWriteRes<[AtomPort01]> {
  795. let Latency = 168;
  796. let ResourceCycles = [168];
  797. }
  798. def : InstRW<[AtomWrite01_168], (instrs FPTAN)>;
  799. def AtomWrite01_174 : SchedWriteRes<[AtomPort01]> {
  800. let Latency = 174;
  801. let ResourceCycles = [174];
  802. }
  803. def : InstRW<[AtomWrite01_174], (instrs FSINCOS, FSIN, FCOS)>;
  804. def AtomWrite01_183 : SchedWriteRes<[AtomPort01]> {
  805. let Latency = 183;
  806. let ResourceCycles = [183];
  807. }
  808. def : InstRW<[AtomWrite01_183], (instrs FPATAN)>;
  809. def AtomWrite01_202 : SchedWriteRes<[AtomPort01]> {
  810. let Latency = 202;
  811. let ResourceCycles = [202];
  812. }
  813. def : InstRW<[AtomWrite01_202], (instrs WRMSR)>;
  814. } // SchedModel