1 //=- X86SchedSkylake.td - X86 Skylake Server Scheduling ------*- tablegen -*-=//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines the machine model for Skylake Server to support
10 // instruction scheduling and other instruction cost heuristics.
12 //===----------------------------------------------------------------------===//
14 def SkylakeServerModel : SchedMachineModel {
15 // All x86 instructions are modeled as a single micro-op, and SKylake can
16 // decode 6 instructions per cycle.
18 let MicroOpBufferSize = 224; // Based on the reorder buffer.
20 let MispredictPenalty = 14;
22 // Based on the LSD (loop-stream detector) queue size and benchmarking data.
23 let LoopMicroOpBufferSize = 50;
25 // This flag is set to allow the scheduler to assign a default model to
26 // unrecognized opcodes.
27 let CompleteModel = 0;
30 let SchedModel = SkylakeServerModel in {
32 // Skylake Server can issue micro-ops to 8 different ports in one cycle.
34 // Ports 0, 1, 5, and 6 handle all computation.
35 // Port 4 gets the data half of stores. Store data can be available later than
36 // the store address, but since we don't model the latency of stores, we can
38 // Ports 2 and 3 are identical. They handle loads and the address half of
39 // stores. Port 7 can handle address calculations.
40 def SKXPort0 : ProcResource<1>;
41 def SKXPort1 : ProcResource<1>;
42 def SKXPort2 : ProcResource<1>;
43 def SKXPort3 : ProcResource<1>;
44 def SKXPort4 : ProcResource<1>;
45 def SKXPort5 : ProcResource<1>;
46 def SKXPort6 : ProcResource<1>;
47 def SKXPort7 : ProcResource<1>;
49 // Many micro-ops are capable of issuing on multiple ports.
50 def SKXPort01 : ProcResGroup<[SKXPort0, SKXPort1]>;
51 def SKXPort23 : ProcResGroup<[SKXPort2, SKXPort3]>;
52 def SKXPort237 : ProcResGroup<[SKXPort2, SKXPort3, SKXPort7]>;
53 def SKXPort04 : ProcResGroup<[SKXPort0, SKXPort4]>;
54 def SKXPort05 : ProcResGroup<[SKXPort0, SKXPort5]>;
55 def SKXPort06 : ProcResGroup<[SKXPort0, SKXPort6]>;
56 def SKXPort15 : ProcResGroup<[SKXPort1, SKXPort5]>;
57 def SKXPort16 : ProcResGroup<[SKXPort1, SKXPort6]>;
58 def SKXPort56 : ProcResGroup<[SKXPort5, SKXPort6]>;
59 def SKXPort015 : ProcResGroup<[SKXPort0, SKXPort1, SKXPort5]>;
60 def SKXPort056 : ProcResGroup<[SKXPort0, SKXPort5, SKXPort6]>;
61 def SKXPort0156: ProcResGroup<[SKXPort0, SKXPort1, SKXPort5, SKXPort6]>;
63 def SKXDivider : ProcResource<1>; // Integer division issued on port 0.
64 // FP division and sqrt on port 0.
65 def SKXFPDivider : ProcResource<1>;
67 // 60 Entry Unified Scheduler
68 def SKXPortAny : ProcResGroup<[SKXPort0, SKXPort1, SKXPort2, SKXPort3, SKXPort4,
69 SKXPort5, SKXPort6, SKXPort7]> {
73 // Integer loads are 5 cycles, so ReadAfterLd registers needn't be available until 5
74 // cycles after the memory operand.
75 def : ReadAdvance<ReadAfterLd, 5>;
77 // Vector loads are 5/6/7 cycles, so ReadAfterVec*Ld registers needn't be available
78 // until 5/6/7 cycles after the memory operand.
79 def : ReadAdvance<ReadAfterVecLd, 5>;
80 def : ReadAdvance<ReadAfterVecXLd, 6>;
81 def : ReadAdvance<ReadAfterVecYLd, 7>;
83 def : ReadAdvance<ReadInt2Fpu, 0>;
85 // Many SchedWrites are defined in pairs with and without a folded load.
86 // Instructions with folded loads are usually micro-fused, so they only appear
87 // as two micro-ops when queued in the reservation station.
88 // This multiclass defines the resource usage for variants with and without
90 multiclass SKXWriteResPair<X86FoldableSchedWrite SchedRW,
91 list<ProcResourceKind> ExePorts,
92 int Lat, list<int> Res = [1], int UOps = 1,
94 // Register variant is using a single cycle on ExePort.
95 def : WriteRes<SchedRW, ExePorts> {
97 let ResourceCycles = Res;
98 let NumMicroOps = UOps;
101 // Memory variant also uses a cycle on port 2/3 and adds LoadLat cycles to
102 // the latency (default = 5).
103 def : WriteRes<SchedRW.Folded, !listconcat([SKXPort23], ExePorts)> {
104 let Latency = !add(Lat, LoadLat);
105 let ResourceCycles = !listconcat([1], Res);
106 let NumMicroOps = !add(UOps, 1);
110 // A folded store needs a cycle on port 4 for the store data, and an extra port
111 // 2/3/7 cycle to recompute the address.
112 def : WriteRes<WriteRMW, [SKXPort237,SKXPort4]>;
115 defm : SKXWriteResPair<WriteALU, [SKXPort0156], 1>; // Simple integer ALU op.
116 defm : SKXWriteResPair<WriteADC, [SKXPort06], 1>; // Integer ALU + flags op.
118 // Integer multiplication.
119 defm : SKXWriteResPair<WriteIMul8, [SKXPort1], 3>;
120 defm : SKXWriteResPair<WriteIMul16, [SKXPort1,SKXPort06,SKXPort0156], 4, [1,1,2], 4>;
121 defm : X86WriteRes<WriteIMul16Imm, [SKXPort1,SKXPort0156], 4, [1,1], 2>;
122 defm : X86WriteRes<WriteIMul16ImmLd, [SKXPort1,SKXPort0156,SKXPort23], 8, [1,1,1], 3>;
123 defm : X86WriteRes<WriteIMul16Reg, [SKXPort1], 3, [1], 1>;
124 defm : X86WriteRes<WriteIMul16RegLd, [SKXPort1,SKXPort0156,SKXPort23], 8, [1,1,1], 3>;
125 defm : SKXWriteResPair<WriteIMul32, [SKXPort1,SKXPort06,SKXPort0156], 4, [1,1,1], 3>;
126 defm : SKXWriteResPair<WriteIMul32Imm, [SKXPort1], 3>;
127 defm : SKXWriteResPair<WriteIMul32Reg, [SKXPort1], 3>;
128 defm : SKXWriteResPair<WriteIMul64, [SKXPort1,SKXPort5], 4, [1,1], 2>;
129 defm : SKXWriteResPair<WriteIMul64Imm, [SKXPort1], 3>;
130 defm : SKXWriteResPair<WriteIMul64Reg, [SKXPort1], 3>;
131 def : WriteRes<WriteIMulH, []> { let Latency = 3; }
133 defm : X86WriteRes<WriteBSWAP32, [SKXPort15], 1, [1], 1>;
134 defm : X86WriteRes<WriteBSWAP64, [SKXPort06, SKXPort15], 2, [1,1], 2>;
135 defm : X86WriteRes<WriteCMPXCHG,[SKXPort06, SKXPort0156], 5, [2,3], 5>;
136 defm : X86WriteRes<WriteCMPXCHGRMW,[SKXPort23,SKXPort06,SKXPort0156,SKXPort237,SKXPort4], 8, [1,2,1,1,1], 6>;
137 defm : X86WriteRes<WriteXCHG, [SKXPort0156], 2, [3], 3>;
139 // TODO: Why isn't the SKXDivider used?
140 defm : SKXWriteResPair<WriteDiv8, [SKXPort0, SKXDivider], 25, [1,10], 1, 4>;
141 defm : X86WriteRes<WriteDiv16, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort05,SKXPort0156], 76, [7,2,8,3,1,11], 32>;
142 defm : X86WriteRes<WriteDiv32, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort05,SKXPort0156], 76, [7,2,8,3,1,11], 32>;
143 defm : X86WriteRes<WriteDiv64, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort05,SKXPort0156], 76, [7,2,8,3,1,11], 32>;
144 defm : X86WriteRes<WriteDiv16Ld, [SKXPort0,SKXPort23,SKXDivider], 29, [1,1,10], 2>;
145 defm : X86WriteRes<WriteDiv32Ld, [SKXPort0,SKXPort23,SKXDivider], 29, [1,1,10], 2>;
146 defm : X86WriteRes<WriteDiv64Ld, [SKXPort0,SKXPort23,SKXDivider], 29, [1,1,10], 2>;
148 defm : X86WriteRes<WriteIDiv8, [SKXPort0, SKXDivider], 25, [1,10], 1>;
149 defm : X86WriteRes<WriteIDiv16, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort06,SKXPort0156], 102, [4,2,4,8,14,34], 66>;
150 defm : X86WriteRes<WriteIDiv32, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort06,SKXPort0156], 102, [4,2,4,8,14,34], 66>;
151 defm : X86WriteRes<WriteIDiv64, [SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort06,SKXPort0156], 102, [4,2,4,8,14,34], 66>;
152 defm : X86WriteRes<WriteIDiv8Ld, [SKXPort0,SKXPort5,SKXPort23,SKXPort0156], 28, [2,4,1,1], 8>;
153 defm : X86WriteRes<WriteIDiv16Ld, [SKXPort0,SKXPort5,SKXPort23,SKXPort0156], 28, [2,4,1,1], 8>;
154 defm : X86WriteRes<WriteIDiv32Ld, [SKXPort0,SKXPort5,SKXPort23,SKXPort0156], 28, [2,4,1,1], 8>;
155 defm : X86WriteRes<WriteIDiv64Ld, [SKXPort0,SKXPort5,SKXPort23,SKXPort0156], 28, [2,4,1,1], 8>;
157 defm : SKXWriteResPair<WriteCRC32, [SKXPort1], 3>;
159 def : WriteRes<WriteLEA, [SKXPort15]>; // LEA instructions can't fold loads.
161 defm : SKXWriteResPair<WriteCMOV, [SKXPort06], 1, [1], 1>; // Conditional move.
162 defm : X86WriteRes<WriteFCMOV, [SKXPort1], 3, [1], 1>; // x87 conditional move.
163 def : WriteRes<WriteSETCC, [SKXPort06]>; // Setcc.
164 def : WriteRes<WriteSETCCStore, [SKXPort06,SKXPort4,SKXPort237]> {
168 defm : X86WriteRes<WriteLAHFSAHF, [SKXPort06], 1, [1], 1>;
169 defm : X86WriteRes<WriteBitTest, [SKXPort06], 1, [1], 1>;
170 defm : X86WriteRes<WriteBitTestImmLd, [SKXPort06,SKXPort23], 6, [1,1], 2>;
171 defm : X86WriteRes<WriteBitTestRegLd, [SKXPort0156,SKXPort23], 6, [1,1], 2>;
172 defm : X86WriteRes<WriteBitTestSet, [SKXPort06], 1, [1], 1>;
173 defm : X86WriteRes<WriteBitTestSetImmLd, [SKXPort06,SKXPort23], 5, [1,1], 3>;
174 defm : X86WriteRes<WriteBitTestSetRegLd, [SKXPort0156,SKXPort23], 5, [1,1], 2>;
176 // Integer shifts and rotates.
177 defm : SKXWriteResPair<WriteShift, [SKXPort06], 1>;
178 defm : SKXWriteResPair<WriteShiftCL, [SKXPort06], 3, [3], 3>;
179 defm : SKXWriteResPair<WriteRotate, [SKXPort06], 1, [1], 1>;
180 defm : SKXWriteResPair<WriteRotateCL, [SKXPort06], 3, [3], 3>;
183 defm : X86WriteRes<WriteSHDrri, [SKXPort1], 3, [1], 1>;
184 defm : X86WriteRes<WriteSHDrrcl,[SKXPort1,SKXPort06,SKXPort0156], 6, [1, 2, 1], 4>;
185 defm : X86WriteRes<WriteSHDmri, [SKXPort1,SKXPort23,SKXPort237,SKXPort0156], 9, [1, 1, 1, 1], 4>;
186 defm : X86WriteRes<WriteSHDmrcl,[SKXPort1,SKXPort23,SKXPort237,SKXPort06,SKXPort0156], 11, [1, 1, 1, 2, 1], 6>;
189 defm : SKXWriteResPair<WriteBSF, [SKXPort1], 3>;
190 defm : SKXWriteResPair<WriteBSR, [SKXPort1], 3>;
191 defm : SKXWriteResPair<WriteLZCNT, [SKXPort1], 3>;
192 defm : SKXWriteResPair<WriteTZCNT, [SKXPort1], 3>;
193 defm : SKXWriteResPair<WritePOPCNT, [SKXPort1], 3>;
195 // BMI1 BEXTR/BLS, BMI2 BZHI
196 defm : SKXWriteResPair<WriteBEXTR, [SKXPort06,SKXPort15], 2, [1,1], 2>;
197 defm : SKXWriteResPair<WriteBLS, [SKXPort15], 1>;
198 defm : SKXWriteResPair<WriteBZHI, [SKXPort15], 1>;
200 // Loads, stores, and moves, not folded with other operations.
201 defm : X86WriteRes<WriteLoad, [SKXPort23], 5, [1], 1>;
202 defm : X86WriteRes<WriteStore, [SKXPort237, SKXPort4], 1, [1,1], 1>;
203 defm : X86WriteRes<WriteStoreNT, [SKXPort237, SKXPort4], 1, [1,1], 2>;
204 defm : X86WriteRes<WriteMove, [SKXPort0156], 1, [1], 1>;
206 // Idioms that clear a register, like xorps %xmm0, %xmm0.
207 // These can often bypass execution ports completely.
208 def : WriteRes<WriteZero, []>;
210 // Branches don't produce values, so they have no latency, but they still
211 // consume resources. Indirect branches can fold loads.
212 defm : SKXWriteResPair<WriteJump, [SKXPort06], 1>;
214 // Floating point. This covers both scalar and vector operations.
215 defm : X86WriteRes<WriteFLD0, [SKXPort05], 1, [1], 1>;
216 defm : X86WriteRes<WriteFLD1, [SKXPort05], 1, [2], 2>;
217 defm : X86WriteRes<WriteFLDC, [SKXPort05], 1, [2], 2>;
218 defm : X86WriteRes<WriteFLoad, [SKXPort23], 5, [1], 1>;
219 defm : X86WriteRes<WriteFLoadX, [SKXPort23], 6, [1], 1>;
220 defm : X86WriteRes<WriteFLoadY, [SKXPort23], 7, [1], 1>;
221 defm : X86WriteRes<WriteFMaskedLoad, [SKXPort23,SKXPort015], 7, [1,1], 2>;
222 defm : X86WriteRes<WriteFMaskedLoadY, [SKXPort23,SKXPort015], 8, [1,1], 2>;
223 defm : X86WriteRes<WriteFStore, [SKXPort237,SKXPort4], 1, [1,1], 2>;
224 defm : X86WriteRes<WriteFStoreX, [SKXPort237,SKXPort4], 1, [1,1], 2>;
225 defm : X86WriteRes<WriteFStoreY, [SKXPort237,SKXPort4], 1, [1,1], 2>;
226 defm : X86WriteRes<WriteFStoreNT, [SKXPort237,SKXPort4], 1, [1,1], 2>;
227 defm : X86WriteRes<WriteFStoreNTX, [SKXPort237,SKXPort4], 1, [1,1], 2>;
228 defm : X86WriteRes<WriteFStoreNTY, [SKXPort237,SKXPort4], 1, [1,1], 2>;
229 defm : X86WriteRes<WriteFMaskedStore, [SKXPort237,SKXPort0], 2, [1,1], 2>;
230 defm : X86WriteRes<WriteFMaskedStoreY, [SKXPort237,SKXPort0], 2, [1,1], 2>;
231 defm : X86WriteRes<WriteFMove, [SKXPort015], 1, [1], 1>;
232 defm : X86WriteRes<WriteFMoveX, [SKXPort015], 1, [1], 1>;
233 defm : X86WriteRes<WriteFMoveY, [SKXPort015], 1, [1], 1>;
234 defm : X86WriteRes<WriteEMMS, [SKXPort05,SKXPort0156], 10, [9,1], 10>;
236 defm : SKXWriteResPair<WriteFAdd, [SKXPort01], 4, [1], 1, 5>; // Floating point add/sub.
237 defm : SKXWriteResPair<WriteFAddX, [SKXPort01], 4, [1], 1, 6>;
238 defm : SKXWriteResPair<WriteFAddY, [SKXPort01], 4, [1], 1, 7>;
239 defm : SKXWriteResPair<WriteFAddZ, [SKXPort05], 4, [1], 1, 7>;
240 defm : SKXWriteResPair<WriteFAdd64, [SKXPort01], 4, [1], 1, 5>; // Floating point double add/sub.
241 defm : SKXWriteResPair<WriteFAdd64X, [SKXPort01], 4, [1], 1, 6>;
242 defm : SKXWriteResPair<WriteFAdd64Y, [SKXPort01], 4, [1], 1, 7>;
243 defm : SKXWriteResPair<WriteFAdd64Z, [SKXPort05], 4, [1], 1, 7>;
245 defm : SKXWriteResPair<WriteFCmp, [SKXPort01], 4, [1], 1, 5>; // Floating point compare.
246 defm : SKXWriteResPair<WriteFCmpX, [SKXPort01], 4, [1], 1, 6>;
247 defm : SKXWriteResPair<WriteFCmpY, [SKXPort01], 4, [1], 1, 7>;
248 defm : SKXWriteResPair<WriteFCmpZ, [SKXPort05], 4, [1], 1, 7>;
249 defm : SKXWriteResPair<WriteFCmp64, [SKXPort01], 4, [1], 1, 5>; // Floating point double compare.
250 defm : SKXWriteResPair<WriteFCmp64X, [SKXPort01], 4, [1], 1, 6>;
251 defm : SKXWriteResPair<WriteFCmp64Y, [SKXPort01], 4, [1], 1, 7>;
252 defm : SKXWriteResPair<WriteFCmp64Z, [SKXPort05], 4, [1], 1, 7>;
254 defm : SKXWriteResPair<WriteFCom, [SKXPort0], 2>; // Floating point compare to flags.
256 defm : SKXWriteResPair<WriteFMul, [SKXPort01], 4, [1], 1, 5>; // Floating point multiplication.
257 defm : SKXWriteResPair<WriteFMulX, [SKXPort01], 4, [1], 1, 6>;
258 defm : SKXWriteResPair<WriteFMulY, [SKXPort01], 4, [1], 1, 7>;
259 defm : SKXWriteResPair<WriteFMulZ, [SKXPort05], 4, [1], 1, 7>;
260 defm : SKXWriteResPair<WriteFMul64, [SKXPort01], 4, [1], 1, 5>; // Floating point double multiplication.
261 defm : SKXWriteResPair<WriteFMul64X, [SKXPort01], 4, [1], 1, 6>;
262 defm : SKXWriteResPair<WriteFMul64Y, [SKXPort01], 4, [1], 1, 7>;
263 defm : SKXWriteResPair<WriteFMul64Z, [SKXPort05], 4, [1], 1, 7>;
265 defm : SKXWriteResPair<WriteFDiv, [SKXPort0,SKXFPDivider], 11, [1,3], 1, 5>; // 10-14 cycles. // Floating point division.
266 //defm : SKXWriteResPair<WriteFDivX, [SKXPort0,SKXFPDivider], 11, [1,3], 1, 6>; // 10-14 cycles.
267 defm : SKXWriteResPair<WriteFDivY, [SKXPort0,SKXFPDivider], 11, [1,5], 1, 7>; // 10-14 cycles.
268 defm : SKXWriteResPair<WriteFDivZ, [SKXPort0,SKXPort5,SKXFPDivider], 18, [2,1,10], 3, 7>; // 10-14 cycles.
269 //defm : SKXWriteResPair<WriteFDiv64, [SKXPort0,SKXFPDivider], 14, [1,3], 1, 5>; // 10-14 cycles. // Floating point division.
270 //defm : SKXWriteResPair<WriteFDiv64X, [SKXPort0,SKXFPDivider], 14, [1,3], 1, 6>; // 10-14 cycles.
271 //defm : SKXWriteResPair<WriteFDiv64Y, [SKXPort0,SKXFPDivider], 14, [1,5], 1, 7>; // 10-14 cycles.
272 defm : SKXWriteResPair<WriteFDiv64Z, [SKXPort0,SKXPort5,SKXFPDivider], 23, [2,1,16], 3, 7>; // 10-14 cycles.
274 defm : SKXWriteResPair<WriteFSqrt, [SKXPort0,SKXFPDivider], 12, [1,3], 1, 5>; // Floating point square root.
275 defm : SKXWriteResPair<WriteFSqrtX, [SKXPort0,SKXFPDivider], 12, [1,3], 1, 6>;
276 defm : SKXWriteResPair<WriteFSqrtY, [SKXPort0,SKXFPDivider], 12, [1,6], 1, 7>;
277 defm : SKXWriteResPair<WriteFSqrtZ, [SKXPort0,SKXPort5,SKXFPDivider], 20, [2,1,12], 3, 7>;
278 defm : SKXWriteResPair<WriteFSqrt64, [SKXPort0,SKXFPDivider], 18, [1,6], 1, 5>; // Floating point double square root.
279 defm : SKXWriteResPair<WriteFSqrt64X, [SKXPort0,SKXFPDivider], 18, [1,6], 1, 6>;
280 defm : SKXWriteResPair<WriteFSqrt64Y, [SKXPort0,SKXFPDivider], 18, [1,12],1, 7>;
281 defm : SKXWriteResPair<WriteFSqrt64Z, [SKXPort0,SKXPort5,SKXFPDivider], 32, [2,1,24], 3, 7>;
282 defm : SKXWriteResPair<WriteFSqrt80, [SKXPort0,SKXFPDivider], 21, [1,7]>; // Floating point long double square root.
284 defm : SKXWriteResPair<WriteFRcp, [SKXPort0], 4, [1], 1, 5>; // Floating point reciprocal estimate.
285 defm : SKXWriteResPair<WriteFRcpX, [SKXPort0], 4, [1], 1, 6>;
286 defm : SKXWriteResPair<WriteFRcpY, [SKXPort0], 4, [1], 1, 7>;
287 defm : SKXWriteResPair<WriteFRcpZ, [SKXPort0,SKXPort5], 4, [2,1], 3, 7>;
289 defm : SKXWriteResPair<WriteFRsqrt, [SKXPort0], 4, [1], 1, 5>; // Floating point reciprocal square root estimate.
290 defm : SKXWriteResPair<WriteFRsqrtX,[SKXPort0], 4, [1], 1, 6>;
291 defm : SKXWriteResPair<WriteFRsqrtY,[SKXPort0], 4, [1], 1, 7>;
292 defm : SKXWriteResPair<WriteFRsqrtZ,[SKXPort0,SKXPort5], 9, [2,1], 3, 7>;
294 defm : SKXWriteResPair<WriteFMA, [SKXPort01], 4, [1], 1, 5>; // Fused Multiply Add.
295 defm : SKXWriteResPair<WriteFMAX, [SKXPort01], 4, [1], 1, 6>;
296 defm : SKXWriteResPair<WriteFMAY, [SKXPort01], 4, [1], 1, 7>;
297 defm : SKXWriteResPair<WriteFMAZ, [SKXPort05], 4, [1], 1, 7>;
298 defm : SKXWriteResPair<WriteDPPD, [SKXPort5,SKXPort015], 9, [1,2], 3, 6>; // Floating point double dot product.
299 defm : SKXWriteResPair<WriteDPPS, [SKXPort5,SKXPort015], 13, [1,3], 4, 6>;
300 defm : SKXWriteResPair<WriteDPPSY,[SKXPort5,SKXPort015], 13, [1,3], 4, 7>;
301 defm : SKXWriteResPair<WriteDPPSZ,[SKXPort5,SKXPort015], 13, [1,3], 4, 7>;
302 defm : SKXWriteResPair<WriteFSign, [SKXPort0], 1>; // Floating point fabs/fchs.
303 defm : SKXWriteResPair<WriteFRnd, [SKXPort01], 8, [2], 2, 6>; // Floating point rounding.
304 defm : SKXWriteResPair<WriteFRndY, [SKXPort01], 8, [2], 2, 7>;
305 defm : SKXWriteResPair<WriteFRndZ, [SKXPort05], 8, [2], 2, 7>;
306 defm : SKXWriteResPair<WriteFLogic, [SKXPort015], 1, [1], 1, 6>; // Floating point and/or/xor logicals.
307 defm : SKXWriteResPair<WriteFLogicY, [SKXPort015], 1, [1], 1, 7>;
308 defm : SKXWriteResPair<WriteFLogicZ, [SKXPort05], 1, [1], 1, 7>;
309 defm : SKXWriteResPair<WriteFTest, [SKXPort0], 2, [1], 1, 6>; // Floating point TEST instructions.
310 defm : SKXWriteResPair<WriteFTestY, [SKXPort0], 2, [1], 1, 7>;
311 defm : SKXWriteResPair<WriteFTestZ, [SKXPort0], 2, [1], 1, 7>;
312 defm : SKXWriteResPair<WriteFShuffle, [SKXPort5], 1, [1], 1, 6>; // Floating point vector shuffles.
313 defm : SKXWriteResPair<WriteFShuffleY, [SKXPort5], 1, [1], 1, 7>;
314 defm : SKXWriteResPair<WriteFShuffleZ, [SKXPort5], 1, [1], 1, 7>;
315 defm : SKXWriteResPair<WriteFVarShuffle, [SKXPort5], 1, [1], 1, 6>; // Floating point vector variable shuffles.
316 defm : SKXWriteResPair<WriteFVarShuffleY, [SKXPort5], 1, [1], 1, 7>;
317 defm : SKXWriteResPair<WriteFVarShuffleZ, [SKXPort5], 1, [1], 1, 7>;
318 defm : SKXWriteResPair<WriteFBlend, [SKXPort015], 1, [1], 1, 6>; // Floating point vector blends.
319 defm : SKXWriteResPair<WriteFBlendY,[SKXPort015], 1, [1], 1, 7>;
320 defm : SKXWriteResPair<WriteFBlendZ,[SKXPort015], 1, [1], 1, 7>;
321 defm : SKXWriteResPair<WriteFVarBlend, [SKXPort015], 2, [2], 2, 6>; // Fp vector variable blends.
322 defm : SKXWriteResPair<WriteFVarBlendY,[SKXPort015], 2, [2], 2, 7>;
323 defm : SKXWriteResPair<WriteFVarBlendZ,[SKXPort015], 2, [2], 2, 7>;
325 // FMA Scheduling helper class.
326 // class FMASC { X86FoldableSchedWrite Sched = WriteFAdd; }
328 // Vector integer operations.
329 defm : X86WriteRes<WriteVecLoad, [SKXPort23], 5, [1], 1>;
330 defm : X86WriteRes<WriteVecLoadX, [SKXPort23], 6, [1], 1>;
331 defm : X86WriteRes<WriteVecLoadY, [SKXPort23], 7, [1], 1>;
332 defm : X86WriteRes<WriteVecLoadNT, [SKXPort23], 6, [1], 1>;
333 defm : X86WriteRes<WriteVecLoadNTY, [SKXPort23], 7, [1], 1>;
334 defm : X86WriteRes<WriteVecMaskedLoad, [SKXPort23,SKXPort015], 7, [1,1], 2>;
335 defm : X86WriteRes<WriteVecMaskedLoadY, [SKXPort23,SKXPort015], 8, [1,1], 2>;
336 defm : X86WriteRes<WriteVecStore, [SKXPort237,SKXPort4], 1, [1,1], 2>;
337 defm : X86WriteRes<WriteVecStoreX, [SKXPort237,SKXPort4], 1, [1,1], 2>;
338 defm : X86WriteRes<WriteVecStoreY, [SKXPort237,SKXPort4], 1, [1,1], 2>;
339 defm : X86WriteRes<WriteVecStoreNT, [SKXPort237,SKXPort4], 1, [1,1], 2>;
340 defm : X86WriteRes<WriteVecStoreNTY, [SKXPort237,SKXPort4], 1, [1,1], 2>;
341 defm : X86WriteRes<WriteVecMaskedStore, [SKXPort237,SKXPort0], 2, [1,1], 2>;
342 defm : X86WriteRes<WriteVecMaskedStoreY, [SKXPort237,SKXPort0], 2, [1,1], 2>;
343 defm : X86WriteRes<WriteVecMove, [SKXPort05], 1, [1], 1>;
344 defm : X86WriteRes<WriteVecMoveX, [SKXPort015], 1, [1], 1>;
345 defm : X86WriteRes<WriteVecMoveY, [SKXPort015], 1, [1], 1>;
346 defm : X86WriteRes<WriteVecMoveToGpr, [SKXPort0], 2, [1], 1>;
347 defm : X86WriteRes<WriteVecMoveFromGpr, [SKXPort5], 1, [1], 1>;
349 defm : SKXWriteResPair<WriteVecALU, [SKXPort05], 1, [1], 1, 5>; // Vector integer ALU op, no logicals.
350 defm : SKXWriteResPair<WriteVecALUX, [SKXPort01], 1, [1], 1, 6>;
351 defm : SKXWriteResPair<WriteVecALUY, [SKXPort01], 1, [1], 1, 7>;
352 defm : SKXWriteResPair<WriteVecALUZ, [SKXPort0], 1, [1], 1, 7>;
353 defm : SKXWriteResPair<WriteVecLogic, [SKXPort05], 1, [1], 1, 5>; // Vector integer and/or/xor.
354 defm : SKXWriteResPair<WriteVecLogicX,[SKXPort015], 1, [1], 1, 6>;
355 defm : SKXWriteResPair<WriteVecLogicY,[SKXPort015], 1, [1], 1, 7>;
356 defm : SKXWriteResPair<WriteVecLogicZ,[SKXPort05], 1, [1], 1, 7>;
357 defm : SKXWriteResPair<WriteVecTest, [SKXPort0,SKXPort5], 3, [1,1], 2, 6>; // Vector integer TEST instructions.
358 defm : SKXWriteResPair<WriteVecTestY, [SKXPort0,SKXPort5], 3, [1,1], 2, 7>;
359 defm : SKXWriteResPair<WriteVecTestZ, [SKXPort0,SKXPort5], 3, [1,1], 2, 7>;
360 defm : SKXWriteResPair<WriteVecIMul, [SKXPort0], 4, [1], 1, 5>; // Vector integer multiply.
361 defm : SKXWriteResPair<WriteVecIMulX, [SKXPort01], 4, [1], 1, 6>;
362 defm : SKXWriteResPair<WriteVecIMulY, [SKXPort01], 4, [1], 1, 7>;
363 defm : SKXWriteResPair<WriteVecIMulZ, [SKXPort05], 4, [1], 1, 7>;
364 defm : SKXWriteResPair<WritePMULLD, [SKXPort01], 10, [2], 2, 6>; // Vector PMULLD.
365 defm : SKXWriteResPair<WritePMULLDY, [SKXPort01], 10, [2], 2, 7>;
366 defm : SKXWriteResPair<WritePMULLDZ, [SKXPort05], 10, [2], 2, 7>;
367 defm : SKXWriteResPair<WriteShuffle, [SKXPort5], 1, [1], 1, 5>; // Vector shuffles.
368 defm : SKXWriteResPair<WriteShuffleX, [SKXPort5], 1, [1], 1, 6>;
369 defm : SKXWriteResPair<WriteShuffleY, [SKXPort5], 1, [1], 1, 7>;
370 defm : SKXWriteResPair<WriteShuffleZ, [SKXPort5], 1, [1], 1, 7>;
371 defm : SKXWriteResPair<WriteVarShuffle, [SKXPort5], 1, [1], 1, 5>; // Vector variable shuffles.
372 defm : SKXWriteResPair<WriteVarShuffleX, [SKXPort5], 1, [1], 1, 6>;
373 defm : SKXWriteResPair<WriteVarShuffleY, [SKXPort5], 1, [1], 1, 7>;
374 defm : SKXWriteResPair<WriteVarShuffleZ, [SKXPort5], 1, [1], 1, 7>;
375 defm : SKXWriteResPair<WriteBlend, [SKXPort5], 1, [1], 1, 6>; // Vector blends.
376 defm : SKXWriteResPair<WriteBlendY,[SKXPort5], 1, [1], 1, 7>;
377 defm : SKXWriteResPair<WriteBlendZ,[SKXPort5], 1, [1], 1, 7>;
378 defm : SKXWriteResPair<WriteVarBlend, [SKXPort015], 2, [2], 2, 6>; // Vector variable blends.
379 defm : SKXWriteResPair<WriteVarBlendY,[SKXPort015], 2, [2], 2, 6>;
380 defm : SKXWriteResPair<WriteVarBlendZ,[SKXPort05], 2, [1], 1, 6>;
381 defm : SKXWriteResPair<WriteMPSAD, [SKXPort5], 4, [2], 2, 6>; // Vector MPSAD.
382 defm : SKXWriteResPair<WriteMPSADY, [SKXPort5], 4, [2], 2, 7>;
383 defm : SKXWriteResPair<WriteMPSADZ, [SKXPort5], 4, [2], 2, 7>;
384 defm : SKXWriteResPair<WritePSADBW, [SKXPort5], 3, [1], 1, 5>; // Vector PSADBW.
385 defm : SKXWriteResPair<WritePSADBWX, [SKXPort5], 3, [1], 1, 6>;
386 defm : SKXWriteResPair<WritePSADBWY, [SKXPort5], 3, [1], 1, 7>;
387 defm : SKXWriteResPair<WritePSADBWZ, [SKXPort5], 3, [1], 1, 7>;
388 defm : SKXWriteResPair<WritePHMINPOS, [SKXPort0], 4, [1], 1, 6>; // Vector PHMINPOS.
390 // Vector integer shifts.
391 defm : SKXWriteResPair<WriteVecShift, [SKXPort0], 1, [1], 1, 5>;
392 defm : X86WriteRes<WriteVecShiftX, [SKXPort5,SKXPort01], 2, [1,1], 2>;
393 defm : X86WriteRes<WriteVecShiftY, [SKXPort5,SKXPort01], 4, [1,1], 2>;
394 defm : X86WriteRes<WriteVecShiftZ, [SKXPort5,SKXPort0], 4, [1,1], 2>;
395 defm : X86WriteRes<WriteVecShiftXLd, [SKXPort01,SKXPort23], 7, [1,1], 2>;
396 defm : X86WriteRes<WriteVecShiftYLd, [SKXPort01,SKXPort23], 8, [1,1], 2>;
397 defm : X86WriteRes<WriteVecShiftZLd, [SKXPort0,SKXPort23], 8, [1,1], 2>;
399 defm : SKXWriteResPair<WriteVecShiftImm, [SKXPort0], 1, [1], 1, 5>;
400 defm : SKXWriteResPair<WriteVecShiftImmX, [SKXPort01], 1, [1], 1, 6>; // Vector integer immediate shifts.
401 defm : SKXWriteResPair<WriteVecShiftImmY, [SKXPort01], 1, [1], 1, 7>;
402 defm : SKXWriteResPair<WriteVecShiftImmZ, [SKXPort0], 1, [1], 1, 7>;
403 defm : SKXWriteResPair<WriteVarVecShift, [SKXPort01], 1, [1], 1, 6>; // Variable vector shifts.
404 defm : SKXWriteResPair<WriteVarVecShiftY, [SKXPort01], 1, [1], 1, 7>;
405 defm : SKXWriteResPair<WriteVarVecShiftZ, [SKXPort0], 1, [1], 1, 7>;
407 // Vector insert/extract operations.
408 def : WriteRes<WriteVecInsert, [SKXPort5]> {
411 let ResourceCycles = [2];
413 def : WriteRes<WriteVecInsertLd, [SKXPort5,SKXPort23]> {
417 def: InstRW<[WriteVecInsertLd], (instregex "(V?)MOV(H|L)(PD|PS)rm")>;
419 def : WriteRes<WriteVecExtract, [SKXPort0,SKXPort5]> {
423 def : WriteRes<WriteVecExtractSt, [SKXPort4,SKXPort5,SKXPort237]> {
428 // Conversion between integer and float.
429 defm : SKXWriteResPair<WriteCvtSS2I, [SKXPort01], 6, [2], 2>; // Needs more work: DD vs DQ.
430 defm : SKXWriteResPair<WriteCvtPS2I, [SKXPort01], 3>;
431 defm : SKXWriteResPair<WriteCvtPS2IY, [SKXPort01], 3>;
432 defm : SKXWriteResPair<WriteCvtPS2IZ, [SKXPort05], 3>;
433 defm : SKXWriteResPair<WriteCvtSD2I, [SKXPort01], 6, [2], 2>;
434 defm : SKXWriteResPair<WriteCvtPD2I, [SKXPort01], 3>;
435 defm : SKXWriteResPair<WriteCvtPD2IY, [SKXPort01], 3>;
436 defm : SKXWriteResPair<WriteCvtPD2IZ, [SKXPort05], 3>;
438 defm : SKXWriteResPair<WriteCvtI2SS, [SKXPort1], 4>;
439 defm : SKXWriteResPair<WriteCvtI2PS, [SKXPort01], 4>;
440 defm : SKXWriteResPair<WriteCvtI2PSY, [SKXPort01], 4>;
441 defm : SKXWriteResPair<WriteCvtI2PSZ, [SKXPort05], 4>; // Needs more work: DD vs DQ.
442 defm : SKXWriteResPair<WriteCvtI2SD, [SKXPort1], 4>;
443 defm : SKXWriteResPair<WriteCvtI2PD, [SKXPort01], 4>;
444 defm : SKXWriteResPair<WriteCvtI2PDY, [SKXPort01], 4>;
445 defm : SKXWriteResPair<WriteCvtI2PDZ, [SKXPort05], 4>;
447 defm : SKXWriteResPair<WriteCvtSS2SD, [SKXPort1], 3>;
448 defm : SKXWriteResPair<WriteCvtPS2PD, [SKXPort1], 3>;
449 defm : SKXWriteResPair<WriteCvtPS2PDY, [SKXPort5,SKXPort01], 3, [1,1], 2>;
450 defm : SKXWriteResPair<WriteCvtPS2PDZ, [SKXPort05], 3, [2], 2>;
451 defm : SKXWriteResPair<WriteCvtSD2SS, [SKXPort1], 3>;
452 defm : SKXWriteResPair<WriteCvtPD2PS, [SKXPort1], 3>;
453 defm : SKXWriteResPair<WriteCvtPD2PSY, [SKXPort5,SKXPort01], 3, [1,1], 2>;
454 defm : SKXWriteResPair<WriteCvtPD2PSZ, [SKXPort05], 3, [2], 2>;
456 defm : X86WriteRes<WriteCvtPH2PS, [SKXPort5,SKXPort01], 5, [1,1], 2>;
457 defm : X86WriteRes<WriteCvtPH2PSY, [SKXPort5,SKXPort01], 7, [1,1], 2>;
458 defm : X86WriteRes<WriteCvtPH2PSZ, [SKXPort5,SKXPort0], 7, [1,1], 2>;
459 defm : X86WriteRes<WriteCvtPH2PSLd, [SKXPort23,SKXPort01], 9, [1,1], 2>;
460 defm : X86WriteRes<WriteCvtPH2PSYLd, [SKXPort23,SKXPort01], 10, [1,1], 2>;
461 defm : X86WriteRes<WriteCvtPH2PSZLd, [SKXPort23,SKXPort05], 10, [1,1], 2>;
463 defm : X86WriteRes<WriteCvtPS2PH, [SKXPort5,SKXPort01], 5, [1,1], 2>;
464 defm : X86WriteRes<WriteCvtPS2PHY, [SKXPort5,SKXPort01], 7, [1,1], 2>;
465 defm : X86WriteRes<WriteCvtPS2PHZ, [SKXPort5,SKXPort05], 7, [1,1], 2>;
466 defm : X86WriteRes<WriteCvtPS2PHSt, [SKXPort4,SKXPort5,SKXPort237,SKXPort01], 6, [1,1,1,1], 4>;
467 defm : X86WriteRes<WriteCvtPS2PHYSt, [SKXPort4,SKXPort5,SKXPort237,SKXPort01], 8, [1,1,1,1], 4>;
468 defm : X86WriteRes<WriteCvtPS2PHZSt, [SKXPort4,SKXPort5,SKXPort237,SKXPort05], 8, [1,1,1,1], 4>;
470 // Strings instructions.
472 // Packed Compare Implicit Length Strings, Return Mask
473 def : WriteRes<WritePCmpIStrM, [SKXPort0]> {
476 let ResourceCycles = [3];
478 def : WriteRes<WritePCmpIStrMLd, [SKXPort0, SKXPort23]> {
481 let ResourceCycles = [3,1];
484 // Packed Compare Explicit Length Strings, Return Mask
485 def : WriteRes<WritePCmpEStrM, [SKXPort0, SKXPort5, SKXPort015, SKXPort0156]> {
488 let ResourceCycles = [4,3,1,1];
490 def : WriteRes<WritePCmpEStrMLd, [SKXPort0, SKXPort5, SKXPort23, SKXPort015, SKXPort0156]> {
492 let NumMicroOps = 10;
493 let ResourceCycles = [4,3,1,1,1];
496 // Packed Compare Implicit Length Strings, Return Index
497 def : WriteRes<WritePCmpIStrI, [SKXPort0]> {
500 let ResourceCycles = [3];
502 def : WriteRes<WritePCmpIStrILd, [SKXPort0, SKXPort23]> {
505 let ResourceCycles = [3,1];
508 // Packed Compare Explicit Length Strings, Return Index
509 def : WriteRes<WritePCmpEStrI, [SKXPort0,SKXPort5,SKXPort0156]> {
512 let ResourceCycles = [4,3,1];
514 def : WriteRes<WritePCmpEStrILd, [SKXPort0, SKXPort5, SKXPort23, SKXPort0156]> {
517 let ResourceCycles = [4,3,1,1];
520 // MOVMSK Instructions.
521 def : WriteRes<WriteFMOVMSK, [SKXPort0]> { let Latency = 2; }
522 def : WriteRes<WriteVecMOVMSK, [SKXPort0]> { let Latency = 2; }
523 def : WriteRes<WriteVecMOVMSKY, [SKXPort0]> { let Latency = 2; }
524 def : WriteRes<WriteMMXMOVMSK, [SKXPort0]> { let Latency = 2; }
527 def : WriteRes<WriteAESDecEnc, [SKXPort0]> { // Decryption, encryption.
530 let ResourceCycles = [1];
532 def : WriteRes<WriteAESDecEncLd, [SKXPort0, SKXPort23]> {
535 let ResourceCycles = [1,1];
538 def : WriteRes<WriteAESIMC, [SKXPort0]> { // InvMixColumn.
541 let ResourceCycles = [2];
543 def : WriteRes<WriteAESIMCLd, [SKXPort0, SKXPort23]> {
546 let ResourceCycles = [2,1];
549 def : WriteRes<WriteAESKeyGen, [SKXPort0,SKXPort5,SKXPort015]> { // Key Generation.
551 let NumMicroOps = 11;
552 let ResourceCycles = [3,6,2];
554 def : WriteRes<WriteAESKeyGenLd, [SKXPort0,SKXPort5,SKXPort23,SKXPort015]> {
556 let NumMicroOps = 11;
557 let ResourceCycles = [3,6,1,1];
560 // Carry-less multiplication instructions.
561 def : WriteRes<WriteCLMul, [SKXPort5]> {
564 let ResourceCycles = [1];
566 def : WriteRes<WriteCLMulLd, [SKXPort5, SKXPort23]> {
569 let ResourceCycles = [1,1];
572 // Catch-all for expensive system instructions.
573 def : WriteRes<WriteSystem, [SKXPort0156]> { let Latency = 100; } // def WriteSystem : SchedWrite;
576 defm : SKXWriteResPair<WriteFShuffle256, [SKXPort5], 3, [1], 1, 7>; // Fp 256-bit width vector shuffles.
577 defm : SKXWriteResPair<WriteFVarShuffle256, [SKXPort5], 3, [1], 1, 7>; // Fp 256-bit width vector variable shuffles.
578 defm : SKXWriteResPair<WriteShuffle256, [SKXPort5], 3, [1], 1, 7>; // 256-bit width vector shuffles.
579 defm : SKXWriteResPair<WriteVarShuffle256, [SKXPort5], 3, [1], 1, 7>; // 256-bit width vector variable shuffles.
581 // Old microcoded instructions that nobody use.
582 def : WriteRes<WriteMicrocoded, [SKXPort0156]> { let Latency = 100; } // def WriteMicrocoded : SchedWrite;
584 // Fence instructions.
585 def : WriteRes<WriteFence, [SKXPort23, SKXPort4]>;
588 def : WriteRes<WriteLDMXCSR, [SKXPort0,SKXPort23,SKXPort0156]> { let Latency = 7; let NumMicroOps = 3; let ResourceCycles = [1,1,1]; }
589 def : WriteRes<WriteSTMXCSR, [SKXPort4,SKXPort5,SKXPort237]> { let Latency = 2; let NumMicroOps = 3; let ResourceCycles = [1,1,1]; }
591 // Nop, not very useful expect it provides a model for nops!
592 def : WriteRes<WriteNop, []>;
594 ////////////////////////////////////////////////////////////////////////////////
595 // Horizontal add/sub instructions.
596 ////////////////////////////////////////////////////////////////////////////////
598 defm : SKXWriteResPair<WriteFHAdd, [SKXPort5,SKXPort015], 6, [2,1], 3, 6>;
599 defm : SKXWriteResPair<WriteFHAddY, [SKXPort5,SKXPort015], 6, [2,1], 3, 7>;
600 defm : SKXWriteResPair<WritePHAdd, [SKXPort5,SKXPort05], 3, [2,1], 3, 5>;
601 defm : SKXWriteResPair<WritePHAddX, [SKXPort5,SKXPort015], 3, [2,1], 3, 6>;
602 defm : SKXWriteResPair<WritePHAddY, [SKXPort5,SKXPort015], 3, [2,1], 3, 7>;
606 def SKXWriteResGroup1 : SchedWriteRes<[SKXPort0]> {
609 let ResourceCycles = [1];
611 def: InstRW<[SKXWriteResGroup1], (instregex "KAND(B|D|Q|W)rr",
619 "MMX_PADDUS(B|W)irr",
621 "MMX_PCMPEQ(B|D|W)irr",
622 "MMX_PCMPGT(B|D|W)irr",
623 "MMX_P(MAX|MIN)SWirr",
624 "MMX_P(MAX|MIN)UBirr",
626 "MMX_PSUBUS(B|W)irr",
627 "VPMOVB2M(Z|Z128|Z256)rr",
628 "VPMOVD2M(Z|Z128|Z256)rr",
629 "VPMOVQ2M(Z|Z128|Z256)rr",
630 "VPMOVW2M(Z|Z128|Z256)rr")>;
632 def SKXWriteResGroup3 : SchedWriteRes<[SKXPort5]> {
635 let ResourceCycles = [1];
637 def: InstRW<[SKXWriteResGroup3], (instregex "COM(P?)_FST0r",
641 def SKXWriteResGroup4 : SchedWriteRes<[SKXPort6]> {
644 let ResourceCycles = [1];
646 def: InstRW<[SKXWriteResGroup4], (instregex "JMP(16|32|64)r")>;
648 def SKXWriteResGroup6 : SchedWriteRes<[SKXPort05]> {
651 let ResourceCycles = [1];
653 def: InstRW<[SKXWriteResGroup6], (instrs FINCSTP, FNOP)>;
655 def SKXWriteResGroup7 : SchedWriteRes<[SKXPort06]> {
658 let ResourceCycles = [1];
660 def: InstRW<[SKXWriteResGroup7], (instrs CDQ, CQO, CLAC, STAC)>;
662 def SKXWriteResGroup8 : SchedWriteRes<[SKXPort15]> {
665 let ResourceCycles = [1];
667 def: InstRW<[SKXWriteResGroup8], (instregex "ANDN(32|64)rr")>;
669 def SKXWriteResGroup9 : SchedWriteRes<[SKXPort015]> {
672 let ResourceCycles = [1];
674 def: InstRW<[SKXWriteResGroup9], (instregex "VBLENDMPD(Z128|Z256)rr",
675 "VBLENDMPS(Z128|Z256)rr",
676 "VPADD(B|D|Q|W)(Y|Z|Z128|Z256)rr",
677 "(V?)PADD(B|D|Q|W)rr",
679 "VPBLENDMB(Z128|Z256)rr",
680 "VPBLENDMD(Z128|Z256)rr",
681 "VPBLENDMQ(Z128|Z256)rr",
682 "VPBLENDMW(Z128|Z256)rr",
683 "VPSUB(B|D|Q|W)(Y|Z|Z128|Z256)rrk",
684 "VPTERNLOGD(Z|Z128|Z256)rri",
685 "VPTERNLOGQ(Z|Z128|Z256)rri")>;
687 def SKXWriteResGroup10 : SchedWriteRes<[SKXPort0156]> {
690 let ResourceCycles = [1];
692 def: InstRW<[SKXWriteResGroup10], (instrs CBW, CWDE, CDQE,
700 def SKXWriteResGroup11 : SchedWriteRes<[SKXPort4,SKXPort237]> {
703 let ResourceCycles = [1,1];
705 def: InstRW<[SKXWriteResGroup11], (instrs FBSTPm, VMPTRSTm)>;
706 def: InstRW<[SKXWriteResGroup11], (instregex "KMOV(B|D|Q|W)mk",
707 "ST_FP(32|64|80)m")>;
709 def SKXWriteResGroup13 : SchedWriteRes<[SKXPort5]> {
712 let ResourceCycles = [2];
714 def: InstRW<[SKXWriteResGroup13], (instrs MMX_MOVQ2DQrr)>;
716 def SKXWriteResGroup14 : SchedWriteRes<[SKXPort05]> {
719 let ResourceCycles = [2];
721 def: InstRW<[SKXWriteResGroup14], (instrs FDECSTP,
724 def SKXWriteResGroup17 : SchedWriteRes<[SKXPort0156]> {
727 let ResourceCycles = [2];
729 def: InstRW<[SKXWriteResGroup17], (instrs LFENCE,
733 def SKXWriteResGroup20 : SchedWriteRes<[SKXPort6,SKXPort0156]> {
736 let ResourceCycles = [1,1];
738 def: InstRW<[SKXWriteResGroup20], (instregex "CLFLUSH")>;
740 def SKXWriteResGroup21 : SchedWriteRes<[SKXPort237,SKXPort0156]> {
743 let ResourceCycles = [1,1];
745 def: InstRW<[SKXWriteResGroup21], (instrs SFENCE)>;
747 def SKXWriteResGroup23 : SchedWriteRes<[SKXPort06,SKXPort0156]> {
750 let ResourceCycles = [1,1];
752 def: InstRW<[SKXWriteResGroup23], (instrs CWD,
757 ADC64i32, SBB64i32)>;
759 def SKXWriteResGroup25 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort237]> {
762 let ResourceCycles = [1,1,1];
764 def: InstRW<[SKXWriteResGroup25], (instrs FNSTCW16m)>;
766 def SKXWriteResGroup27 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort15]> {
769 let ResourceCycles = [1,1,1];
771 def: InstRW<[SKXWriteResGroup27], (instregex "MOVBE(16|32|64)mr")>;
773 def SKXWriteResGroup28 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort0156]> {
776 let ResourceCycles = [1,1,1];
778 def: InstRW<[SKXWriteResGroup28], (instrs PUSH16r, PUSH32r, PUSH64r, PUSH64i8,
779 STOSB, STOSL, STOSQ, STOSW)>;
780 def: InstRW<[SKXWriteResGroup28], (instregex "PUSH(16|32|64)rmr")>;
782 def SKXWriteResGroup29 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort15]> {
785 let ResourceCycles = [2,2,1];
787 def: InstRW<[SKXWriteResGroup29], (instregex "VMOVDQU8Zmr(b?)")>;
789 def SKXWriteResGroup30 : SchedWriteRes<[SKXPort0]> {
792 let ResourceCycles = [1];
794 def: InstRW<[SKXWriteResGroup30], (instregex "KMOV(B|D|Q|W)rk",
795 "KORTEST(B|D|Q|W)rr",
796 "KTEST(B|D|Q|W)rr")>;
798 def SKXWriteResGroup31 : SchedWriteRes<[SKXPort1]> {
801 let ResourceCycles = [1];
803 def: InstRW<[SKXWriteResGroup31], (instregex "PDEP(32|64)rr",
806 def SKXWriteResGroup32 : SchedWriteRes<[SKXPort5]> {
809 let ResourceCycles = [1];
811 def: InstRW<[SKXWriteResGroup32], (instrs VPSADBWZrr)>; // TODO: 512-bit ops require ports 0/1 to be joined.
812 def: InstRW<[SKXWriteResGroup32], (instregex "(ADD|SUB|SUBR)_(FPrST0|FST0r|FrST0)",
814 "KSHIFTL(B|D|Q|W)ri",
815 "KSHIFTR(B|D|Q|W)ri",
816 "KUNPCK(BW|DQ|WD)rr",
817 "VALIGND(Z|Z128|Z256)rri",
818 "VALIGNQ(Z|Z128|Z256)rri",
819 "VCMPPD(Z|Z128|Z256)rri",
820 "VCMPPS(Z|Z128|Z256)rri",
822 "VDBPSADBWZrri", // TODO: 512-bit ops require ports 0/1 to be joined.
823 "VFPCLASS(PD|PS)(Z|Z128|Z256)rr",
824 "VFPCLASS(SD|SS)Zrr",
825 "VPBROADCAST(B|W)rr",
826 "VPCMPB(Z|Z128|Z256)rri",
827 "VPCMPD(Z|Z128|Z256)rri",
828 "VPCMPEQ(B|D|Q|W)(Z|Z128|Z256)rr",
829 "VPCMPGT(B|D|Q|W)(Z|Z128|Z256)rr",
830 "VPCMPQ(Z|Z128|Z256)rri",
831 "VPCMPU(B|D|Q|W)(Z|Z128|Z256)rri",
832 "VPCMPW(Z|Z128|Z256)rri",
833 "VP(MAX|MIN)(S|U)Q(Z|Z128|Z256)rr",
834 "VPTEST(N?)M(B|D|Q|W)(Z|Z128|Z256)rr")>;
836 def SKXWriteResGroup34 : SchedWriteRes<[SKXPort0,SKXPort0156]> {
839 let ResourceCycles = [1,1];
841 def: InstRW<[SKXWriteResGroup34], (instrs FNSTSW16r)>;
843 def SKXWriteResGroup37 : SchedWriteRes<[SKXPort0,SKXPort5]> {
846 let ResourceCycles = [1,2];
848 def: InstRW<[SKXWriteResGroup37], (instregex "MMX_PH(ADD|SUB)SWrr")>;
850 def SKXWriteResGroup38 : SchedWriteRes<[SKXPort5,SKXPort01]> {
853 let ResourceCycles = [2,1];
855 def: InstRW<[SKXWriteResGroup38], (instregex "(V?)PH(ADD|SUB)SW(Y?)rr")>;
857 def SKXWriteResGroup41 : SchedWriteRes<[SKXPort5,SKXPort0156]> {
860 let ResourceCycles = [2,1];
862 def: InstRW<[SKXWriteResGroup41], (instrs MMX_PACKSSDWirr,
866 def SKXWriteResGroup42 : SchedWriteRes<[SKXPort6,SKXPort0156]> {
869 let ResourceCycles = [1,2];
871 def: InstRW<[SKXWriteResGroup42], (instregex "CLD")>;
873 def SKXWriteResGroup43 : SchedWriteRes<[SKXPort237,SKXPort0156]> {
876 let ResourceCycles = [1,2];
878 def: InstRW<[SKXWriteResGroup43], (instrs MFENCE)>;
880 def SKXWriteResGroup44 : SchedWriteRes<[SKXPort06,SKXPort0156]> {
883 let ResourceCycles = [1,2];
885 def: InstRW<[SKXWriteResGroup44], (instregex "RCL(8|16|32|64)r(1|i)",
886 "RCR(8|16|32|64)r(1|i)")>;
888 def SKXWriteResGroup45 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort237]> {
891 let ResourceCycles = [1,1,1];
893 def: InstRW<[SKXWriteResGroup45], (instrs FNSTSWm)>;
895 def SKXWriteResGroup47 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort237,SKXPort0156]> {
898 let ResourceCycles = [1,1,1,1];
900 def: InstRW<[SKXWriteResGroup47], (instregex "CALL(16|32|64)r")>;
902 def SKXWriteResGroup48 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort06,SKXPort0156]> {
905 let ResourceCycles = [1,1,1,1];
907 def: InstRW<[SKXWriteResGroup48], (instrs CALL64pcrel32)>;
909 def SKXWriteResGroup49 : SchedWriteRes<[SKXPort0]> {
912 let ResourceCycles = [1];
914 def: InstRW<[SKXWriteResGroup49], (instregex "MUL_(FPrST0|FST0r|FrST0)")>;
916 def SKXWriteResGroup50 : SchedWriteRes<[SKXPort01]> {
919 let ResourceCycles = [1];
921 def: InstRW<[SKXWriteResGroup50], (instregex "VCVTDQ2PS(Y|Z128|Z256)rr",
923 "VCVTPD2QQ(Z128|Z256)rr",
924 "VCVTPD2UQQ(Z128|Z256)rr",
925 "VCVTPS2DQ(Y|Z128|Z256)rr",
927 "VCVTPS2UDQ(Z128|Z256)rr",
928 "VCVTQQ2PD(Z128|Z256)rr",
929 "VCVTTPD2QQ(Z128|Z256)rr",
930 "VCVTTPD2UQQ(Z128|Z256)rr",
931 "VCVTTPS2DQ(Z128|Z256)rr",
933 "VCVTTPS2UDQ(Z128|Z256)rr",
934 "VCVTUDQ2PS(Z128|Z256)rr",
935 "VCVTUQQ2PD(Z128|Z256)rr")>;
937 def SKXWriteResGroup50z : SchedWriteRes<[SKXPort05]> {
940 let ResourceCycles = [1];
942 def: InstRW<[SKXWriteResGroup50z], (instrs VCVTDQ2PSZrr,
955 def SKXWriteResGroup51 : SchedWriteRes<[SKXPort5]> {
958 let ResourceCycles = [2];
960 def: InstRW<[SKXWriteResGroup51], (instregex "VEXPANDPD(Z|Z128|Z256)rr",
961 "VEXPANDPS(Z|Z128|Z256)rr",
962 "VPEXPANDD(Z|Z128|Z256)rr",
963 "VPEXPANDQ(Z|Z128|Z256)rr",
964 "VPMOVDB(Z|Z128|Z256)rr",
965 "VPMOVDW(Z|Z128|Z256)rr",
966 "VPMOVQB(Z|Z128|Z256)rr",
967 "VPMOVQW(Z|Z128|Z256)rr",
968 "VPMOVSDB(Z|Z128|Z256)rr",
969 "VPMOVSDW(Z|Z128|Z256)rr",
970 "VPMOVSQB(Z|Z128|Z256)rr",
971 "VPMOVSQD(Z|Z128|Z256)rr",
972 "VPMOVSQW(Z|Z128|Z256)rr",
973 "VPMOVSWB(Z|Z128|Z256)rr",
974 "VPMOVUSDB(Z|Z128|Z256)rr",
975 "VPMOVUSDW(Z|Z128|Z256)rr",
976 "VPMOVUSQB(Z|Z128|Z256)rr",
977 "VPMOVUSQD(Z|Z128|Z256)rr",
978 "VPMOVUSWB(Z|Z128|Z256)rr",
979 "VPMOVWB(Z|Z128|Z256)rr")>;
981 def SKXWriteResGroup54 : SchedWriteRes<[SKXPort4,SKXPort5,SKXPort237]> {
984 let ResourceCycles = [1,1,1];
986 def: InstRW<[SKXWriteResGroup54], (instregex "IST(T?)_FP(16|32|64)m",
988 "VPMOVQD(Z|Z128|Z256)mr(b?)")>;
990 def SKXWriteResGroup55 : SchedWriteRes<[SKXPort0156]> {
993 let ResourceCycles = [4];
995 def: InstRW<[SKXWriteResGroup55], (instrs FNCLEX)>;
997 def SKXWriteResGroup56 : SchedWriteRes<[]> {
1000 let ResourceCycles = [];
1002 def: InstRW<[SKXWriteResGroup56], (instrs VZEROUPPER)>;
1004 def SKXWriteResGroup57 : SchedWriteRes<[SKXPort1,SKXPort6,SKXPort0156]> {
1006 let NumMicroOps = 4;
1007 let ResourceCycles = [1,1,2];
1009 def: InstRW<[SKXWriteResGroup57], (instregex "LAR(16|32|64)rr")>;
1011 def SKXWriteResGroup58 : SchedWriteRes<[SKXPort23]> {
1013 let NumMicroOps = 1;
1014 let ResourceCycles = [1];
1016 def: InstRW<[SKXWriteResGroup58], (instregex "MOVSX(16|32|64)rm(8|16|32)",
1017 "MOVZX(16|32|64)rm(8|16)",
1018 "(V?)MOVDDUPrm")>; // TODO: Should this be SKXWriteResGroup71?
1020 def SKXWriteResGroup61 : SchedWriteRes<[SKXPort5,SKXPort015]> {
1022 let NumMicroOps = 2;
1023 let ResourceCycles = [1,1];
1025 def: InstRW<[SKXWriteResGroup61], (instregex "MMX_CVT(T?)PD2PIirr",
1026 "MMX_CVT(T?)PS2PIirr",
1029 "(V?)CVT(T?)PD2DQrr",
1038 "(V?)CVTSD2SS(Z?)rr",
1039 "(V?)CVTSI(64)?2SDrr",
1042 "VCVTSI(64)?2SDZrr",
1046 "VCVTTPD2UDQZ128rr",
1048 "VCVTTPS2UQQZ128rr",
1052 "VCVTUSI(64)?2SDZrr")>;
1054 def SKXWriteResGroup62 : SchedWriteRes<[SKXPort5,SKXPort015]> {
1056 let NumMicroOps = 3;
1057 let ResourceCycles = [2,1];
1059 def: InstRW<[SKXWriteResGroup62], (instregex "VPCONFLICTQZ128rr")>;
1061 def SKXWriteResGroup63 : SchedWriteRes<[SKXPort1,SKXPort6,SKXPort06]> {
1063 let NumMicroOps = 3;
1064 let ResourceCycles = [1,1,1];
1066 def: InstRW<[SKXWriteResGroup63], (instregex "STR(16|32|64)r")>;
1068 def SKXWriteResGroup65 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort015]> {
1070 let NumMicroOps = 3;
1071 let ResourceCycles = [1,1,1];
1073 def: InstRW<[SKXWriteResGroup65], (instregex "VCVTPS2PHZ128mr(b?)",
1074 "VCVTPS2PHZ256mr(b?)",
1075 "VCVTPS2PHZmr(b?)")>;
1077 def SKXWriteResGroup66 : SchedWriteRes<[SKXPort4,SKXPort5,SKXPort237]> {
1079 let NumMicroOps = 4;
1080 let ResourceCycles = [1,2,1];
1082 def: InstRW<[SKXWriteResGroup66], (instregex "VPMOVDB(Z|Z128|Z256)mr(b?)",
1083 "VPMOVDW(Z|Z128|Z256)mr(b?)",
1084 "VPMOVQB(Z|Z128|Z256)mr(b?)",
1085 "VPMOVQW(Z|Z128|Z256)mr(b?)",
1086 "VPMOVSDB(Z|Z128|Z256)mr(b?)",
1087 "VPMOVSDW(Z|Z128|Z256)mr(b?)",
1088 "VPMOVSQB(Z|Z128|Z256)mr(b?)",
1089 "VPMOVSQD(Z|Z128|Z256)mr(b?)",
1090 "VPMOVSQW(Z|Z128|Z256)mr(b?)",
1091 "VPMOVSWB(Z|Z128|Z256)mr(b?)",
1092 "VPMOVUSDB(Z|Z128|Z256)mr(b?)",
1093 "VPMOVUSDW(Z|Z128|Z256)mr(b?)",
1094 "VPMOVUSQB(Z|Z128|Z256)mr(b?)",
1095 "VPMOVUSQD(Z|Z128|Z256)mr(b?)",
1096 "VPMOVUSQW(Z|Z128|Z256)mr(b?)",
1097 "VPMOVUSWB(Z|Z128|Z256)mr(b?)",
1098 "VPMOVWB(Z|Z128|Z256)mr(b?)")>;
1100 def SKXWriteResGroup67 : SchedWriteRes<[SKXPort06,SKXPort0156]> {
1102 let NumMicroOps = 5;
1103 let ResourceCycles = [1,4];
1105 def: InstRW<[SKXWriteResGroup67], (instrs XSETBV)>;
1107 def SKXWriteResGroup69 : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort0156]> {
1109 let NumMicroOps = 6;
1110 let ResourceCycles = [1,1,4];
1112 def: InstRW<[SKXWriteResGroup69], (instregex "PUSHF(16|64)")>;
1114 def SKXWriteResGroup71 : SchedWriteRes<[SKXPort23]> {
1116 let NumMicroOps = 1;
1117 let ResourceCycles = [1];
1119 def: InstRW<[SKXWriteResGroup71], (instrs VBROADCASTSSrm,
1127 def SKXWriteResGroup72 : SchedWriteRes<[SKXPort5]> {
1129 let NumMicroOps = 2;
1130 let ResourceCycles = [2];
1132 def: InstRW<[SKXWriteResGroup72], (instrs MMX_CVTPI2PSirr)>;
1133 def: InstRW<[SKXWriteResGroup72], (instregex "VCOMPRESSPD(Z|Z128|Z256)rr",
1134 "VCOMPRESSPS(Z|Z128|Z256)rr",
1135 "VPCOMPRESSD(Z|Z128|Z256)rr",
1136 "VPCOMPRESSQ(Z|Z128|Z256)rr",
1137 "VPERMW(Z|Z128|Z256)rr")>;
1139 def SKXWriteResGroup73 : SchedWriteRes<[SKXPort0,SKXPort23]> {
1141 let NumMicroOps = 2;
1142 let ResourceCycles = [1,1];
1144 def: InstRW<[SKXWriteResGroup73], (instrs MMX_PADDSBirm,
1165 def SKXWriteResGroup76 : SchedWriteRes<[SKXPort6,SKXPort23]> {
1167 let NumMicroOps = 2;
1168 let ResourceCycles = [1,1];
1170 def: InstRW<[SKXWriteResGroup76], (instrs FARJMP64)>;
1171 def: InstRW<[SKXWriteResGroup76], (instregex "JMP(16|32|64)m")>;
1173 def SKXWriteResGroup79 : SchedWriteRes<[SKXPort23,SKXPort15]> {
1175 let NumMicroOps = 2;
1176 let ResourceCycles = [1,1];
1178 def: InstRW<[SKXWriteResGroup79], (instregex "ANDN(32|64)rm",
1179 "MOVBE(16|32|64)rm")>;
1181 def SKXWriteResGroup80 : SchedWriteRes<[SKXPort23,SKXPort015]> {
1183 let NumMicroOps = 2;
1184 let ResourceCycles = [1,1];
1186 def: InstRW<[SKXWriteResGroup80], (instregex "VMOV(64to|QI2)PQIZrm(b?)")>;
1187 def: InstRW<[SKXWriteResGroup80], (instrs VMOVDI2PDIZrm)>;
1189 def SKXWriteResGroup81 : SchedWriteRes<[SKXPort23,SKXPort0156]> {
1191 let NumMicroOps = 2;
1192 let ResourceCycles = [1,1];
1194 def: InstRW<[SKXWriteResGroup81], (instrs POP16r, POP32r, POP64r)>;
1195 def: InstRW<[SKXWriteResGroup81], (instregex "POP(16|32|64)rmr")>;
1197 def SKXWriteResGroup82 : SchedWriteRes<[SKXPort5,SKXPort015]> {
1199 let NumMicroOps = 3;
1200 let ResourceCycles = [2,1];
1202 def: InstRW<[SKXWriteResGroup82], (instregex "(V?)CVTSI642SSrr",
1204 "VCVTUSI642SSZrr")>;
1206 def SKXWriteResGroup84 : SchedWriteRes<[SKXPort1,SKXPort6,SKXPort06,SKXPort0156]> {
1208 let NumMicroOps = 4;
1209 let ResourceCycles = [1,1,1,1];
1211 def: InstRW<[SKXWriteResGroup84], (instregex "SLDT(16|32|64)r")>;
1213 def SKXWriteResGroup86 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort06]> {
1215 let NumMicroOps = 4;
1216 let ResourceCycles = [1,1,1,1];
1218 def: InstRW<[SKXWriteResGroup86], (instregex "SAR(8|16|32|64)m(1|i)",
1219 "SHL(8|16|32|64)m(1|i)",
1220 "SHR(8|16|32|64)m(1|i)")>;
1222 def SKXWriteResGroup87 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort0156]> {
1224 let NumMicroOps = 4;
1225 let ResourceCycles = [1,1,1,1];
1227 def: InstRW<[SKXWriteResGroup87], (instregex "POP(16|32|64)rmm",
1228 "PUSH(16|32|64)rmm")>;
1230 def SKXWriteResGroup88 : SchedWriteRes<[SKXPort6,SKXPort0156]> {
1232 let NumMicroOps = 6;
1233 let ResourceCycles = [1,5];
1235 def: InstRW<[SKXWriteResGroup88], (instrs STD)>;
1237 def SKXWriteResGroup89 : SchedWriteRes<[SKXPort23]> {
1239 let NumMicroOps = 1;
1240 let ResourceCycles = [1];
1242 def: InstRW<[SKXWriteResGroup89], (instregex "LD_F(32|64|80)m")>;
1243 def: InstRW<[SKXWriteResGroup89], (instrs VBROADCASTF128,
1253 def SKXWriteResGroup90 : SchedWriteRes<[SKXPort01,SKXPort5]> {
1255 let NumMicroOps = 2;
1256 let ResourceCycles = [1,1];
1258 def: InstRW<[SKXWriteResGroup90], (instrs VCVTDQ2PDYrr)>;
1260 def SKXWriteResGroup92 : SchedWriteRes<[SKXPort5,SKXPort23]> {
1262 let NumMicroOps = 2;
1263 let ResourceCycles = [1,1];
1265 def: InstRW<[SKXWriteResGroup92], (instregex "VMOVSDZrm(b?)",
1268 def SKXWriteResGroup92a : SchedWriteRes<[SKXPort5,SKXPort23]> {
1270 let NumMicroOps = 2;
1271 let ResourceCycles = [1,1];
1273 def: InstRW<[SKXWriteResGroup92a], (instregex "(V?)PMOV(SX|ZX)BDrm",
1274 "(V?)PMOV(SX|ZX)BQrm",
1275 "(V?)PMOV(SX|ZX)BWrm",
1276 "(V?)PMOV(SX|ZX)DQrm",
1277 "(V?)PMOV(SX|ZX)WDrm",
1278 "(V?)PMOV(SX|ZX)WQrm")>;
1280 def SKXWriteResGroup93 : SchedWriteRes<[SKXPort5,SKXPort015]> {
1282 let NumMicroOps = 2;
1283 let ResourceCycles = [1,1];
1285 def: InstRW<[SKXWriteResGroup93], (instregex "VCVTDQ2PDZ256rr",
1286 "VCVTPD2DQ(Y|Z256)rr",
1287 "VCVTPD2PS(Y|Z256)rr",
1289 "VCVTPS2PD(Y|Z256)rr",
1293 "VCVTTPD2DQ(Y|Z256)rr",
1294 "VCVTTPD2UDQZ256rr",
1296 "VCVTTPS2UQQZ256rr",
1298 "VCVTUQQ2PSZ256rr")>;
1300 def SKXWriteResGroup93z : SchedWriteRes<[SKXPort5,SKXPort05]> {
1302 let NumMicroOps = 2;
1303 let ResourceCycles = [1,1];
1305 def: InstRW<[SKXWriteResGroup93z], (instrs VCVTDQ2PDZrr,
1320 def SKXWriteResGroup95 : SchedWriteRes<[SKXPort23,SKXPort015]> {
1322 let NumMicroOps = 2;
1323 let ResourceCycles = [1,1];
1325 def: InstRW<[SKXWriteResGroup95], (instrs VMOVNTDQAZ128rm,
1327 def: InstRW<[SKXWriteResGroup95, ReadAfterVecXLd],
1328 (instregex "VBLENDMPDZ128rm(b?)",
1329 "VBLENDMPSZ128rm(b?)",
1330 "VBROADCASTI32X2Z128m(b?)",
1331 "VBROADCASTSSZ128m(b?)",
1332 "VINSERT(F|I)128rm",
1333 "VMOVAPDZ128rm(b?)",
1334 "VMOVAPSZ128rm(b?)",
1335 "VMOVDDUPZ128rm(b?)",
1336 "VMOVDQA32Z128rm(b?)",
1337 "VMOVDQA64Z128rm(b?)",
1338 "VMOVDQU16Z128rm(b?)",
1339 "VMOVDQU32Z128rm(b?)",
1340 "VMOVDQU64Z128rm(b?)",
1341 "VMOVDQU8Z128rm(b?)",
1342 "VMOVSHDUPZ128rm(b?)",
1343 "VMOVSLDUPZ128rm(b?)",
1344 "VMOVUPDZ128rm(b?)",
1345 "VMOVUPSZ128rm(b?)",
1346 "VPADD(B|D|Q|W)Z128rm(b?)",
1347 "(V?)PADD(B|D|Q|W)rm",
1348 "VPBLENDM(B|D|Q|W)Z128rm(b?)",
1349 "VPBROADCASTDZ128m(b?)",
1350 "VPBROADCASTQZ128m(b?)",
1351 "VPSUB(B|D|Q|W)Z128rm(b?)",
1352 "(V?)PSUB(B|D|Q|W)rm",
1353 "VPTERNLOGDZ128rm(b?)i",
1354 "VPTERNLOGQZ128rm(b?)i")>;
1356 def SKXWriteResGroup96 : SchedWriteRes<[SKXPort5,SKXPort23]> {
1358 let NumMicroOps = 3;
1359 let ResourceCycles = [2,1];
1361 def: InstRW<[SKXWriteResGroup96], (instrs MMX_PACKSSDWirm,
1365 def SKXWriteResGroup97 : SchedWriteRes<[SKXPort5,SKXPort015]> {
1367 let NumMicroOps = 3;
1368 let ResourceCycles = [2,1];
1370 def: InstRW<[SKXWriteResGroup97], (instregex "VPERMI2W128rr",
1377 def SKXWriteResGroup99 : SchedWriteRes<[SKXPort23,SKXPort0156]> {
1379 let NumMicroOps = 3;
1380 let ResourceCycles = [1,2];
1382 def: InstRW<[SKXWriteResGroup99], (instrs LEAVE, LEAVE64,
1383 SCASB, SCASL, SCASQ, SCASW)>;
1385 def SKXWriteResGroup100 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort015]> {
1387 let NumMicroOps = 3;
1388 let ResourceCycles = [1,1,1];
1390 def: InstRW<[SKXWriteResGroup100], (instregex "VCVTSS2USI64Zrr",
1391 "(V?)CVTSS2SI64(Z?)rr",
1392 "(V?)CVTTSS2SI64(Z?)rr",
1393 "VCVTTSS2USI64Zrr")>;
1395 def SKXWriteResGroup101 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort05]> {
1397 let NumMicroOps = 3;
1398 let ResourceCycles = [1,1,1];
1400 def: InstRW<[SKXWriteResGroup101], (instrs FLDCW16m)>;
1402 def SKXWriteResGroup103 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort0156]> {
1404 let NumMicroOps = 3;
1405 let ResourceCycles = [1,1,1];
1407 def: InstRW<[SKXWriteResGroup103], (instregex "KMOV(B|D|Q|W)km")>;
1409 def SKXWriteResGroup104 : SchedWriteRes<[SKXPort6,SKXPort23,SKXPort0156]> {
1411 let NumMicroOps = 3;
1412 let ResourceCycles = [1,1,1];
1414 def: InstRW<[SKXWriteResGroup104], (instrs LRETQ, RETQ)>;
1416 def SKXWriteResGroup106 : SchedWriteRes<[SKXPort4,SKXPort5,SKXPort237]> {
1418 let NumMicroOps = 4;
1419 let ResourceCycles = [1,2,1];
1421 def: InstRW<[SKXWriteResGroup106], (instregex "VCOMPRESSPD(Z|Z128|Z256)mr(b?)",
1422 "VCOMPRESSPS(Z|Z128|Z256)mr(b?)",
1423 "VPCOMPRESSD(Z|Z128|Z256)mr(b?)",
1424 "VPCOMPRESSQ(Z|Z128|Z256)mr(b?)")>;
1426 def SKXWriteResGroup107 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort06]> {
1428 let NumMicroOps = 5;
1429 let ResourceCycles = [1,1,1,2];
1431 def: InstRW<[SKXWriteResGroup107], (instregex "ROL(8|16|32|64)m(1|i)",
1432 "ROR(8|16|32|64)m(1|i)")>;
1434 def SKXWriteResGroup107_1 : SchedWriteRes<[SKXPort06]> {
1436 let NumMicroOps = 2;
1437 let ResourceCycles = [2];
1439 def: InstRW<[SKXWriteResGroup107_1], (instrs ROL8r1, ROL16r1, ROL32r1, ROL64r1,
1440 ROR8r1, ROR16r1, ROR32r1, ROR64r1)>;
1442 def SKXWriteResGroup108 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort0156]> {
1444 let NumMicroOps = 5;
1445 let ResourceCycles = [1,1,1,2];
1447 def: InstRW<[SKXWriteResGroup108], (instregex "XADD(8|16|32|64)rm")>;
1449 def SKXWriteResGroup109 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort23,SKXPort237,SKXPort0156]> {
1451 let NumMicroOps = 5;
1452 let ResourceCycles = [1,1,1,1,1];
1454 def: InstRW<[SKXWriteResGroup109], (instregex "CALL(16|32|64)m")>;
1455 def: InstRW<[SKXWriteResGroup109], (instrs FARCALL64)>;
1457 def SKXWriteResGroup110 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort237,SKXPort0156]> {
1459 let NumMicroOps = 7;
1460 let ResourceCycles = [1,2,2,2];
1462 def: InstRW<[SKXWriteResGroup110], (instrs VPSCATTERDQZ128mr,
1465 VSCATTERQPDZ128mr)>;
1467 def SKXWriteResGroup111 : SchedWriteRes<[SKXPort6,SKXPort06,SKXPort15,SKXPort0156]> {
1469 let NumMicroOps = 7;
1470 let ResourceCycles = [1,3,1,2];
1472 def: InstRW<[SKXWriteResGroup111], (instrs LOOP)>;
1474 def SKXWriteResGroup112 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort237,SKXPort0156]> {
1476 let NumMicroOps = 11;
1477 let ResourceCycles = [1,4,4,2];
1479 def: InstRW<[SKXWriteResGroup112], (instrs VPSCATTERDQZ256mr,
1482 VSCATTERQPDZ256mr)>;
1484 def SKXWriteResGroup113 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort237,SKXPort0156]> {
1486 let NumMicroOps = 19;
1487 let ResourceCycles = [1,8,8,2];
1489 def: InstRW<[SKXWriteResGroup113], (instrs VPSCATTERDQZmr,
1494 def SKXWriteResGroup114 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort237,SKXPort0156]> {
1496 let NumMicroOps = 36;
1497 let ResourceCycles = [1,16,1,16,2];
1499 def: InstRW<[SKXWriteResGroup114], (instrs VSCATTERDPSZmr)>;
1501 def SKXWriteResGroup118 : SchedWriteRes<[SKXPort1,SKXPort23]> {
1503 let NumMicroOps = 2;
1504 let ResourceCycles = [1,1];
1506 def: InstRW<[SKXWriteResGroup118], (instregex "PDEP(32|64)rm",
1509 def SKXWriteResGroup119 : SchedWriteRes<[SKXPort5,SKXPort23]> {
1511 let NumMicroOps = 2;
1512 let ResourceCycles = [1,1];
1514 def: InstRW<[SKXWriteResGroup119], (instregex "FCOM(P?)(32|64)m",
1515 "VFPCLASSSDZrm(b?)",
1516 "VPBROADCASTB(Z|Z256)m(b?)",
1517 "VPBROADCASTW(Z|Z256)m(b?)")>;
1518 def: InstRW<[SKXWriteResGroup119], (instrs VPBROADCASTBYrm,
1524 def SKXWriteResGroup121 : SchedWriteRes<[SKXPort23,SKXPort015]> {
1526 let NumMicroOps = 2;
1527 let ResourceCycles = [1,1];
1529 def: InstRW<[SKXWriteResGroup121], (instrs VMOVNTDQAZ256rm,
1531 def: InstRW<[SKXWriteResGroup121, ReadAfterVecYLd],
1532 (instregex "VBLENDMPD(Z|Z256)rm(b?)",
1533 "VBLENDMPS(Z|Z256)rm(b?)",
1534 "VBROADCASTF32X2Z256m(b?)",
1535 "VBROADCASTF32X2Zm(b?)",
1536 "VBROADCASTF32X4Z256rm(b?)",
1537 "VBROADCASTF32X4rm(b?)",
1538 "VBROADCASTF32X8rm(b?)",
1539 "VBROADCASTF64X2Z128rm(b?)",
1540 "VBROADCASTF64X2rm(b?)",
1541 "VBROADCASTF64X4rm(b?)",
1542 "VBROADCASTI32X2Z256m(b?)",
1543 "VBROADCASTI32X2Zm(b?)",
1544 "VBROADCASTI32X4Z256rm(b?)",
1545 "VBROADCASTI32X4rm(b?)",
1546 "VBROADCASTI32X8rm(b?)",
1547 "VBROADCASTI64X2Z128rm(b?)",
1548 "VBROADCASTI64X2rm(b?)",
1549 "VBROADCASTI64X4rm(b?)",
1550 "VBROADCASTSD(Z|Z256)m(b?)",
1551 "VBROADCASTSS(Z|Z256)m(b?)",
1552 "VINSERTF32x4(Z|Z256)rm(b?)",
1553 "VINSERTF32x8Zrm(b?)",
1554 "VINSERTF64x2(Z|Z256)rm(b?)",
1555 "VINSERTF64x4Zrm(b?)",
1556 "VINSERTI32x4(Z|Z256)rm(b?)",
1557 "VINSERTI32x8Zrm(b?)",
1558 "VINSERTI64x2(Z|Z256)rm(b?)",
1559 "VINSERTI64x4Zrm(b?)",
1560 "VMOVAPD(Z|Z256)rm(b?)",
1561 "VMOVAPS(Z|Z256)rm(b?)",
1562 "VMOVDDUP(Z|Z256)rm(b?)",
1563 "VMOVDQA32(Z|Z256)rm(b?)",
1564 "VMOVDQA64(Z|Z256)rm(b?)",
1565 "VMOVDQU16(Z|Z256)rm(b?)",
1566 "VMOVDQU32(Z|Z256)rm(b?)",
1567 "VMOVDQU64(Z|Z256)rm(b?)",
1568 "VMOVDQU8(Z|Z256)rm(b?)",
1569 "VMOVSHDUP(Z|Z256)rm(b?)",
1570 "VMOVSLDUP(Z|Z256)rm(b?)",
1571 "VMOVUPD(Z|Z256)rm(b?)",
1572 "VMOVUPS(Z|Z256)rm(b?)",
1573 "VPADD(B|D|Q|W)Yrm",
1574 "VPADD(B|D|Q|W)(Z|Z256)rm(b?)",
1575 "VPBLENDM(B|D|Q|W)(Z|Z256)rm(b?)",
1576 "VPBROADCASTD(Z|Z256)m(b?)",
1577 "VPBROADCASTQ(Z|Z256)m(b?)",
1578 "VPSUB(B|D|Q|W)Yrm",
1579 "VPSUB(B|D|Q|W)(Z|Z256)rm(b?)",
1580 "VPTERNLOGD(Z|Z256)rm(b?)i",
1581 "VPTERNLOGQ(Z|Z256)rm(b?)i")>;
1583 def SKXWriteResGroup123 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
1585 let NumMicroOps = 4;
1586 let ResourceCycles = [1,2,1];
1588 def: InstRW<[SKXWriteResGroup123], (instregex "MMX_PH(ADD|SUB)SWrm")>;
1590 def SKXWriteResGroup127 : SchedWriteRes<[SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
1592 let NumMicroOps = 5;
1593 let ResourceCycles = [1,1,1,2];
1595 def: InstRW<[SKXWriteResGroup127], (instregex "RCL(8|16|32|64)m(1|i)",
1596 "RCR(8|16|32|64)m(1|i)")>;
1598 def SKXWriteResGroup128 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort06]> {
1600 let NumMicroOps = 6;
1601 let ResourceCycles = [1,1,1,3];
1603 def: InstRW<[SKXWriteResGroup128], (instregex "ROL(8|16|32|64)mCL",
1604 "ROR(8|16|32|64)mCL",
1605 "SAR(8|16|32|64)mCL",
1606 "SHL(8|16|32|64)mCL",
1607 "SHR(8|16|32|64)mCL")>;
1609 def SKXWriteResGroup130 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
1611 let NumMicroOps = 6;
1612 let ResourceCycles = [1,1,1,2,1];
1614 def: SchedAlias<WriteADCRMW, SKXWriteResGroup130>;
1616 def SKXWriteResGroup131 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort237,SKXPort0156]> {
1618 let NumMicroOps = 8;
1619 let ResourceCycles = [1,2,1,2,2];
1621 def: InstRW<[SKXWriteResGroup131], (instrs VPSCATTERQDZ128mr,
1624 VSCATTERQPSZ256mr)>;
1626 def SKXWriteResGroup132 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort237,SKXPort0156]> {
1628 let NumMicroOps = 12;
1629 let ResourceCycles = [1,4,1,4,2];
1631 def: InstRW<[SKXWriteResGroup132], (instrs VPSCATTERDDZ128mr,
1632 VSCATTERDPSZ128mr)>;
1634 def SKXWriteResGroup133 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort237,SKXPort0156]> {
1636 let NumMicroOps = 20;
1637 let ResourceCycles = [1,8,1,8,2];
1639 def: InstRW<[SKXWriteResGroup133], (instrs VPSCATTERDDZ256mr,
1640 VSCATTERDPSZ256mr)>;
1642 def SKXWriteResGroup134 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort237,SKXPort0156]> {
1644 let NumMicroOps = 36;
1645 let ResourceCycles = [1,16,1,16,2];
1647 def: InstRW<[SKXWriteResGroup134], (instrs VPSCATTERDDZmr)>;
1649 def SKXWriteResGroup135 : SchedWriteRes<[SKXPort0,SKXPort23]> {
1651 let NumMicroOps = 2;
1652 let ResourceCycles = [1,1];
1654 def: InstRW<[SKXWriteResGroup135], (instrs MMX_CVTPI2PSirm)>;
1656 def SKXWriteResGroup136 : SchedWriteRes<[SKXPort5,SKXPort23]> {
1658 let NumMicroOps = 2;
1659 let ResourceCycles = [1,1];
1661 def: InstRW<[SKXWriteResGroup136], (instrs VPMOVSXBWYrm,
1665 def: InstRW<[SKXWriteResGroup136], (instregex "VALIGN(D|Q)Z128rm(b?)i",
1666 "VCMP(PD|PS)Z128rm(b?)i",
1668 "VFPCLASSSSZrm(b?)",
1669 "VPCMPBZ128rmi(b?)",
1670 "VPCMPDZ128rmi(b?)",
1671 "VPCMPEQ(B|D|Q|W)Z128rm(b?)",
1672 "VPCMPGT(B|D|Q|W)Z128rm(b?)",
1674 "VPCMPQZ128rmi(b?)",
1675 "VPCMPU(B|D|Q|W)Z128rmi(b?)",
1676 "VPCMPWZ128rmi(b?)",
1677 "VPERMI2D128rm(b?)",
1678 "VPERMI2PD128rm(b?)",
1679 "VPERMI2PS128rm(b?)",
1680 "VPERMI2Q128rm(b?)",
1681 "VPERMT2D128rm(b?)",
1682 "VPERMT2PD128rm(b?)",
1683 "VPERMT2PS128rm(b?)",
1684 "VPERMT2Q128rm(b?)",
1685 "VPMAXSQZ128rm(b?)",
1686 "VPMAXUQZ128rm(b?)",
1687 "VPMINSQZ128rm(b?)",
1688 "VPMINUQZ128rm(b?)",
1689 "VPMOVSXBDZ128rm(b?)",
1690 "VPMOVSXBQZ128rm(b?)",
1691 "VPMOVSXBWZ128rm(b?)",
1692 "VPMOVSXDQZ128rm(b?)",
1693 "VPMOVSXWDZ128rm(b?)",
1694 "VPMOVSXWQZ128rm(b?)",
1695 "VPMOVZXBDZ128rm(b?)",
1696 "VPMOVZXBQZ128rm(b?)",
1697 "VPMOVZXBWZ128rm(b?)",
1698 "VPMOVZXDQZ128rm(b?)",
1699 "VPMOVZXWDZ128rm(b?)",
1700 "VPMOVZXWQZ128rm(b?)",
1701 "VPTESTMBZ128rm(b?)",
1702 "VPTESTMDZ128rm(b?)",
1703 "VPTESTMQZ128rm(b?)",
1704 "VPTESTMWZ128rm(b?)",
1705 "VPTESTNMBZ128rm(b?)",
1706 "VPTESTNMDZ128rm(b?)",
1707 "VPTESTNMQZ128rm(b?)",
1708 "VPTESTNMWZ128rm(b?)")>;
1710 def SKXWriteResGroup137 : SchedWriteRes<[SKXPort23,SKXPort015]> {
1712 let NumMicroOps = 2;
1713 let ResourceCycles = [1,1];
1715 def: InstRW<[SKXWriteResGroup137], (instregex "MMX_CVT(T?)PS2PIirm",
1718 def SKXWriteResGroup143 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort23]> {
1720 let NumMicroOps = 4;
1721 let ResourceCycles = [2,1,1];
1723 def: InstRW<[SKXWriteResGroup143], (instregex "(V?)PHADDSWrm",
1726 def SKXWriteResGroup146 : SchedWriteRes<[SKXPort1,SKXPort6,SKXPort23,SKXPort0156]> {
1728 let NumMicroOps = 5;
1729 let ResourceCycles = [1,2,1,1];
1731 def: InstRW<[SKXWriteResGroup146], (instregex "LAR(16|32|64)rm",
1732 "LSL(16|32|64)rm")>;
1734 def SKXWriteResGroup148 : SchedWriteRes<[SKXPort5,SKXPort23]> {
1736 let NumMicroOps = 2;
1737 let ResourceCycles = [1,1];
1739 def: InstRW<[SKXWriteResGroup148], (instrs VPCMPGTQYrm)>;
1740 def: InstRW<[SKXWriteResGroup148], (instregex "(ADD|SUB|SUBR)_F(32|64)m",
1742 "VALIGND(Z|Z256)rm(b?)i",
1743 "VALIGNQ(Z|Z256)rm(b?)i",
1744 "VCMPPD(Z|Z256)rm(b?)i",
1745 "VCMPPS(Z|Z256)rm(b?)i",
1746 "VPCMPB(Z|Z256)rmi(b?)",
1747 "VPCMPD(Z|Z256)rmi(b?)",
1748 "VPCMPEQB(Z|Z256)rm(b?)",
1749 "VPCMPEQD(Z|Z256)rm(b?)",
1750 "VPCMPEQQ(Z|Z256)rm(b?)",
1751 "VPCMPEQW(Z|Z256)rm(b?)",
1752 "VPCMPGTB(Z|Z256)rm(b?)",
1753 "VPCMPGTD(Z|Z256)rm(b?)",
1754 "VPCMPGTQ(Z|Z256)rm(b?)",
1755 "VPCMPGTW(Z|Z256)rm(b?)",
1756 "VPCMPQ(Z|Z256)rmi(b?)",
1757 "VPCMPU(B|D|Q|W)Z256rmi(b?)",
1758 "VPCMPU(B|D|Q|W)Zrmi(b?)",
1759 "VPCMPW(Z|Z256)rmi(b?)",
1760 "VPMAXSQ(Z|Z256)rm(b?)",
1761 "VPMAXUQ(Z|Z256)rm(b?)",
1762 "VPMINSQ(Z|Z256)rm(b?)",
1763 "VPMINUQ(Z|Z256)rm(b?)",
1764 "VPTESTM(B|D|Q|W)Z256rm(b?)",
1765 "VPTESTM(B|D|Q|W)Zrm(b?)",
1766 "VPTESTNM(B|D|Q|W)Z256rm(b?)",
1767 "VPTESTNM(B|D|Q|W)Zrm(b?)")>;
1769 def SKXWriteResGroup149 : SchedWriteRes<[SKXPort23,SKXPort015]> {
1771 let NumMicroOps = 2;
1772 let ResourceCycles = [1,1];
1774 def: InstRW<[SKXWriteResGroup149], (instregex "VCVTDQ2PDZ128rm(b?)",
1775 "VCVTDQ2PSZ128rm(b?)",
1777 "VCVTPD2QQZ128rm(b?)",
1778 "VCVTPD2UQQZ128rm(b?)",
1779 "VCVTPH2PSZ128rm(b?)",
1780 "VCVTPS2DQZ128rm(b?)",
1782 "VCVTPS2PDZ128rm(b?)",
1783 "VCVTPS2QQZ128rm(b?)",
1784 "VCVTPS2UDQZ128rm(b?)",
1785 "VCVTPS2UQQZ128rm(b?)",
1786 "VCVTQQ2PDZ128rm(b?)",
1787 "VCVTQQ2PSZ128rm(b?)",
1790 "VCVTTPD2QQZ128rm(b?)",
1791 "VCVTTPD2UQQZ128rm(b?)",
1792 "VCVTTPS2DQZ128rm(b?)",
1794 "VCVTTPS2QQZ128rm(b?)",
1795 "VCVTTPS2UDQZ128rm(b?)",
1796 "VCVTTPS2UQQZ128rm(b?)",
1797 "VCVTUDQ2PDZ128rm(b?)",
1798 "VCVTUDQ2PSZ128rm(b?)",
1799 "VCVTUQQ2PDZ128rm(b?)",
1800 "VCVTUQQ2PSZ128rm(b?)")>;
1802 def SKXWriteResGroup151 : SchedWriteRes<[SKXPort5,SKXPort23]> {
1804 let NumMicroOps = 3;
1805 let ResourceCycles = [2,1];
1807 def: InstRW<[SKXWriteResGroup151], (instregex "VEXPANDPDZ128rm(b?)",
1808 "VEXPANDPSZ128rm(b?)",
1809 "VPEXPANDDZ128rm(b?)",
1810 "VPEXPANDQZ128rm(b?)")>;
1812 def SKXWriteResGroup153 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort015]> {
1814 let NumMicroOps = 3;
1815 let ResourceCycles = [1,1,1];
1817 def: InstRW<[SKXWriteResGroup153], (instregex "(V?)CVTSD2SSrm")>;
1819 def SKXWriteResGroup154 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort23]> {
1821 let NumMicroOps = 4;
1822 let ResourceCycles = [2,1,1];
1824 def: InstRW<[SKXWriteResGroup154], (instrs VPHADDSWYrm,
1827 def SKXWriteResGroup157 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
1829 let NumMicroOps = 8;
1830 let ResourceCycles = [1,1,1,1,1,3];
1832 def: InstRW<[SKXWriteResGroup157], (instregex "XCHG(8|16|32|64)rm")>;
1834 def SKXWriteResGroup159 : SchedWriteRes<[SKXPort0,SKXFPDivider]> {
1836 let NumMicroOps = 1;
1837 let ResourceCycles = [1,3];
1839 def : SchedAlias<WriteFDivX, SKXWriteResGroup159>; // TODO - convert to ZnWriteResFpuPair
1841 def SKXWriteResGroup160 : SchedWriteRes<[SKXPort0,SKXPort23]> {
1843 let NumMicroOps = 2;
1844 let ResourceCycles = [1,1];
1846 def: InstRW<[SKXWriteResGroup160], (instregex "MUL_F(32|64)m")>;
1848 def SKXWriteResGroup161 : SchedWriteRes<[SKXPort23,SKXPort015]> {
1850 let NumMicroOps = 2;
1851 let ResourceCycles = [1,1];
1853 def: InstRW<[SKXWriteResGroup161], (instrs VCVTDQ2PSYrm,
1855 def: InstRW<[SKXWriteResGroup161], (instregex "VCVTDQ2(PD|PS)(Z|Z256)rm(b?)",
1856 "VCVTPH2PS(Z|Z256)rm(b?)",
1857 "VCVTPS2PD(Z|Z256)rm(b?)",
1858 "VCVTQQ2PD(Z|Z256)rm(b?)",
1859 "VCVTQQ2PSZ256rm(b?)",
1860 "VCVT(T?)PD2QQ(Z|Z256)rm(b?)",
1861 "VCVT(T?)PD2UQQ(Z|Z256)rm(b?)",
1863 "VCVT(T?)PS2DQ(Z|Z256)rm(b?)",
1864 "VCVT(T?)PS2QQZ256rm(b?)",
1865 "VCVT(T?)PS2UDQ(Z|Z256)rm(b?)",
1866 "VCVT(T?)PS2UQQZ256rm(b?)",
1867 "VCVTUDQ2(PD|PS)(Z|Z256)rm(b?)",
1868 "VCVTUQQ2PD(Z|Z256)rm(b?)",
1869 "VCVTUQQ2PSZ256rm(b?)")>;
1871 def SKXWriteResGroup162 : SchedWriteRes<[SKXPort5,SKXPort23]> {
1873 let NumMicroOps = 3;
1874 let ResourceCycles = [2,1];
1876 def: InstRW<[SKXWriteResGroup162], (instregex "FICOM(P?)(16|32)m",
1877 "VEXPANDPD(Z|Z256)rm(b?)",
1878 "VEXPANDPS(Z|Z256)rm(b?)",
1879 "VPEXPANDD(Z|Z256)rm(b?)",
1880 "VPEXPANDQ(Z|Z256)rm(b?)")>;
1882 def SKXWriteResGroup163 : SchedWriteRes<[SKXPort23,SKXPort015]> {
1884 let NumMicroOps = 3;
1885 let ResourceCycles = [1,2];
1887 def: InstRW<[SKXWriteResGroup163], (instregex "VCVTSD2SSZrm")>;
1889 def SKXWriteResGroup164 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
1891 let NumMicroOps = 3;
1892 let ResourceCycles = [1,1,1];
1894 def: InstRW<[SKXWriteResGroup164], (instregex "(V?)CVTDQ2PDrm")>;
1896 def SKXWriteResGroup166 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort015]> {
1898 let NumMicroOps = 3;
1899 let ResourceCycles = [1,1,1];
1901 def: InstRW<[SKXWriteResGroup166], (instrs CVTPD2PSrm,
1907 def SKXWriteResGroup167 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort015]> {
1909 let NumMicroOps = 4;
1910 let ResourceCycles = [2,1,1];
1912 def: InstRW<[SKXWriteResGroup167], (instregex "VPCONFLICTQZ128rm(b?)")>;
1914 def SKXWriteResGroup169 : SchedWriteRes<[SKXPort1,SKXPort06,SKXPort0156]> {
1916 let NumMicroOps = 7;
1917 let ResourceCycles = [2,3,2];
1919 def: InstRW<[SKXWriteResGroup169], (instregex "RCL(16|32|64)rCL",
1920 "RCR(16|32|64)rCL")>;
1922 def SKXWriteResGroup170 : SchedWriteRes<[SKXPort1,SKXPort06,SKXPort15,SKXPort0156]> {
1924 let NumMicroOps = 9;
1925 let ResourceCycles = [1,5,1,2];
1927 def: InstRW<[SKXWriteResGroup170], (instrs RCL8rCL)>;
1929 def SKXWriteResGroup171 : SchedWriteRes<[SKXPort06,SKXPort0156]> {
1931 let NumMicroOps = 11;
1932 let ResourceCycles = [2,9];
1934 def: InstRW<[SKXWriteResGroup171], (instrs LOOPE, LOOPNE)>;
1936 def SKXWriteResGroup174 : SchedWriteRes<[SKXPort01]> {
1938 let NumMicroOps = 3;
1939 let ResourceCycles = [3];
1941 def: InstRW<[SKXWriteResGroup174], (instregex "VPMULLQ(Z128|Z256)rr")>;
1943 def SKXWriteResGroup174z : SchedWriteRes<[SKXPort05]> {
1945 let NumMicroOps = 3;
1946 let ResourceCycles = [3];
1948 def: InstRW<[SKXWriteResGroup174z], (instregex "VPMULLQZrr")>;
1950 def SKXWriteResGroup175 : SchedWriteRes<[SKXPort5,SKXPort23]> {
1952 let NumMicroOps = 3;
1953 let ResourceCycles = [2,1];
1955 def: InstRW<[SKXWriteResGroup175], (instregex "VPERMWZ128rm(b?)")>;
1957 def SKXWriteResGroup176 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort015]> {
1959 let NumMicroOps = 3;
1960 let ResourceCycles = [1,1,1];
1962 def: InstRW<[SKXWriteResGroup176], (instregex "VCVT(T?)SD2USIZrm(b?)",
1963 "VCVT(T?)SS2USI64Zrm(b?)")>;
1965 def SKXWriteResGroup177 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort015]> {
1967 let NumMicroOps = 3;
1968 let ResourceCycles = [1,1,1];
1970 def: InstRW<[SKXWriteResGroup177], (instregex "VCVT(T?)PS2QQZrm(b?)",
1971 "VCVT(T?)PS2UQQZrm(b?)")>;
1973 def SKXWriteResGroup179 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23,SKXPort015]> {
1975 let NumMicroOps = 4;
1976 let ResourceCycles = [1,1,1,1];
1978 def: InstRW<[SKXWriteResGroup179], (instregex "CVTTSS2SI64rm")>;
1980 def SKXWriteResGroup180 : SchedWriteRes<[SKXPort5,SKXPort23]> {
1982 let NumMicroOps = 3;
1983 let ResourceCycles = [2,1];
1985 def: InstRW<[SKXWriteResGroup180], (instregex "(ADD|SUB|SUBR)_FI(16|32)m",
1989 def SKXWriteResGroup181 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
1991 let NumMicroOps = 3;
1992 let ResourceCycles = [1,1,1];
1994 def: InstRW<[SKXWriteResGroup181], (instrs VCVTDQ2PDYrm)>;
1996 def SKXWriteResGroup183 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort015]> {
1998 let NumMicroOps = 4;
1999 let ResourceCycles = [2,1,1];
2001 def: InstRW<[SKXWriteResGroup183], (instregex "VPERMI2W128rm(b?)",
2002 "VPERMT2W128rm(b?)")>;
2004 def SKXWriteResGroup184 : SchedWriteRes<[SKXPort0,SKXFPDivider]> {
2006 let NumMicroOps = 1;
2007 let ResourceCycles = [1,3];
2009 def : SchedAlias<WriteFDiv64, SKXWriteResGroup184>; // TODO - convert to ZnWriteResFpuPair
2010 def : SchedAlias<WriteFDiv64X, SKXWriteResGroup184>; // TODO - convert to ZnWriteResFpuPair
2012 def SKXWriteResGroup184_1 : SchedWriteRes<[SKXPort0,SKXFPDivider]> {
2014 let NumMicroOps = 1;
2015 let ResourceCycles = [1,5];
2017 def : SchedAlias<WriteFDiv64Y, SKXWriteResGroup184_1>; // TODO - convert to ZnWriteResFpuPair
2019 def SKXWriteResGroup187 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
2021 let NumMicroOps = 3;
2022 let ResourceCycles = [1,1,1];
2024 def: InstRW<[SKXWriteResGroup187], (instregex "MUL_FI(16|32)m")>;
2026 def SKXWriteResGroup188 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort015]> {
2028 let NumMicroOps = 3;
2029 let ResourceCycles = [1,1,1];
2031 def: InstRW<[SKXWriteResGroup188], (instregex "VCVTPD2DQZrm(b?)",
2033 "VCVTPD2UDQZrm(b?)",
2035 "VCVTTPD2DQZrm(b?)",
2036 "VCVTTPD2UDQZrm(b?)",
2037 "VCVTUQQ2PSZrm(b?)")>;
2039 def SKXWriteResGroup189 : SchedWriteRes<[SKXPort5,SKXPort23,SKXPort015]> {
2041 let NumMicroOps = 4;
2042 let ResourceCycles = [2,1,1];
2044 def: InstRW<[SKXWriteResGroup189], (instregex "VPERMI2W256rm(b?)",
2046 "VPERMT2W256rm(b?)",
2049 def SKXWriteResGroup190 : SchedWriteRes<[SKXPort1,SKXPort06,SKXPort15,SKXPort0156]> {
2051 let NumMicroOps = 10;
2052 let ResourceCycles = [2,4,1,3];
2054 def: InstRW<[SKXWriteResGroup190], (instrs RCR8rCL)>;
2056 def SKXWriteResGroup191 : SchedWriteRes<[SKXPort0]> {
2058 let NumMicroOps = 1;
2059 let ResourceCycles = [1];
2061 def: InstRW<[SKXWriteResGroup191], (instregex "DIVR_(FPrST0|FST0r|FrST0)")>;
2063 def SKXWriteResGroup194 : SchedWriteRes<[SKXPort1,SKXPort5,SKXPort01,SKXPort23,SKXPort015]> {
2065 let NumMicroOps = 8;
2066 let ResourceCycles = [1,2,2,1,2];
2068 def: InstRW<[SKXWriteResGroup194], (instregex "VPCONFLICTDZ128rm(b?)")>;
2070 def SKXWriteResGroup195 : SchedWriteRes<[SKXPort1,SKXPort23,SKXPort237,SKXPort06,SKXPort15,SKXPort0156]> {
2072 let NumMicroOps = 10;
2073 let ResourceCycles = [1,1,1,5,1,1];
2075 def: InstRW<[SKXWriteResGroup195], (instregex "RCL(8|16|32|64)mCL")>;
2077 def SKXWriteResGroup199 : SchedWriteRes<[SKXPort4,SKXPort23,SKXPort237,SKXPort06,SKXPort15,SKXPort0156]> {
2079 let NumMicroOps = 14;
2080 let ResourceCycles = [1,1,1,4,2,5];
2082 def: InstRW<[SKXWriteResGroup199], (instrs CMPXCHG8B)>;
2084 def SKXWriteResGroup200 : SchedWriteRes<[SKXPort1, SKXPort05, SKXPort6]> {
2086 let NumMicroOps = 34;
2087 let ResourceCycles = [1, 4, 5];
2089 def: InstRW<[SKXWriteResGroup200], (instrs VZEROALL)>;
2091 def SKXWriteResGroup201 : SchedWriteRes<[SKXPort0,SKXPort23,SKXFPDivider]> {
2093 let NumMicroOps = 2;
2094 let ResourceCycles = [1,1,5];
2096 def : SchedAlias<WriteFDivXLd, SKXWriteResGroup201>; // TODO - convert to ZnWriteResFpuPair
2098 def SKXWriteResGroup202 : SchedWriteRes<[SKXPort0,SKXPort1,SKXPort5,SKXPort6,SKXPort05,SKXPort0156]> {
2100 let NumMicroOps = 15;
2101 let ResourceCycles = [2,1,2,4,2,4];
2103 def: InstRW<[SKXWriteResGroup202], (instrs XCH_F)>;
2105 def SKXWriteResGroup205 : SchedWriteRes<[SKXPort23,SKXPort015]> {
2107 let NumMicroOps = 4;
2108 let ResourceCycles = [1,3];
2110 def: InstRW<[SKXWriteResGroup205], (instregex "VPMULLQZ128rm(b?)")>;
2112 def SKXWriteResGroup207 : SchedWriteRes<[SKXPort5,SKXPort6,SKXPort06,SKXPort0156]> {
2114 let NumMicroOps = 8;
2115 let ResourceCycles = [1,1,1,5];
2117 def: InstRW<[SKXWriteResGroup207], (instrs CPUID, RDTSC)>;
2119 def SKXWriteResGroup208 : SchedWriteRes<[SKXPort1,SKXPort23,SKXPort237,SKXPort06,SKXPort15,SKXPort0156]> {
2121 let NumMicroOps = 11;
2122 let ResourceCycles = [2,1,1,4,1,2];
2124 def: InstRW<[SKXWriteResGroup208], (instregex "RCR(8|16|32|64)mCL")>;
2126 def SKXWriteResGroup209 : SchedWriteRes<[SKXPort0,SKXPort23,SKXFPDivider]> {
2128 let NumMicroOps = 2;
2129 let ResourceCycles = [1,1,4];
2131 def : SchedAlias<WriteFDiv64Ld, SKXWriteResGroup209>; // TODO - convert to ZnWriteResFpuPair
2133 def SKXWriteResGroup211 : SchedWriteRes<[SKXPort23,SKXPort015]> {
2135 let NumMicroOps = 4;
2136 let ResourceCycles = [1,3];
2138 def: InstRW<[SKXWriteResGroup211], (instregex "VPMULLQZ256rm(b?)",
2141 def SKXWriteResGroup214 : SchedWriteRes<[]> {
2143 let NumMicroOps = 0;
2145 def: InstRW<[SKXWriteResGroup214], (instrs VGATHERDPSZ128rm,
2149 def SKXWriteResGroup215 : SchedWriteRes<[SKXPort0]> {
2151 let NumMicroOps = 1;
2152 let ResourceCycles = [1];
2154 def: InstRW<[SKXWriteResGroup215], (instregex "DIV_(FPrST0|FST0r|FrST0)")>;
2156 def SKXWriteResGroup216 : SchedWriteRes<[SKXPort0,SKXPort23,SKXFPDivider]> {
2158 let NumMicroOps = 2;
2159 let ResourceCycles = [1,1,4];
2161 def : SchedAlias<WriteFDiv64XLd, SKXWriteResGroup216>; // TODO - convert to ZnWriteResFpuPair
2163 def SKXWriteResGroup218 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort015,SKXPort0156]> {
2165 let NumMicroOps = 5;
2166 let ResourceCycles = [1,2,1,1];
2168 def: InstRW<[SKXWriteResGroup218], (instrs VGATHERQPSZ128rm,
2173 def SKXWriteResGroup219 : SchedWriteRes<[SKXPort4,SKXPort5,SKXPort6,SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
2175 let NumMicroOps = 8;
2176 let ResourceCycles = [1,1,1,1,1,1,2];
2178 def: InstRW<[SKXWriteResGroup219], (instrs INSB, INSL, INSW)>;
2180 def SKXWriteResGroup220 : SchedWriteRes<[SKXPort5,SKXPort6,SKXPort0156]> {
2182 let NumMicroOps = 10;
2183 let ResourceCycles = [1,2,7];
2185 def: InstRW<[SKXWriteResGroup220], (instrs MWAITrr)>;
2187 def SKXWriteResGroup222 : SchedWriteRes<[SKXPort0,SKXPort23,SKXFPDivider]> {
2189 let NumMicroOps = 2;
2190 let ResourceCycles = [1,1,8];
2192 def : SchedAlias<WriteFDiv64YLd, SKXWriteResGroup222>; // TODO - convert to ZnWriteResFpuPair
2194 def SKXWriteResGroup223 : SchedWriteRes<[SKXPort0,SKXPort23]> {
2196 let NumMicroOps = 2;
2197 let ResourceCycles = [1,1];
2199 def: InstRW<[SKXWriteResGroup223], (instregex "DIV_F(32|64)m")>;
2201 def SKXWriteResGroup224 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort015,SKXPort0156]> {
2203 let NumMicroOps = 5;
2204 let ResourceCycles = [1,2,1,1];
2206 def: InstRW<[SKXWriteResGroup224], (instrs VGATHERDPDZ128rm,
2211 def SKXWriteResGroup224_2 : SchedWriteRes<[SKXPort0, SKXPort23, SKXPort5, SKXPort015]> {
2213 let NumMicroOps = 5;
2214 let ResourceCycles = [1,2,1,1];
2216 def: InstRW<[SKXWriteResGroup224_2], (instrs VGATHERDPSrm,
2233 def SKXWriteResGroup224_3 : SchedWriteRes<[SKXPort0, SKXPort23, SKXPort5, SKXPort015]> {
2235 let NumMicroOps = 5;
2236 let ResourceCycles = [1,2,1,1];
2238 def: InstRW<[SKXWriteResGroup224_3], (instrs VGATHERDPSYrm,
2253 def SKXWriteResGroup225 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort015]> {
2255 let NumMicroOps = 14;
2256 let ResourceCycles = [5,5,4];
2258 def: InstRW<[SKXWriteResGroup225], (instregex "VPCONFLICTDZ128rr",
2259 "VPCONFLICTQZ256rr")>;
2261 def SKXWriteResGroup228 : SchedWriteRes<[SKXPort0,SKXPort4,SKXPort5,SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
2263 let NumMicroOps = 19;
2264 let ResourceCycles = [2,1,4,1,1,4,6];
2266 def: InstRW<[SKXWriteResGroup228], (instrs CMPXCHG16B)>;
2268 def SKXWriteResGroup233 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
2270 let NumMicroOps = 3;
2271 let ResourceCycles = [1,1,1];
2273 def: InstRW<[SKXWriteResGroup233], (instregex "DIV_FI(16|32)m")>;
2275 def SKXWriteResGroup234 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort015,SKXPort0156]> {
2277 let NumMicroOps = 5;
2278 let ResourceCycles = [1,2,1,1];
2280 def: InstRW<[SKXWriteResGroup234], (instrs VGATHERDPDZ256rm,
2286 def SKXWriteResGroup238 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort015,SKXPort0156]> {
2288 let NumMicroOps = 5;
2289 let ResourceCycles = [1,2,1,1];
2291 def: InstRW<[SKXWriteResGroup238], (instrs VGATHERDPDZrm,
2296 def SKXWriteResGroup239 : SchedWriteRes<[SKXPort0,SKXPort23]> {
2298 let NumMicroOps = 2;
2299 let ResourceCycles = [1,1];
2301 def: InstRW<[SKXWriteResGroup239], (instregex "DIVR_F(32|64)m")>;
2303 def SKXWriteResGroup240 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort015,SKXPort0156]> {
2305 let NumMicroOps = 5;
2306 let ResourceCycles = [1,2,1,1];
2308 def: InstRW<[SKXWriteResGroup240], (instrs VGATHERDPSZ256rm,
2311 def SKXWriteResGroup242 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort23,SKXPort015]> {
2313 let NumMicroOps = 15;
2314 let ResourceCycles = [5,5,1,4];
2316 def: InstRW<[SKXWriteResGroup242], (instregex "VPCONFLICTQZ256rm(b?)")>;
2318 def SKXWriteResGroup243 : SchedWriteRes<[SKXPort0,SKXPort5,SKXPort23]> {
2320 let NumMicroOps = 3;
2321 let ResourceCycles = [1,1,1];
2323 def: InstRW<[SKXWriteResGroup243], (instregex "DIVR_FI(16|32)m")>;
2325 def SKXWriteResGroup245 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort015,SKXPort0156]> {
2327 let NumMicroOps = 5;
2328 let ResourceCycles = [1,2,1,1];
2330 def: InstRW<[SKXWriteResGroup245], (instrs VGATHERDPSZrm,
2333 def SKXWriteResGroup247 : SchedWriteRes<[SKXPort5,SKXPort6,SKXPort23,SKXPort06,SKXPort0156]> {
2335 let NumMicroOps = 23;
2336 let ResourceCycles = [1,5,3,4,10];
2338 def: InstRW<[SKXWriteResGroup247], (instregex "IN(8|16|32)ri",
2341 def SKXWriteResGroup248 : SchedWriteRes<[SKXPort5,SKXPort6,SKXPort23,SKXPort237,SKXPort06,SKXPort0156]> {
2343 let NumMicroOps = 23;
2344 let ResourceCycles = [1,5,2,1,4,10];
2346 def: InstRW<[SKXWriteResGroup248], (instregex "OUT(8|16|32)ir",
2349 def SKXWriteResGroup249 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort015]> {
2351 let NumMicroOps = 21;
2352 let ResourceCycles = [9,7,5];
2354 def: InstRW<[SKXWriteResGroup249], (instregex "VPCONFLICTDZ256rr",
2357 def SKXWriteResGroup250 : SchedWriteRes<[SKXPort1,SKXPort6,SKXPort23,SKXPort0156]> {
2359 let NumMicroOps = 31;
2360 let ResourceCycles = [1,8,1,21];
2362 def: InstRW<[SKXWriteResGroup250], (instregex "XRSTOR(64)?")>;
2364 def SKXWriteResGroup252 : SchedWriteRes<[SKXPort1,SKXPort4,SKXPort5,SKXPort6,SKXPort23,SKXPort237,SKXPort15,SKXPort0156]> {
2366 let NumMicroOps = 18;
2367 let ResourceCycles = [1,1,2,3,1,1,1,8];
2369 def: InstRW<[SKXWriteResGroup252], (instrs VMCLEARm)>;
2371 def SKXWriteResGroup253 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort23,SKXPort237,SKXPort0156]> {
2373 let NumMicroOps = 39;
2374 let ResourceCycles = [1,10,1,1,26];
2376 def: InstRW<[SKXWriteResGroup253], (instrs XSAVE64)>;
2378 def SKXWriteResGroup254 : SchedWriteRes<[SKXPort5,SKXPort0156]> {
2380 let NumMicroOps = 22;
2381 let ResourceCycles = [2,20];
2383 def: InstRW<[SKXWriteResGroup254], (instrs RDTSCP)>;
2385 def SKXWriteResGroup255 : SchedWriteRes<[SKXPort4,SKXPort6,SKXPort23,SKXPort237,SKXPort0156]> {
2387 let NumMicroOps = 40;
2388 let ResourceCycles = [1,11,1,1,26];
2390 def: InstRW<[SKXWriteResGroup255], (instrs XSAVE)>;
2391 def: InstRW<[SKXWriteResGroup255], (instregex "XSAVEC", "XSAVES", "XSAVEOPT")>;
2393 def SKXWriteResGroup256 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort23,SKXPort015]> {
2395 let NumMicroOps = 22;
2396 let ResourceCycles = [9,7,1,5];
2398 def: InstRW<[SKXWriteResGroup256], (instregex "VPCONFLICTDZ256rm(b?)",
2399 "VPCONFLICTQZrm(b?)")>;
2401 def SKXWriteResGroup258 : SchedWriteRes<[SKXPort0,SKXPort23,SKXPort05,SKXPort06,SKXPort0156]> {
2403 let NumMicroOps = 64;
2404 let ResourceCycles = [2,8,5,10,39];
2406 def: InstRW<[SKXWriteResGroup258], (instrs FLDENVm)>;
2408 def SKXWriteResGroup259 : SchedWriteRes<[SKXPort0,SKXPort6,SKXPort23,SKXPort05,SKXPort06,SKXPort15,SKXPort0156]> {
2410 let NumMicroOps = 88;
2411 let ResourceCycles = [4,4,31,1,2,1,45];
2413 def: InstRW<[SKXWriteResGroup259], (instrs FXRSTOR64)>;
2415 def SKXWriteResGroup260 : SchedWriteRes<[SKXPort0,SKXPort6,SKXPort23,SKXPort05,SKXPort06,SKXPort15,SKXPort0156]> {
2417 let NumMicroOps = 90;
2418 let ResourceCycles = [4,2,33,1,2,1,47];
2420 def: InstRW<[SKXWriteResGroup260], (instrs FXRSTOR)>;
2422 def SKXWriteResGroup261 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort015]> {
2424 let NumMicroOps = 35;
2425 let ResourceCycles = [17,11,7];
2427 def: InstRW<[SKXWriteResGroup261], (instregex "VPCONFLICTDZrr")>;
2429 def SKXWriteResGroup262 : SchedWriteRes<[SKXPort5,SKXPort01,SKXPort23,SKXPort015]> {
2431 let NumMicroOps = 36;
2432 let ResourceCycles = [17,11,1,7];
2434 def: InstRW<[SKXWriteResGroup262], (instregex "VPCONFLICTDZrm(b?)")>;
2436 def SKXWriteResGroup263 : SchedWriteRes<[SKXPort5,SKXPort05,SKXPort0156]> {
2438 let NumMicroOps = 15;
2439 let ResourceCycles = [6,3,6];
2441 def: InstRW<[SKXWriteResGroup263], (instrs FNINIT)>;
2443 def SKXWriteResGroup266 : SchedWriteRes<[SKXPort0,SKXPort1,SKXPort4,SKXPort5,SKXPort6,SKXPort237,SKXPort06,SKXPort0156]> {
2445 let NumMicroOps = 100;
2446 let ResourceCycles = [9,1,11,16,1,11,21,30];
2448 def: InstRW<[SKXWriteResGroup266], (instrs FSTENVm)>;
2450 def SKXWriteResGroup267 : SchedWriteRes<[SKXPort6,SKXPort0156]> {
2452 let NumMicroOps = 4;
2453 let ResourceCycles = [1,3];
2455 def: InstRW<[SKXWriteResGroup267], (instrs PAUSE)>;
2457 def: InstRW<[WriteZero], (instrs CLC)>;
2460 // Intruction variants handled by the renamer. These might not need execution
2461 // ports in certain conditions.
2462 // See Agner's Fog "The microarchitecture of Intel, AMD and VIA CPUs",
2463 // section "Skylake Pipeline" > "Register allocation and renaming".
2464 // These can be investigated with llvm-exegesis, e.g.
2465 // echo 'pxor %mm0, %mm0' | /tmp/llvm-exegesis -mode=uops -snippets-file=-
2466 // echo 'vxorpd %xmm0, %xmm0, %xmm1' | /tmp/llvm-exegesis -mode=uops -snippets-file=-
2468 def SKXWriteZeroLatency : SchedWriteRes<[]> {
2472 def SKXWriteZeroIdiom : SchedWriteVariant<[
2473 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
2474 SchedVar<NoSchedPred, [WriteALU]>
2476 def : InstRW<[SKXWriteZeroIdiom], (instrs SUB32rr, SUB64rr,
2479 def SKXWriteFZeroIdiom : SchedWriteVariant<[
2480 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
2481 SchedVar<NoSchedPred, [WriteFLogic]>
2483 def : InstRW<[SKXWriteFZeroIdiom], (instrs XORPSrr, VXORPSrr,
2488 def SKXWriteFZeroIdiomY : SchedWriteVariant<[
2489 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
2490 SchedVar<NoSchedPred, [WriteFLogicY]>
2492 def : InstRW<[SKXWriteFZeroIdiomY], (instrs VXORPSYrr, VXORPDYrr,
2493 VXORPSZ256rr, VXORPDZ256rr)>;
2495 def SKXWriteFZeroIdiomZ : SchedWriteVariant<[
2496 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
2497 SchedVar<NoSchedPred, [WriteFLogicZ]>
2499 def : InstRW<[SKXWriteFZeroIdiomZ], (instrs VXORPSZrr, VXORPDZrr)>;
2501 def SKXWriteVZeroIdiomLogicX : SchedWriteVariant<[
2502 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
2503 SchedVar<NoSchedPred, [WriteVecLogicX]>
2505 def : InstRW<[SKXWriteVZeroIdiomLogicX], (instrs PXORrr, VPXORrr,
2506 VPXORDZ128rr, VPXORQZ128rr)>;
2508 def SKXWriteVZeroIdiomLogicY : SchedWriteVariant<[
2509 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
2510 SchedVar<NoSchedPred, [WriteVecLogicY]>
2512 def : InstRW<[SKXWriteVZeroIdiomLogicY], (instrs VPXORYrr,
2513 VPXORDZ256rr, VPXORQZ256rr)>;
2515 def SKXWriteVZeroIdiomLogicZ : SchedWriteVariant<[
2516 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
2517 SchedVar<NoSchedPred, [WriteVecLogicZ]>
2519 def : InstRW<[SKXWriteVZeroIdiomLogicZ], (instrs VPXORDZrr, VPXORQZrr)>;
2521 def SKXWriteVZeroIdiomALUX : SchedWriteVariant<[
2522 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
2523 SchedVar<NoSchedPred, [WriteVecALUX]>
2525 def : InstRW<[SKXWriteVZeroIdiomALUX], (instrs PCMPGTBrr, VPCMPGTBrr,
2526 PCMPGTDrr, VPCMPGTDrr,
2527 PCMPGTWrr, VPCMPGTWrr)>;
2529 def SKXWriteVZeroIdiomALUY : SchedWriteVariant<[
2530 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
2531 SchedVar<NoSchedPred, [WriteVecALUY]>
2533 def : InstRW<[SKXWriteVZeroIdiomALUY], (instrs VPCMPGTBYrr,
2537 def SKXWritePSUB : SchedWriteRes<[SKXPort015]> {
2539 let NumMicroOps = 1;
2540 let ResourceCycles = [1];
2543 def SKXWriteVZeroIdiomPSUB : SchedWriteVariant<[
2544 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
2545 SchedVar<NoSchedPred, [SKXWritePSUB]>
2548 def : InstRW<[SKXWriteVZeroIdiomPSUB], (instrs PSUBBrr, VPSUBBrr, VPSUBBZ128rr,
2549 PSUBDrr, VPSUBDrr, VPSUBDZ128rr,
2550 PSUBQrr, VPSUBQrr, VPSUBQZ128rr,
2551 PSUBWrr, VPSUBWrr, VPSUBWZ128rr,
2552 VPSUBBYrr, VPSUBBZ256rr,
2553 VPSUBDYrr, VPSUBDZ256rr,
2554 VPSUBQYrr, VPSUBQZ256rr,
2555 VPSUBWYrr, VPSUBWZ256rr,
2560 def SKXWritePCMPGTQ : SchedWriteRes<[SKXPort5]> {
2562 let NumMicroOps = 1;
2563 let ResourceCycles = [1];
2566 def SKXWriteVZeroIdiomPCMPGTQ : SchedWriteVariant<[
2567 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [SKXWriteZeroLatency]>,
2568 SchedVar<NoSchedPred, [SKXWritePCMPGTQ]>
2570 def : InstRW<[SKXWriteVZeroIdiomPCMPGTQ], (instrs PCMPGTQrr, VPCMPGTQrr,
2574 // CMOVs that use both Z and C flag require an extra uop.
2575 def SKXWriteCMOVA_CMOVBErr : SchedWriteRes<[SKXPort06]> {
2577 let ResourceCycles = [2];
2578 let NumMicroOps = 2;
2581 def SKXWriteCMOVA_CMOVBErm : SchedWriteRes<[SKXPort23,SKXPort06]> {
2583 let ResourceCycles = [1,2];
2584 let NumMicroOps = 3;
2587 def SKXCMOVA_CMOVBErr : SchedWriteVariant<[
2588 SchedVar<MCSchedPredicate<IsCMOVArr_Or_CMOVBErr>, [SKXWriteCMOVA_CMOVBErr]>,
2589 SchedVar<NoSchedPred, [WriteCMOV]>
2592 def SKXCMOVA_CMOVBErm : SchedWriteVariant<[
2593 SchedVar<MCSchedPredicate<IsCMOVArm_Or_CMOVBErm>, [SKXWriteCMOVA_CMOVBErm]>,
2594 SchedVar<NoSchedPred, [WriteCMOV.Folded]>
2597 def : InstRW<[SKXCMOVA_CMOVBErr], (instrs CMOV16rr, CMOV32rr, CMOV64rr)>;
2598 def : InstRW<[SKXCMOVA_CMOVBErm], (instrs CMOV16rm, CMOV32rm, CMOV64rm)>;
2600 // SETCCs that use both Z and C flag require an extra uop.
2601 def SKXWriteSETA_SETBEr : SchedWriteRes<[SKXPort06]> {
2603 let ResourceCycles = [2];
2604 let NumMicroOps = 2;
2607 def SKXWriteSETA_SETBEm : SchedWriteRes<[SKXPort4,SKXPort237,SKXPort06]> {
2609 let ResourceCycles = [1,1,2];
2610 let NumMicroOps = 4;
2613 def SKXSETA_SETBErr : SchedWriteVariant<[
2614 SchedVar<MCSchedPredicate<IsSETAr_Or_SETBEr>, [SKXWriteSETA_SETBEr]>,
2615 SchedVar<NoSchedPred, [WriteSETCC]>
2618 def SKXSETA_SETBErm : SchedWriteVariant<[
2619 SchedVar<MCSchedPredicate<IsSETAm_Or_SETBEm>, [SKXWriteSETA_SETBEm]>,
2620 SchedVar<NoSchedPred, [WriteSETCCStore]>
2623 def : InstRW<[SKXSETA_SETBErr], (instrs SETCCr)>;
2624 def : InstRW<[SKXSETA_SETBErm], (instrs SETCCm)>;