1 //=- X86SchedHaswell.td - X86 Haswell 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 Haswell to support instruction
10 // scheduling and other instruction cost heuristics.
12 // Note that we define some instructions here that are not supported by haswell,
13 // but we still have to define them because KNL uses the HSW model.
14 // They are currently tagged with a comment `Unsupported = 1`.
15 // FIXME: Use Unsupported = 1 once KNL has its own model.
17 //===----------------------------------------------------------------------===//
19 def HaswellModel : SchedMachineModel {
20 // All x86 instructions are modeled as a single micro-op, and HW can decode 4
21 // instructions per cycle.
23 let MicroOpBufferSize = 192; // Based on the reorder buffer.
25 let MispredictPenalty = 16;
27 // Based on the LSD (loop-stream detector) queue size and benchmarking data.
28 let LoopMicroOpBufferSize = 50;
30 // This flag is set to allow the scheduler to assign a default model to
31 // unrecognized opcodes.
32 let CompleteModel = 0;
35 let SchedModel = HaswellModel in {
37 // Haswell can issue micro-ops to 8 different ports in one cycle.
39 // Ports 0, 1, 5, and 6 handle all computation.
40 // Port 4 gets the data half of stores. Store data can be available later than
41 // the store address, but since we don't model the latency of stores, we can
43 // Ports 2 and 3 are identical. They handle loads and the address half of
44 // stores. Port 7 can handle address calculations.
45 def HWPort0 : ProcResource<1>;
46 def HWPort1 : ProcResource<1>;
47 def HWPort2 : ProcResource<1>;
48 def HWPort3 : ProcResource<1>;
49 def HWPort4 : ProcResource<1>;
50 def HWPort5 : ProcResource<1>;
51 def HWPort6 : ProcResource<1>;
52 def HWPort7 : ProcResource<1>;
54 // Many micro-ops are capable of issuing on multiple ports.
55 def HWPort01 : ProcResGroup<[HWPort0, HWPort1]>;
56 def HWPort23 : ProcResGroup<[HWPort2, HWPort3]>;
57 def HWPort237 : ProcResGroup<[HWPort2, HWPort3, HWPort7]>;
58 def HWPort04 : ProcResGroup<[HWPort0, HWPort4]>;
59 def HWPort05 : ProcResGroup<[HWPort0, HWPort5]>;
60 def HWPort06 : ProcResGroup<[HWPort0, HWPort6]>;
61 def HWPort15 : ProcResGroup<[HWPort1, HWPort5]>;
62 def HWPort16 : ProcResGroup<[HWPort1, HWPort6]>;
63 def HWPort56 : ProcResGroup<[HWPort5, HWPort6]>;
64 def HWPort015 : ProcResGroup<[HWPort0, HWPort1, HWPort5]>;
65 def HWPort056 : ProcResGroup<[HWPort0, HWPort5, HWPort6]>;
66 def HWPort0156: ProcResGroup<[HWPort0, HWPort1, HWPort5, HWPort6]>;
68 // 60 Entry Unified Scheduler
69 def HWPortAny : ProcResGroup<[HWPort0, HWPort1, HWPort2, HWPort3, HWPort4,
70 HWPort5, HWPort6, HWPort7]> {
74 // Integer division issued on port 0.
75 def HWDivider : ProcResource<1>;
76 // FP division and sqrt on port 0.
77 def HWFPDivider : ProcResource<1>;
79 // Integer loads are 5 cycles, so ReadAfterLd registers needn't be available until 5
80 // cycles after the memory operand.
81 def : ReadAdvance<ReadAfterLd, 5>;
83 // Vector loads are 5/6/7 cycles, so ReadAfterVec*Ld registers needn't be available
84 // until 5/6/7 cycles after the memory operand.
85 def : ReadAdvance<ReadAfterVecLd, 5>;
86 def : ReadAdvance<ReadAfterVecXLd, 6>;
87 def : ReadAdvance<ReadAfterVecYLd, 7>;
89 def : ReadAdvance<ReadInt2Fpu, 0>;
91 // Many SchedWrites are defined in pairs with and without a folded load.
92 // Instructions with folded loads are usually micro-fused, so they only appear
93 // as two micro-ops when queued in the reservation station.
94 // This multiclass defines the resource usage for variants with and without
96 multiclass HWWriteResPair<X86FoldableSchedWrite SchedRW,
97 list<ProcResourceKind> ExePorts,
98 int Lat, list<int> Res = [1], int UOps = 1,
100 // Register variant is using a single cycle on ExePort.
101 def : WriteRes<SchedRW, ExePorts> {
103 let ResourceCycles = Res;
104 let NumMicroOps = UOps;
107 // Memory variant also uses a cycle on port 2/3 and adds LoadLat cycles to
108 // the latency (default = 5).
109 def : WriteRes<SchedRW.Folded, !listconcat([HWPort23], ExePorts)> {
110 let Latency = !add(Lat, LoadLat);
111 let ResourceCycles = !listconcat([1], Res);
112 let NumMicroOps = !add(UOps, 1);
116 // A folded store needs a cycle on port 4 for the store data, and an extra port
117 // 2/3/7 cycle to recompute the address.
118 def : WriteRes<WriteRMW, [HWPort237,HWPort4]>;
120 // Store_addr on 237.
122 defm : X86WriteRes<WriteStore, [HWPort237, HWPort4], 1, [1,1], 1>;
123 defm : X86WriteRes<WriteStoreNT, [HWPort237, HWPort4], 1, [1,1], 2>;
124 defm : X86WriteRes<WriteLoad, [HWPort23], 5, [1], 1>;
125 defm : X86WriteRes<WriteMove, [HWPort0156], 1, [1], 1>;
126 def : WriteRes<WriteZero, []>;
129 defm : HWWriteResPair<WriteALU, [HWPort0156], 1>;
130 defm : HWWriteResPair<WriteADC, [HWPort06, HWPort0156], 2, [1,1], 2>;
132 // Integer multiplication.
133 defm : HWWriteResPair<WriteIMul8, [HWPort1], 3>;
134 defm : HWWriteResPair<WriteIMul16, [HWPort1,HWPort06,HWPort0156], 4, [1,1,2], 4>;
135 defm : X86WriteRes<WriteIMul16Imm, [HWPort1,HWPort0156], 4, [1,1], 2>;
136 defm : X86WriteRes<WriteIMul16ImmLd, [HWPort1,HWPort0156,HWPort23], 8, [1,1,1], 3>;
137 defm : HWWriteResPair<WriteIMul16Reg, [HWPort1], 3>;
138 defm : HWWriteResPair<WriteIMul32, [HWPort1,HWPort06,HWPort0156], 4, [1,1,1], 3>;
139 defm : HWWriteResPair<WriteIMul32Imm, [HWPort1], 3>;
140 defm : HWWriteResPair<WriteIMul32Reg, [HWPort1], 3>;
141 defm : HWWriteResPair<WriteIMul64, [HWPort1,HWPort6], 4, [1,1], 2>;
142 defm : HWWriteResPair<WriteIMul64Imm, [HWPort1], 3>;
143 defm : HWWriteResPair<WriteIMul64Reg, [HWPort1], 3>;
144 def : WriteRes<WriteIMulH, []> { let Latency = 3; }
146 defm : X86WriteRes<WriteBSWAP32, [HWPort15], 1, [1], 1>;
147 defm : X86WriteRes<WriteBSWAP64, [HWPort06, HWPort15], 2, [1,1], 2>;
148 defm : X86WriteRes<WriteCMPXCHG,[HWPort06, HWPort0156], 5, [2,3], 5>;
149 defm : X86WriteRes<WriteCMPXCHGRMW,[HWPort23,HWPort06,HWPort0156,HWPort237,HWPort4], 9, [1,2,1,1,1], 6>;
150 defm : X86WriteRes<WriteXCHG, [HWPort0156], 2, [3], 3>;
152 // Integer shifts and rotates.
153 defm : HWWriteResPair<WriteShift, [HWPort06], 1>;
154 defm : HWWriteResPair<WriteShiftCL, [HWPort06, HWPort0156], 3, [2,1], 3>;
155 defm : HWWriteResPair<WriteRotate, [HWPort06], 2, [2], 2>;
156 defm : HWWriteResPair<WriteRotateCL, [HWPort06, HWPort0156], 3, [2,1], 3>;
159 defm : X86WriteRes<WriteSHDrri, [HWPort1], 3, [1], 1>;
160 defm : X86WriteRes<WriteSHDrrcl,[HWPort1, HWPort06, HWPort0156], 6, [1, 1, 2], 4>;
161 defm : X86WriteRes<WriteSHDmri, [HWPort1, HWPort23, HWPort237, HWPort0156], 10, [1, 1, 1, 1], 4>;
162 defm : X86WriteRes<WriteSHDmrcl,[HWPort1, HWPort23, HWPort237, HWPort06, HWPort0156], 12, [1, 1, 1, 1, 2], 6>;
164 defm : HWWriteResPair<WriteJump, [HWPort06], 1>;
165 defm : HWWriteResPair<WriteCRC32, [HWPort1], 3>;
167 defm : HWWriteResPair<WriteCMOV, [HWPort06,HWPort0156], 2, [1,1], 2>; // Conditional move.
168 defm : HWWriteResPair<WriteCMOV2, [HWPort06,HWPort0156], 3, [1,2], 3>; // Conditional (CF + ZF flag) move.
169 defm : X86WriteRes<WriteFCMOV, [HWPort1], 3, [1], 1>; // x87 conditional move.
170 def : WriteRes<WriteSETCC, [HWPort06]>; // Setcc.
171 def : WriteRes<WriteSETCCStore, [HWPort06,HWPort4,HWPort237]> {
176 defm : X86WriteRes<WriteLAHFSAHF, [HWPort06], 1, [1], 1>;
177 defm : X86WriteRes<WriteBitTest, [HWPort06], 1, [1], 1>;
178 defm : X86WriteRes<WriteBitTestImmLd, [HWPort06,HWPort23], 6, [1,1], 2>;
179 defm : X86WriteRes<WriteBitTestRegLd, [], 1, [], 10>;
180 defm : X86WriteRes<WriteBitTestSet, [HWPort06], 1, [1], 1>;
181 defm : X86WriteRes<WriteBitTestSetImmLd, [HWPort06,HWPort23], 6, [1,1], 3>;
182 //defm : X86WriteRes<WriteBitTestSetRegLd, [], 1, [], 11>;
184 // This is for simple LEAs with one or two input operands.
185 // The complex ones can only execute on port 1, and they require two cycles on
186 // the port to read all inputs. We don't model that.
187 def : WriteRes<WriteLEA, [HWPort15]>;
190 defm : HWWriteResPair<WriteBSF, [HWPort1], 3>;
191 defm : HWWriteResPair<WriteBSR, [HWPort1], 3>;
192 defm : HWWriteResPair<WriteLZCNT, [HWPort1], 3>;
193 defm : HWWriteResPair<WriteTZCNT, [HWPort1], 3>;
194 defm : HWWriteResPair<WritePOPCNT, [HWPort1], 3>;
196 // BMI1 BEXTR/BLS, BMI2 BZHI
197 defm : HWWriteResPair<WriteBEXTR, [HWPort06,HWPort15], 2, [1,1], 2>;
198 defm : HWWriteResPair<WriteBLS, [HWPort15], 1>;
199 defm : HWWriteResPair<WriteBZHI, [HWPort15], 1>;
201 // TODO: Why isn't the HWDivider used?
202 defm : X86WriteRes<WriteDiv8, [HWPort0,HWPort1,HWPort5,HWPort6], 22, [], 9>;
203 defm : X86WriteRes<WriteDiv16, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort01,HWPort0156], 98, [7,7,3,3,1,11], 32>;
204 defm : X86WriteRes<WriteDiv32, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort01,HWPort0156], 98, [7,7,3,3,1,11], 32>;
205 defm : X86WriteRes<WriteDiv64, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort01,HWPort0156], 98, [7,7,3,3,1,11], 32>;
206 defm : X86WriteRes<WriteDiv8Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
207 defm : X86WriteRes<WriteDiv16Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
208 defm : X86WriteRes<WriteDiv32Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
209 defm : X86WriteRes<WriteDiv64Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
211 defm : X86WriteRes<WriteIDiv8, [HWPort0,HWPort1,HWPort5,HWPort6], 23, [], 9>;
212 defm : X86WriteRes<WriteIDiv16, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort06,HWPort0156], 112, [4,2,4,8,14,34], 66>;
213 defm : X86WriteRes<WriteIDiv32, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort06,HWPort0156], 112, [4,2,4,8,14,34], 66>;
214 defm : X86WriteRes<WriteIDiv64, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort06,HWPort0156], 112, [4,2,4,8,14,34], 66>;
215 defm : X86WriteRes<WriteIDiv8Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
216 defm : X86WriteRes<WriteIDiv16Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
217 defm : X86WriteRes<WriteIDiv32Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
218 defm : X86WriteRes<WriteIDiv64Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
220 // Scalar and vector floating point.
221 defm : X86WriteRes<WriteFLD0, [HWPort01], 1, [1], 1>;
222 defm : X86WriteRes<WriteFLD1, [HWPort01], 1, [2], 2>;
223 defm : X86WriteRes<WriteFLDC, [HWPort01], 1, [2], 2>;
224 defm : X86WriteRes<WriteFLoad, [HWPort23], 5, [1], 1>;
225 defm : X86WriteRes<WriteFLoadX, [HWPort23], 6, [1], 1>;
226 defm : X86WriteRes<WriteFLoadY, [HWPort23], 7, [1], 1>;
227 defm : X86WriteRes<WriteFMaskedLoad, [HWPort23,HWPort5], 8, [1,2], 3>;
228 defm : X86WriteRes<WriteFMaskedLoadY, [HWPort23,HWPort5], 9, [1,2], 3>;
229 defm : X86WriteRes<WriteFStore, [HWPort237,HWPort4], 1, [1,1], 2>;
230 defm : X86WriteRes<WriteFStoreX, [HWPort237,HWPort4], 1, [1,1], 2>;
231 defm : X86WriteRes<WriteFStoreY, [HWPort237,HWPort4], 1, [1,1], 2>;
232 defm : X86WriteRes<WriteFStoreNT, [HWPort237,HWPort4], 1, [1,1], 2>;
233 defm : X86WriteRes<WriteFStoreNTX, [HWPort237,HWPort4], 1, [1,1], 2>;
234 defm : X86WriteRes<WriteFStoreNTY, [HWPort237,HWPort4], 1, [1,1], 2>;
235 defm : X86WriteRes<WriteFMaskedStore, [HWPort0,HWPort4,HWPort237,HWPort15], 5, [1,1,1,1], 4>;
236 defm : X86WriteRes<WriteFMaskedStoreY, [HWPort0,HWPort4,HWPort237,HWPort15], 5, [1,1,1,1], 4>;
237 defm : X86WriteRes<WriteFMove, [HWPort5], 1, [1], 1>;
238 defm : X86WriteRes<WriteFMoveX, [HWPort5], 1, [1], 1>;
239 defm : X86WriteRes<WriteFMoveY, [HWPort5], 1, [1], 1>;
240 defm : X86WriteRes<WriteEMMS, [HWPort01,HWPort15,HWPort015,HWPort0156], 31, [8,1,21,1], 31>;
242 defm : HWWriteResPair<WriteFAdd, [HWPort1], 3, [1], 1, 5>;
243 defm : HWWriteResPair<WriteFAddX, [HWPort1], 3, [1], 1, 6>;
244 defm : HWWriteResPair<WriteFAddY, [HWPort1], 3, [1], 1, 7>;
245 defm : HWWriteResPair<WriteFAddZ, [HWPort1], 3, [1], 1, 7>; // Unsupported = 1
246 defm : HWWriteResPair<WriteFAdd64, [HWPort1], 3, [1], 1, 5>;
247 defm : HWWriteResPair<WriteFAdd64X, [HWPort1], 3, [1], 1, 6>;
248 defm : HWWriteResPair<WriteFAdd64Y, [HWPort1], 3, [1], 1, 7>;
249 defm : HWWriteResPair<WriteFAdd64Z, [HWPort1], 3, [1], 1, 7>; // Unsupported = 1
251 defm : HWWriteResPair<WriteFCmp, [HWPort1], 3, [1], 1, 5>;
252 defm : HWWriteResPair<WriteFCmpX, [HWPort1], 3, [1], 1, 6>;
253 defm : HWWriteResPair<WriteFCmpY, [HWPort1], 3, [1], 1, 7>;
254 defm : HWWriteResPair<WriteFCmpZ, [HWPort1], 3, [1], 1, 7>; // Unsupported = 1
255 defm : HWWriteResPair<WriteFCmp64, [HWPort1], 3, [1], 1, 5>;
256 defm : HWWriteResPair<WriteFCmp64X, [HWPort1], 3, [1], 1, 6>;
257 defm : HWWriteResPair<WriteFCmp64Y, [HWPort1], 3, [1], 1, 7>;
258 defm : HWWriteResPair<WriteFCmp64Z, [HWPort1], 3, [1], 1, 7>; // Unsupported = 1
260 defm : HWWriteResPair<WriteFCom, [HWPort1], 3>;
262 defm : HWWriteResPair<WriteFMul, [HWPort01], 5, [1], 1, 5>;
263 defm : HWWriteResPair<WriteFMulX, [HWPort01], 5, [1], 1, 6>;
264 defm : HWWriteResPair<WriteFMulY, [HWPort01], 5, [1], 1, 7>;
265 defm : HWWriteResPair<WriteFMulZ, [HWPort01], 5, [1], 1, 7>; // Unsupported = 1
266 defm : HWWriteResPair<WriteFMul64, [HWPort01], 5, [1], 1, 5>;
267 defm : HWWriteResPair<WriteFMul64X, [HWPort01], 5, [1], 1, 6>;
268 defm : HWWriteResPair<WriteFMul64Y, [HWPort01], 5, [1], 1, 7>;
269 defm : HWWriteResPair<WriteFMul64Z, [HWPort01], 5, [1], 1, 7>; // Unsupported = 1
271 defm : HWWriteResPair<WriteFDiv, [HWPort0,HWFPDivider], 13, [1,7], 1, 5>;
272 defm : HWWriteResPair<WriteFDivX, [HWPort0,HWFPDivider], 13, [1,7], 1, 6>;
273 defm : HWWriteResPair<WriteFDivY, [HWPort0,HWPort15,HWFPDivider], 21, [2,1,14], 3, 7>;
274 defm : HWWriteResPair<WriteFDivZ, [HWPort0,HWPort15,HWFPDivider], 21, [2,1,14], 3, 7>; // Unsupported = 1
275 defm : HWWriteResPair<WriteFDiv64, [HWPort0,HWFPDivider], 20, [1,14], 1, 5>;
276 defm : HWWriteResPair<WriteFDiv64X, [HWPort0,HWFPDivider], 20, [1,14], 1, 6>;
277 defm : HWWriteResPair<WriteFDiv64Y, [HWPort0,HWPort15,HWFPDivider], 35, [2,1,28], 3, 7>;
278 defm : HWWriteResPair<WriteFDiv64Z, [HWPort0,HWPort15,HWFPDivider], 35, [2,1,28], 3, 7>; // Unsupported = 1
280 defm : HWWriteResPair<WriteFRcp, [HWPort0], 5, [1], 1, 5>;
281 defm : HWWriteResPair<WriteFRcpX, [HWPort0], 5, [1], 1, 6>;
282 defm : HWWriteResPair<WriteFRcpY, [HWPort0,HWPort015], 11, [2,1], 3, 7>;
283 defm : HWWriteResPair<WriteFRcpZ, [HWPort0,HWPort015], 11, [2,1], 3, 7>; // Unsupported = 1
285 defm : HWWriteResPair<WriteFRsqrt, [HWPort0], 5, [1], 1, 5>;
286 defm : HWWriteResPair<WriteFRsqrtX,[HWPort0], 5, [1], 1, 6>;
287 defm : HWWriteResPair<WriteFRsqrtY,[HWPort0,HWPort015], 11, [2,1], 3, 7>;
288 defm : HWWriteResPair<WriteFRsqrtZ,[HWPort0,HWPort015], 11, [2,1], 3, 7>; // Unsupported = 1
290 defm : HWWriteResPair<WriteFSqrt, [HWPort0,HWFPDivider], 11, [1,7], 1, 5>;
291 defm : HWWriteResPair<WriteFSqrtX, [HWPort0,HWFPDivider], 11, [1,7], 1, 6>;
292 defm : HWWriteResPair<WriteFSqrtY, [HWPort0,HWPort15,HWFPDivider], 21, [2,1,14], 3, 7>;
293 defm : HWWriteResPair<WriteFSqrtZ, [HWPort0,HWPort15,HWFPDivider], 21, [2,1,14], 3, 7>; // Unsupported = 1
294 defm : HWWriteResPair<WriteFSqrt64, [HWPort0,HWFPDivider], 16, [1,14], 1, 5>;
295 defm : HWWriteResPair<WriteFSqrt64X, [HWPort0,HWFPDivider], 16, [1,14], 1, 6>;
296 defm : HWWriteResPair<WriteFSqrt64Y, [HWPort0,HWPort15,HWFPDivider], 35, [2,1,28], 3, 7>;
297 defm : HWWriteResPair<WriteFSqrt64Z, [HWPort0,HWPort15,HWFPDivider], 35, [2,1,28], 3, 7>; // Unsupported = 1
298 defm : HWWriteResPair<WriteFSqrt80, [HWPort0,HWFPDivider], 23, [1,17]>;
300 defm : HWWriteResPair<WriteFMA, [HWPort01], 5, [1], 1, 5>;
301 defm : HWWriteResPair<WriteFMAX, [HWPort01], 5, [1], 1, 6>;
302 defm : HWWriteResPair<WriteFMAY, [HWPort01], 5, [1], 1, 7>;
303 defm : HWWriteResPair<WriteFMAZ, [HWPort01], 5, [1], 1, 7>; // Unsupported = 1
304 defm : HWWriteResPair<WriteDPPD, [HWPort0,HWPort1,HWPort5], 9, [1,1,1], 3, 6>;
305 defm : HWWriteResPair<WriteDPPS, [HWPort0,HWPort1,HWPort5], 14, [2,1,1], 4, 6>;
306 defm : HWWriteResPair<WriteDPPSY, [HWPort0,HWPort1,HWPort5], 14, [2,1,1], 4, 7>;
307 defm : HWWriteResPair<WriteDPPSZ, [HWPort0,HWPort1,HWPort5], 14, [2,1,1], 4, 7>; // Unsupported = 1
308 defm : HWWriteResPair<WriteFSign, [HWPort0], 1>;
309 defm : X86WriteRes<WriteFRnd, [HWPort23], 6, [1], 1>;
310 defm : X86WriteRes<WriteFRndY, [HWPort23], 6, [1], 1>;
311 defm : X86WriteRes<WriteFRndZ, [HWPort23], 6, [1], 1>; // Unsupported = 1
312 defm : X86WriteRes<WriteFRndLd, [HWPort1,HWPort23], 12, [2,1], 3>;
313 defm : X86WriteRes<WriteFRndYLd, [HWPort1,HWPort23], 13, [2,1], 3>;
314 defm : X86WriteRes<WriteFRndZLd, [HWPort1,HWPort23], 13, [2,1], 3>; // Unsupported = 1
315 defm : HWWriteResPair<WriteFLogic, [HWPort5], 1, [1], 1, 6>;
316 defm : HWWriteResPair<WriteFLogicY, [HWPort5], 1, [1], 1, 7>;
317 defm : HWWriteResPair<WriteFLogicZ, [HWPort5], 1, [1], 1, 7>; // Unsupported = 1
318 defm : HWWriteResPair<WriteFTest, [HWPort0], 1, [1], 1, 6>;
319 defm : HWWriteResPair<WriteFTestY, [HWPort0], 1, [1], 1, 7>;
320 defm : HWWriteResPair<WriteFTestZ, [HWPort0], 1, [1], 1, 7>; // Unsupported = 1
321 defm : HWWriteResPair<WriteFShuffle, [HWPort5], 1, [1], 1, 6>;
322 defm : HWWriteResPair<WriteFShuffleY, [HWPort5], 1, [1], 1, 7>;
323 defm : HWWriteResPair<WriteFShuffleZ, [HWPort5], 1, [1], 1, 7>; // Unsupported = 1
324 defm : HWWriteResPair<WriteFVarShuffle, [HWPort5], 1, [1], 1, 6>;
325 defm : HWWriteResPair<WriteFVarShuffleY, [HWPort5], 1, [1], 1, 7>;
326 defm : HWWriteResPair<WriteFVarShuffleZ, [HWPort5], 1, [1], 1, 7>; // Unsupported = 1
327 defm : HWWriteResPair<WriteFBlend, [HWPort015], 1, [1], 1, 6>;
328 defm : HWWriteResPair<WriteFBlendY, [HWPort015], 1, [1], 1, 7>;
329 defm : HWWriteResPair<WriteFBlendZ, [HWPort015], 1, [1], 1, 7>; // Unsupported = 1
330 defm : HWWriteResPair<WriteFShuffle256, [HWPort5], 3, [1], 1, 7>;
331 defm : HWWriteResPair<WriteFVarShuffle256, [HWPort5], 3, [1], 1, 7>;
332 defm : HWWriteResPair<WriteFVarBlend, [HWPort5], 2, [2], 2, 6>;
333 defm : HWWriteResPair<WriteFVarBlendY, [HWPort5], 2, [2], 2, 7>;
334 defm : HWWriteResPair<WriteFVarBlendZ, [HWPort5], 2, [2], 2, 7>; // Unsupported = 1
336 // Conversion between integer and float.
337 defm : HWWriteResPair<WriteCvtSD2I, [HWPort1], 3>;
338 defm : HWWriteResPair<WriteCvtPD2I, [HWPort1], 3>;
339 defm : HWWriteResPair<WriteCvtPD2IY, [HWPort1], 3>;
340 defm : HWWriteResPair<WriteCvtPD2IZ, [HWPort1], 3>; // Unsupported = 1
341 defm : HWWriteResPair<WriteCvtSS2I, [HWPort1], 3>;
342 defm : HWWriteResPair<WriteCvtPS2I, [HWPort1], 3>;
343 defm : HWWriteResPair<WriteCvtPS2IY, [HWPort1], 3>;
344 defm : HWWriteResPair<WriteCvtPS2IZ, [HWPort1], 3>; // Unsupported = 1
346 defm : HWWriteResPair<WriteCvtI2SD, [HWPort1], 4>;
347 defm : HWWriteResPair<WriteCvtI2PD, [HWPort1], 4>;
348 defm : HWWriteResPair<WriteCvtI2PDY, [HWPort1], 4>;
349 defm : HWWriteResPair<WriteCvtI2PDZ, [HWPort1], 4>; // Unsupported = 1
350 defm : HWWriteResPair<WriteCvtI2SS, [HWPort1], 4>;
351 defm : HWWriteResPair<WriteCvtI2PS, [HWPort1], 4>;
352 defm : HWWriteResPair<WriteCvtI2PSY, [HWPort1], 4>;
353 defm : HWWriteResPair<WriteCvtI2PSZ, [HWPort1], 4>; // Unsupported = 1
355 defm : HWWriteResPair<WriteCvtSS2SD, [HWPort1], 3>;
356 defm : HWWriteResPair<WriteCvtPS2PD, [HWPort1], 3>;
357 defm : HWWriteResPair<WriteCvtPS2PDY, [HWPort1], 3>;
358 defm : HWWriteResPair<WriteCvtPS2PDZ, [HWPort1], 3>; // Unsupported = 1
359 defm : HWWriteResPair<WriteCvtSD2SS, [HWPort1], 3>;
360 defm : HWWriteResPair<WriteCvtPD2PS, [HWPort1], 3>;
361 defm : HWWriteResPair<WriteCvtPD2PSY, [HWPort1], 3>;
362 defm : HWWriteResPair<WriteCvtPD2PSZ, [HWPort1], 3>; // Unsupported = 1
364 defm : X86WriteRes<WriteCvtPH2PS, [HWPort0,HWPort5], 2, [1,1], 2>;
365 defm : X86WriteRes<WriteCvtPH2PSY, [HWPort0,HWPort5], 2, [1,1], 2>;
366 defm : X86WriteRes<WriteCvtPH2PSZ, [HWPort0,HWPort5], 2, [1,1], 2>; // Unsupported = 1
367 defm : X86WriteRes<WriteCvtPH2PSLd, [HWPort0,HWPort23], 6, [1,1], 2>;
368 defm : X86WriteRes<WriteCvtPH2PSYLd, [HWPort0,HWPort23], 7, [1,1], 2>;
369 defm : X86WriteRes<WriteCvtPH2PSZLd, [HWPort0,HWPort23], 7, [1,1], 2>; // Unsupported = 1
371 defm : X86WriteRes<WriteCvtPS2PH, [HWPort1,HWPort5], 4, [1,1], 2>;
372 defm : X86WriteRes<WriteCvtPS2PHY, [HWPort1,HWPort5], 6, [1,1], 2>;
373 defm : X86WriteRes<WriteCvtPS2PHZ, [HWPort1,HWPort5], 6, [1,1], 2>; // Unsupported = 1
374 defm : X86WriteRes<WriteCvtPS2PHSt, [HWPort1,HWPort4,HWPort5,HWPort237], 5, [1,1,1,1], 4>;
375 defm : X86WriteRes<WriteCvtPS2PHYSt, [HWPort1,HWPort4,HWPort5,HWPort237], 7, [1,1,1,1], 4>;
376 defm : X86WriteRes<WriteCvtPS2PHZSt, [HWPort1,HWPort4,HWPort5,HWPort237], 7, [1,1,1,1], 4>; // Unsupported = 1
378 // Vector integer operations.
379 defm : X86WriteRes<WriteVecLoad, [HWPort23], 5, [1], 1>;
380 defm : X86WriteRes<WriteVecLoadX, [HWPort23], 6, [1], 1>;
381 defm : X86WriteRes<WriteVecLoadY, [HWPort23], 7, [1], 1>;
382 defm : X86WriteRes<WriteVecLoadNT, [HWPort23], 6, [1], 1>;
383 defm : X86WriteRes<WriteVecLoadNTY, [HWPort23], 7, [1], 1>;
384 defm : X86WriteRes<WriteVecMaskedLoad, [HWPort23,HWPort5], 8, [1,2], 3>;
385 defm : X86WriteRes<WriteVecMaskedLoadY, [HWPort23,HWPort5], 9, [1,2], 3>;
386 defm : X86WriteRes<WriteVecStore, [HWPort237,HWPort4], 1, [1,1], 2>;
387 defm : X86WriteRes<WriteVecStoreX, [HWPort237,HWPort4], 1, [1,1], 2>;
388 defm : X86WriteRes<WriteVecStoreY, [HWPort237,HWPort4], 1, [1,1], 2>;
389 defm : X86WriteRes<WriteVecStoreNT, [HWPort237,HWPort4], 1, [1,1], 2>;
390 defm : X86WriteRes<WriteVecStoreNTY, [HWPort237,HWPort4], 1, [1,1], 2>;
391 defm : X86WriteRes<WriteVecMaskedStore, [HWPort0,HWPort4,HWPort237,HWPort15], 5, [1,1,1,1], 4>;
392 defm : X86WriteRes<WriteVecMaskedStoreY, [HWPort0,HWPort4,HWPort237,HWPort15], 5, [1,1,1,1], 4>;
393 defm : X86WriteRes<WriteVecMove, [HWPort015], 1, [1], 1>;
394 defm : X86WriteRes<WriteVecMoveX, [HWPort015], 1, [1], 1>;
395 defm : X86WriteRes<WriteVecMoveY, [HWPort015], 1, [1], 1>;
396 defm : X86WriteRes<WriteVecMoveToGpr, [HWPort0], 1, [1], 1>;
397 defm : X86WriteRes<WriteVecMoveFromGpr, [HWPort5], 1, [1], 1>;
399 defm : HWWriteResPair<WriteVecLogic, [HWPort015], 1, [1], 1, 5>;
400 defm : HWWriteResPair<WriteVecLogicX,[HWPort015], 1, [1], 1, 6>;
401 defm : HWWriteResPair<WriteVecLogicY,[HWPort015], 1, [1], 1, 7>;
402 defm : HWWriteResPair<WriteVecLogicZ,[HWPort015], 1, [1], 1, 7>; // Unsupported = 1
403 defm : HWWriteResPair<WriteVecTest, [HWPort0,HWPort5], 2, [1,1], 2, 6>;
404 defm : HWWriteResPair<WriteVecTestY, [HWPort0,HWPort5], 4, [1,1], 2, 7>;
405 defm : HWWriteResPair<WriteVecTestZ, [HWPort0,HWPort5], 4, [1,1], 2, 7>; // Unsupported = 1
406 defm : HWWriteResPair<WriteVecALU, [HWPort15], 1, [1], 1, 5>;
407 defm : HWWriteResPair<WriteVecALUX, [HWPort15], 1, [1], 1, 6>;
408 defm : HWWriteResPair<WriteVecALUY, [HWPort15], 1, [1], 1, 7>;
409 defm : HWWriteResPair<WriteVecALUZ, [HWPort15], 1, [1], 1, 7>; // Unsupported = 1
410 defm : HWWriteResPair<WriteVecIMul, [HWPort0], 5, [1], 1, 5>;
411 defm : HWWriteResPair<WriteVecIMulX, [HWPort0], 5, [1], 1, 6>;
412 defm : HWWriteResPair<WriteVecIMulY, [HWPort0], 5, [1], 1, 7>;
413 defm : HWWriteResPair<WriteVecIMulZ, [HWPort0], 5, [1], 1, 7>; // Unsupported = 1
414 defm : HWWriteResPair<WritePMULLD, [HWPort0], 10, [2], 2, 6>;
415 defm : HWWriteResPair<WritePMULLDY, [HWPort0], 10, [2], 2, 7>;
416 defm : HWWriteResPair<WritePMULLDZ, [HWPort0], 10, [2], 2, 7>; // Unsupported = 1
417 defm : HWWriteResPair<WriteShuffle, [HWPort5], 1, [1], 1, 5>;
418 defm : HWWriteResPair<WriteShuffleX, [HWPort5], 1, [1], 1, 6>;
419 defm : HWWriteResPair<WriteShuffleY, [HWPort5], 1, [1], 1, 7>;
420 defm : HWWriteResPair<WriteShuffleZ, [HWPort5], 1, [1], 1, 7>; // Unsupported = 1
421 defm : HWWriteResPair<WriteVarShuffle, [HWPort5], 1, [1], 1, 5>;
422 defm : HWWriteResPair<WriteVarShuffleX,[HWPort5], 1, [1], 1, 6>;
423 defm : HWWriteResPair<WriteVarShuffleY,[HWPort5], 1, [1], 1, 7>;
424 defm : HWWriteResPair<WriteVarShuffleZ,[HWPort5], 1, [1], 1, 7>; // Unsupported = 1
425 defm : HWWriteResPair<WriteBlend, [HWPort5], 1, [1], 1, 6>;
426 defm : HWWriteResPair<WriteBlendY, [HWPort5], 1, [1], 1, 7>;
427 defm : HWWriteResPair<WriteBlendZ, [HWPort5], 1, [1], 1, 7>; // Unsupported = 1
428 defm : HWWriteResPair<WriteShuffle256, [HWPort5], 3, [1], 1, 7>;
429 defm : HWWriteResPair<WriteVarShuffle256, [HWPort5], 3, [1], 1, 7>;
430 defm : HWWriteResPair<WriteVarBlend, [HWPort5], 2, [2], 2, 6>;
431 defm : HWWriteResPair<WriteVarBlendY, [HWPort5], 2, [2], 2, 7>;
432 defm : HWWriteResPair<WriteVarBlendZ, [HWPort5], 2, [2], 2, 7>; // Unsupported = 1
433 defm : HWWriteResPair<WriteMPSAD, [HWPort0, HWPort5], 7, [1, 2], 3, 6>;
434 defm : HWWriteResPair<WriteMPSADY, [HWPort0, HWPort5], 7, [1, 2], 3, 7>;
435 defm : HWWriteResPair<WriteMPSADZ, [HWPort0, HWPort5], 7, [1, 2], 3, 7>; // Unsupported = 1
436 defm : HWWriteResPair<WritePSADBW, [HWPort0], 5, [1], 1, 5>;
437 defm : HWWriteResPair<WritePSADBWX, [HWPort0], 5, [1], 1, 6>;
438 defm : HWWriteResPair<WritePSADBWY, [HWPort0], 5, [1], 1, 7>;
439 defm : HWWriteResPair<WritePSADBWZ, [HWPort0], 5, [1], 1, 7>; // Unsupported = 1
440 defm : HWWriteResPair<WritePHMINPOS, [HWPort0], 5, [1], 1, 6>;
442 // Vector integer shifts.
443 defm : HWWriteResPair<WriteVecShift, [HWPort0], 1, [1], 1, 5>;
444 defm : HWWriteResPair<WriteVecShiftX, [HWPort0,HWPort5], 2, [1,1], 2, 6>;
445 defm : X86WriteRes<WriteVecShiftY, [HWPort0,HWPort5], 4, [1,1], 2>;
446 defm : X86WriteRes<WriteVecShiftZ, [HWPort0,HWPort5], 4, [1,1], 2>; // Unsupported = 1
447 defm : X86WriteRes<WriteVecShiftYLd, [HWPort0,HWPort23], 8, [1,1], 2>;
448 defm : X86WriteRes<WriteVecShiftZLd, [HWPort0,HWPort23], 8, [1,1], 2>; // Unsupported = 1
450 defm : HWWriteResPair<WriteVecShiftImm, [HWPort0], 1, [1], 1, 5>;
451 defm : HWWriteResPair<WriteVecShiftImmX, [HWPort0], 1, [1], 1, 6>;
452 defm : HWWriteResPair<WriteVecShiftImmY, [HWPort0], 1, [1], 1, 7>;
453 defm : HWWriteResPair<WriteVecShiftImmZ, [HWPort0], 1, [1], 1, 7>; // Unsupported = 1
454 defm : HWWriteResPair<WriteVarVecShift, [HWPort0, HWPort5], 3, [2,1], 3, 6>;
455 defm : HWWriteResPair<WriteVarVecShiftY, [HWPort0, HWPort5], 3, [2,1], 3, 7>;
456 defm : HWWriteResPair<WriteVarVecShiftZ, [HWPort0, HWPort5], 3, [2,1], 3, 7>; // Unsupported = 1
458 // Vector insert/extract operations.
459 def : WriteRes<WriteVecInsert, [HWPort5]> {
462 let ResourceCycles = [2];
464 def : WriteRes<WriteVecInsertLd, [HWPort5,HWPort23]> {
468 def: InstRW<[WriteVecInsertLd], (instregex "(V?)MOV(H|L)(PD|PS)rm")>;
470 def : WriteRes<WriteVecExtract, [HWPort0,HWPort5]> {
474 def : WriteRes<WriteVecExtractSt, [HWPort4,HWPort5,HWPort237]> {
479 // String instructions.
481 // Packed Compare Implicit Length Strings, Return Mask
482 def : WriteRes<WritePCmpIStrM, [HWPort0]> {
485 let ResourceCycles = [3];
487 def : WriteRes<WritePCmpIStrMLd, [HWPort0, HWPort23]> {
490 let ResourceCycles = [3,1];
493 // Packed Compare Explicit Length Strings, Return Mask
494 def : WriteRes<WritePCmpEStrM, [HWPort0, HWPort5, HWPort015, HWPort0156]> {
497 let ResourceCycles = [4,3,1,1];
499 def : WriteRes<WritePCmpEStrMLd, [HWPort0, HWPort5, HWPort23, HWPort015, HWPort0156]> {
501 let NumMicroOps = 10;
502 let ResourceCycles = [4,3,1,1,1];
505 // Packed Compare Implicit Length Strings, Return Index
506 def : WriteRes<WritePCmpIStrI, [HWPort0]> {
509 let ResourceCycles = [3];
511 def : WriteRes<WritePCmpIStrILd, [HWPort0, HWPort23]> {
514 let ResourceCycles = [3,1];
517 // Packed Compare Explicit Length Strings, Return Index
518 def : WriteRes<WritePCmpEStrI, [HWPort0, HWPort5, HWPort0156]> {
521 let ResourceCycles = [4,3,1];
523 def : WriteRes<WritePCmpEStrILd, [HWPort0, HWPort5, HWPort23, HWPort0156]> {
526 let ResourceCycles = [4,3,1,1];
529 // MOVMSK Instructions.
530 def : WriteRes<WriteFMOVMSK, [HWPort0]> { let Latency = 3; }
531 def : WriteRes<WriteVecMOVMSK, [HWPort0]> { let Latency = 3; }
532 def : WriteRes<WriteVecMOVMSKY, [HWPort0]> { let Latency = 3; }
533 def : WriteRes<WriteMMXMOVMSK, [HWPort0]> { let Latency = 1; }
536 def : WriteRes<WriteAESDecEnc, [HWPort5]> {
539 let ResourceCycles = [1];
541 def : WriteRes<WriteAESDecEncLd, [HWPort5, HWPort23]> {
544 let ResourceCycles = [1,1];
547 def : WriteRes<WriteAESIMC, [HWPort5]> {
550 let ResourceCycles = [2];
552 def : WriteRes<WriteAESIMCLd, [HWPort5, HWPort23]> {
555 let ResourceCycles = [2,1];
558 def : WriteRes<WriteAESKeyGen, [HWPort0,HWPort5,HWPort015]> {
560 let NumMicroOps = 11;
561 let ResourceCycles = [2,7,2];
563 def : WriteRes<WriteAESKeyGenLd, [HWPort0,HWPort5,HWPort23,HWPort015]> {
565 let NumMicroOps = 11;
566 let ResourceCycles = [2,7,1,1];
569 // Carry-less multiplication instructions.
570 def : WriteRes<WriteCLMul, [HWPort0, HWPort5]> {
573 let ResourceCycles = [2,1];
575 def : WriteRes<WriteCLMulLd, [HWPort0, HWPort5, HWPort23]> {
578 let ResourceCycles = [2,1,1];
582 def : WriteRes<WriteLDMXCSR, [HWPort0,HWPort23,HWPort0156]> { let Latency = 7; let NumMicroOps = 3; let ResourceCycles = [1,1,1]; }
583 def : WriteRes<WriteSTMXCSR, [HWPort4,HWPort5,HWPort237]> { let Latency = 2; let NumMicroOps = 3; let ResourceCycles = [1,1,1]; }
585 def : WriteRes<WriteSystem, [HWPort0156]> { let Latency = 100; }
586 def : WriteRes<WriteMicrocoded, [HWPort0156]> { let Latency = 100; }
587 def : WriteRes<WriteFence, [HWPort23, HWPort4]>;
588 def : WriteRes<WriteNop, []>;
590 //================ Exceptions ================//
592 //-- Specific Scheduling Models --//
595 def HWWriteP0 : SchedWriteRes<[HWPort0]>;
597 def HWWriteP01 : SchedWriteRes<[HWPort01]>;
599 def HWWrite2P01 : SchedWriteRes<[HWPort01]> {
602 def HWWrite3P01 : SchedWriteRes<[HWPort01]> {
606 def HWWriteP0156_P23 : SchedWriteRes<[HWPort0156, HWPort23]> {
610 def HWWrite2P0156_P23 : SchedWriteRes<[HWPort0156, HWPort23]> {
612 let ResourceCycles = [2, 1];
616 def HWWriteP1 : SchedWriteRes<[HWPort1]>;
619 def HWWrite2P1 : SchedWriteRes<[HWPort1]> {
621 let ResourceCycles = [2];
626 // - mm: 64 bit mmx register.
627 // - x = 128 bit xmm register.
628 // - (x)mm = mmx or xmm register.
629 // - y = 256 bit ymm register.
630 // - v = any vector register.
633 //=== Integer Instructions ===//
634 //-- Move instructions --//
637 def HWWriteXLAT : SchedWriteRes<[]> {
641 def : InstRW<[HWWriteXLAT], (instrs XLAT)>;
644 def HWWritePushA : SchedWriteRes<[]> {
645 let NumMicroOps = 19;
647 def : InstRW<[HWWritePushA], (instregex "PUSHA(16|32)")>;
650 def HWWritePopA : SchedWriteRes<[]> {
651 let NumMicroOps = 18;
653 def : InstRW<[HWWritePopA], (instregex "POPA(16|32)")>;
655 //-- Arithmetic instructions --//
659 def HWWriteBTRSCmr : SchedWriteRes<[]> {
660 let NumMicroOps = 11;
662 def : SchedAlias<WriteBitTestSetRegRMW, HWWriteBTRSCmr>;
664 //-- Control transfer instructions --//
668 def HWWriteRETI : SchedWriteRes<[HWPort23, HWPort6, HWPort015]> {
670 let ResourceCycles = [1, 2, 1];
672 def : InstRW<[HWWriteRETI], (instregex "RETI(L|Q|W)", "LRETI(L|Q|W)")>;
676 def HWWriteBOUND : SchedWriteRes<[]> {
677 let NumMicroOps = 15;
679 def : InstRW<[HWWriteBOUND], (instregex "BOUNDS(16|32)rm")>;
682 def HWWriteINTO : SchedWriteRes<[]> {
685 def : InstRW<[HWWriteINTO], (instrs INTO)>;
687 //-- String instructions --//
690 def : InstRW<[HWWrite2P0156_P23], (instregex "LODS(B|W)")>;
693 def : InstRW<[HWWriteP0156_P23], (instregex "LODS(L|Q)")>;
696 def HWWriteMOVS : SchedWriteRes<[HWPort23, HWPort4, HWPort0156]> {
699 let ResourceCycles = [2, 1, 2];
701 def : InstRW<[HWWriteMOVS], (instrs MOVSB, MOVSL, MOVSQ, MOVSW)>;
704 def HWWriteCMPS : SchedWriteRes<[HWPort23, HWPort0156]> {
707 let ResourceCycles = [2, 3];
709 def : InstRW<[HWWriteCMPS], (instregex "CMPS(B|L|Q|W)")>;
714 def HWWriteRDPMC : SchedWriteRes<[]> {
715 let NumMicroOps = 34;
717 def : InstRW<[HWWriteRDPMC], (instrs RDPMC)>;
720 def HWWriteRDRAND : SchedWriteRes<[HWPort23, HWPort015]> {
721 let NumMicroOps = 17;
722 let ResourceCycles = [1, 16];
724 def : InstRW<[HWWriteRDRAND], (instrs RDRAND16r, RDRAND32r, RDRAND64r)>;
726 //=== Floating Point x87 Instructions ===//
727 //-- Move instructions --//
731 def : InstRW<[HWWriteP01], (instrs LD_Frr)>;
735 def HWWriteFBLD : SchedWriteRes<[]> {
737 let NumMicroOps = 43;
739 def : InstRW<[HWWriteFBLD], (instrs FBLDm)>;
743 def : InstRW<[HWWriteP01], (instregex "ST_(F|FP)rr")>;
746 def : InstRW<[HWWriteP01], (instregex "FFREE")>;
749 def HWWriteFNSAVE : SchedWriteRes<[]> {
750 let NumMicroOps = 147;
752 def : InstRW<[HWWriteFNSAVE], (instrs FSAVEm)>;
755 def HWWriteFRSTOR : SchedWriteRes<[]> {
756 let NumMicroOps = 90;
758 def : InstRW<[HWWriteFRSTOR], (instrs FRSTORm)>;
760 //-- Arithmetic instructions --//
764 def : InstRW<[HWWrite2P01], (instrs FCOMPP, UCOM_FPPr)>;
766 // FCOMI(P) FUCOMI(P).
768 def : InstRW<[HWWrite3P01], (instrs COM_FIPr, COM_FIr, UCOM_FIPr, UCOM_FIr)>;
771 def : InstRW<[HWWriteP1], (instregex "TST_F")>;
774 def : InstRW<[HWWrite2P1], (instrs FXAM)>;
777 def HWWriteFPREM : SchedWriteRes<[]> {
779 let NumMicroOps = 28;
781 def : InstRW<[HWWriteFPREM], (instrs FPREM)>;
784 def HWWriteFPREM1 : SchedWriteRes<[]> {
786 let NumMicroOps = 41;
788 def : InstRW<[HWWriteFPREM1], (instrs FPREM1)>;
791 def HWWriteFRNDINT : SchedWriteRes<[]> {
793 let NumMicroOps = 17;
795 def : InstRW<[HWWriteFRNDINT], (instrs FRNDINT)>;
797 //-- Math instructions --//
800 def HWWriteFSCALE : SchedWriteRes<[]> {
801 let Latency = 75; // 49-125
802 let NumMicroOps = 50; // 25-75
804 def : InstRW<[HWWriteFSCALE], (instrs FSCALE)>;
807 def HWWriteFXTRACT : SchedWriteRes<[]> {
809 let NumMicroOps = 17;
811 def : InstRW<[HWWriteFXTRACT], (instrs FXTRACT)>;
813 ////////////////////////////////////////////////////////////////////////////////
814 // Horizontal add/sub instructions.
815 ////////////////////////////////////////////////////////////////////////////////
817 defm : HWWriteResPair<WriteFHAdd, [HWPort1, HWPort5], 5, [1,2], 3, 6>;
818 defm : HWWriteResPair<WriteFHAddY, [HWPort1, HWPort5], 5, [1,2], 3, 7>;
819 defm : HWWriteResPair<WritePHAdd, [HWPort5, HWPort15], 3, [2,1], 3, 5>;
820 defm : HWWriteResPair<WritePHAddX, [HWPort5, HWPort15], 3, [2,1], 3, 6>;
821 defm : HWWriteResPair<WritePHAddY, [HWPort5, HWPort15], 3, [2,1], 3, 7>;
823 //=== Floating Point XMM and YMM Instructions ===//
827 def HWWriteResGroup0 : SchedWriteRes<[HWPort23]> {
830 let ResourceCycles = [1];
832 def: InstRW<[HWWriteResGroup0], (instrs VBROADCASTSSrm)>;
833 def: InstRW<[HWWriteResGroup0], (instregex "(V?)MOVSHDUPrm",
835 "VPBROADCAST(D|Q)rm")>;
837 def HWWriteResGroup0_1 : SchedWriteRes<[HWPort23]> {
840 let ResourceCycles = [1];
842 def: InstRW<[HWWriteResGroup0_1], (instrs VBROADCASTF128,
849 def: InstRW<[HWWriteResGroup0_1], (instregex "LD_F(32|64|80)m",
850 "VPBROADCAST(D|Q)Yrm")>;
852 def HWWriteResGroup0_2 : SchedWriteRes<[HWPort23]> {
855 let ResourceCycles = [1];
857 def: InstRW<[HWWriteResGroup0_2], (instregex "MOVSX(16|32|64)rm(8|16|32)",
858 "MOVZX(16|32|64)rm(8|16)",
861 def HWWriteResGroup1 : SchedWriteRes<[HWPort4,HWPort237]> {
864 let ResourceCycles = [1,1];
866 def: InstRW<[HWWriteResGroup1], (instrs FBSTPm, VMPTRSTm)>;
867 def: InstRW<[HWWriteResGroup1], (instregex "ST_FP(32|64|80)m")>;
869 def HWWriteResGroup2 : SchedWriteRes<[HWPort0]> {
872 let ResourceCycles = [1];
874 def: InstRW<[HWWriteResGroup2], (instregex "VPSLLVQ(Y?)rr",
877 def HWWriteResGroup3 : SchedWriteRes<[HWPort1]> {
880 let ResourceCycles = [1];
882 def: InstRW<[HWWriteResGroup3], (instregex "COM(P?)_FST0r",
885 def HWWriteResGroup4 : SchedWriteRes<[HWPort5]> {
888 let ResourceCycles = [1];
890 def: InstRW<[HWWriteResGroup4], (instrs MMX_MOVQ2DQrr)>;
892 def HWWriteResGroup5 : SchedWriteRes<[HWPort6]> {
895 let ResourceCycles = [1];
897 def: InstRW<[HWWriteResGroup5], (instregex "JMP(16|32|64)r")>;
899 def HWWriteResGroup6 : SchedWriteRes<[HWPort01]> {
902 let ResourceCycles = [1];
904 def: InstRW<[HWWriteResGroup6], (instrs FINCSTP, FNOP)>;
906 def HWWriteResGroup7 : SchedWriteRes<[HWPort06]> {
909 let ResourceCycles = [1];
911 def: InstRW<[HWWriteResGroup7], (instrs CDQ, CQO)>;
913 def HWWriteResGroup8 : SchedWriteRes<[HWPort15]> {
916 let ResourceCycles = [1];
918 def: InstRW<[HWWriteResGroup8], (instregex "ANDN(32|64)rr")>;
920 def HWWriteResGroup9 : SchedWriteRes<[HWPort015]> {
923 let ResourceCycles = [1];
925 def: InstRW<[HWWriteResGroup9], (instregex "VPBLENDD(Y?)rri")>;
927 def HWWriteResGroup10 : SchedWriteRes<[HWPort0156]> {
930 let ResourceCycles = [1];
932 def: InstRW<[HWWriteResGroup10], (instrs CBW, CWDE, CDQE,
940 def HWWriteResGroup11 : SchedWriteRes<[HWPort0,HWPort23]> {
943 let ResourceCycles = [1,1];
945 def: InstRW<[HWWriteResGroup11], (instregex "(V?)CVTPS2PDrm")>;
947 def HWWriteResGroup11_1 : SchedWriteRes<[HWPort0,HWPort23]> {
950 let ResourceCycles = [1,1];
952 def: InstRW<[HWWriteResGroup11_1], (instrs VPSLLVQrm, VPSRLVQrm)>;
953 def: InstRW<[HWWriteResGroup11_1], (instregex "(V?)CVTSS2SDrm")>;
955 def HWWriteResGroup11_2 : SchedWriteRes<[HWPort0,HWPort23]> {
958 let ResourceCycles = [1,1];
960 def: InstRW<[HWWriteResGroup11_2], (instrs VPSLLVQYrm, VPSRLVQYrm)>;
962 def HWWriteResGroup12 : SchedWriteRes<[HWPort1,HWPort23]> {
965 let ResourceCycles = [1,1];
967 def: InstRW<[HWWriteResGroup12], (instrs MMX_CVTPI2PSirm)>;
968 def: InstRW<[HWWriteResGroup12], (instregex "P(DEP|EXT)(32|64)rm")>;
970 def HWWriteResGroup13 : SchedWriteRes<[HWPort5,HWPort23]> {
973 let ResourceCycles = [1,1];
975 def: InstRW<[HWWriteResGroup13], (instregex "(V?)PMOV(SX|ZX)BDrm",
976 "(V?)PMOV(SX|ZX)BQrm",
977 "(V?)PMOV(SX|ZX)BWrm",
978 "(V?)PMOV(SX|ZX)DQrm",
979 "(V?)PMOV(SX|ZX)WDrm",
980 "(V?)PMOV(SX|ZX)WQrm")>;
982 def HWWriteResGroup13_1 : SchedWriteRes<[HWPort5,HWPort23]> {
985 let ResourceCycles = [1,1];
987 def: InstRW<[HWWriteResGroup13_1], (instrs VPMOVSXBDYrm,
991 def HWWriteResGroup14 : SchedWriteRes<[HWPort6,HWPort23]> {
994 let ResourceCycles = [1,1];
996 def: InstRW<[HWWriteResGroup14], (instrs FARJMP64)>;
997 def: InstRW<[HWWriteResGroup14], (instregex "JMP(16|32|64)m")>;
999 def HWWriteResGroup16 : SchedWriteRes<[HWPort23,HWPort15]> {
1001 let NumMicroOps = 2;
1002 let ResourceCycles = [1,1];
1004 def: InstRW<[HWWriteResGroup16], (instregex "ANDN(32|64)rm",
1005 "MOVBE(16|32|64)rm")>;
1007 def HWWriteResGroup17 : SchedWriteRes<[HWPort23,HWPort015]> {
1009 let NumMicroOps = 2;
1010 let ResourceCycles = [1,1];
1012 def: InstRW<[HWWriteResGroup17], (instrs VINSERTF128rm,
1016 def HWWriteResGroup17_2 : SchedWriteRes<[HWPort23,HWPort015]> {
1018 let NumMicroOps = 2;
1019 let ResourceCycles = [1,1];
1021 def: InstRW<[HWWriteResGroup17_2], (instrs VPBLENDDYrmi)>;
1023 def HWWriteResGroup18 : SchedWriteRes<[HWPort23,HWPort0156]> {
1025 let NumMicroOps = 2;
1026 let ResourceCycles = [1,1];
1028 def: InstRW<[HWWriteResGroup18], (instrs POP16r, POP32r, POP64r)>;
1029 def: InstRW<[HWWriteResGroup18], (instregex "POP(16|32|64)rmr")>;
1031 def HWWriteResGroup19 : SchedWriteRes<[HWPort237,HWPort0156]> {
1033 let NumMicroOps = 2;
1034 let ResourceCycles = [1,1];
1036 def: InstRW<[HWWriteResGroup19], (instrs SFENCE)>;
1038 def HWWriteResGroup21 : SchedWriteRes<[HWPort4,HWPort6,HWPort237]> {
1040 let NumMicroOps = 3;
1041 let ResourceCycles = [1,1,1];
1043 def: InstRW<[HWWriteResGroup21], (instrs FNSTCW16m)>;
1045 def HWWriteResGroup23 : SchedWriteRes<[HWPort4,HWPort237,HWPort15]> {
1047 let NumMicroOps = 3;
1048 let ResourceCycles = [1,1,1];
1050 def: InstRW<[HWWriteResGroup23], (instregex "MOVBE(32|64)mr")>;
1052 def HWWriteResGroup23_16 : SchedWriteRes<[HWPort06, HWPort237, HWPort4]> {
1054 let NumMicroOps = 3;
1055 let ResourceCycles = [1,1,1];
1057 def: InstRW<[HWWriteResGroup23_16], (instrs MOVBE16mr)>;
1059 def HWWriteResGroup24 : SchedWriteRes<[HWPort4,HWPort237,HWPort0156]> {
1061 let NumMicroOps = 3;
1062 let ResourceCycles = [1,1,1];
1064 def: InstRW<[HWWriteResGroup24], (instrs PUSH16r, PUSH32r, PUSH64r, PUSH64i8,
1065 STOSB, STOSL, STOSQ, STOSW)>;
1066 def: InstRW<[HWWriteResGroup24], (instregex "PUSH(16|32|64)rmr")>;
1068 def HWWriteResGroup25 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort06]> {
1070 let NumMicroOps = 4;
1071 let ResourceCycles = [1,1,1,1];
1073 def: InstRW<[HWWriteResGroup25], (instregex "SAR(8|16|32|64)m(1|i)",
1074 "SHL(8|16|32|64)m(1|i)",
1075 "SHR(8|16|32|64)m(1|i)")>;
1077 def HWWriteResGroup26 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort0156]> {
1079 let NumMicroOps = 4;
1080 let ResourceCycles = [1,1,1,1];
1082 def: InstRW<[HWWriteResGroup26], (instregex "POP(16|32|64)rmm",
1083 "PUSH(16|32|64)rmm")>;
1085 def HWWriteResGroup28 : SchedWriteRes<[HWPort01]> {
1087 let NumMicroOps = 2;
1088 let ResourceCycles = [2];
1090 def: InstRW<[HWWriteResGroup28], (instrs FDECSTP)>;
1092 def HWWriteResGroup30 : SchedWriteRes<[HWPort0156]> {
1094 let NumMicroOps = 2;
1095 let ResourceCycles = [2];
1097 def: InstRW<[HWWriteResGroup30], (instrs LFENCE,
1102 def HWWriteResGroup31 : SchedWriteRes<[HWPort0,HWPort5]> {
1104 let NumMicroOps = 2;
1105 let ResourceCycles = [1,1];
1107 def: InstRW<[HWWriteResGroup31], (instregex "(V?)CVTPS2PDrr",
1110 def HWWriteResGroup32 : SchedWriteRes<[HWPort6,HWPort0156]> {
1112 let NumMicroOps = 2;
1113 let ResourceCycles = [1,1];
1115 def: InstRW<[HWWriteResGroup32], (instregex "CLFLUSH")>;
1117 def HWWriteResGroup33 : SchedWriteRes<[HWPort01,HWPort015]> {
1119 let NumMicroOps = 2;
1120 let ResourceCycles = [1,1];
1122 def: InstRW<[HWWriteResGroup33], (instrs MMX_MOVDQ2Qrr)>;
1124 def HWWriteResGroup35 : SchedWriteRes<[HWPort06,HWPort0156]> {
1126 let NumMicroOps = 2;
1127 let ResourceCycles = [1,1];
1129 def: InstRW<[HWWriteResGroup35], (instrs CWD, JCXZ, JECXZ, JRCXZ)>;
1130 def: InstRW<[HWWriteResGroup35], (instregex "SET(A|BE)r")>;
1132 def HWWriteResGroup36_2 : SchedWriteRes<[HWPort5,HWPort23]> {
1134 let NumMicroOps = 3;
1135 let ResourceCycles = [2,1];
1137 def: InstRW<[HWWriteResGroup36_2], (instrs MMX_PACKSSDWirm,
1141 def HWWriteResGroup37 : SchedWriteRes<[HWPort23,HWPort0156]> {
1143 let NumMicroOps = 3;
1144 let ResourceCycles = [1,2];
1146 def: InstRW<[HWWriteResGroup37], (instrs LEAVE, LEAVE64,
1147 SCASB, SCASL, SCASQ, SCASW)>;
1149 def HWWriteResGroup39 : SchedWriteRes<[HWPort0,HWPort01,HWPort23]> {
1151 let NumMicroOps = 3;
1152 let ResourceCycles = [1,1,1];
1154 def: InstRW<[HWWriteResGroup39], (instrs FLDCW16m)>;
1156 def HWWriteResGroup41 : SchedWriteRes<[HWPort6,HWPort23,HWPort0156]> {
1158 let NumMicroOps = 3;
1159 let ResourceCycles = [1,1,1];
1161 def: InstRW<[HWWriteResGroup41], (instrs LRETQ, RETL, RETQ)>;
1163 def HWWriteResGroup44 : SchedWriteRes<[HWPort4,HWPort6,HWPort237,HWPort0156]> {
1165 let NumMicroOps = 4;
1166 let ResourceCycles = [1,1,1,1];
1168 def: InstRW<[HWWriteResGroup44], (instregex "CALL(16|32|64)r")>;
1170 def HWWriteResGroup45 : SchedWriteRes<[HWPort4,HWPort237,HWPort06,HWPort0156]> {
1172 let NumMicroOps = 4;
1173 let ResourceCycles = [1,1,1,1];
1175 def: InstRW<[HWWriteResGroup45], (instrs CALL64pcrel32)>;
1176 def: InstRW<[HWWriteResGroup45], (instregex "SET(A|BE)m")>;
1178 def HWWriteResGroup46 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort06]> {
1180 let NumMicroOps = 5;
1181 let ResourceCycles = [1,1,1,2];
1183 def: InstRW<[HWWriteResGroup46], (instregex "ROL(8|16|32|64)m(1|i)",
1184 "ROR(8|16|32|64)m(1|i)")>;
1186 def HWWriteResGroup47 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort0156]> {
1188 let NumMicroOps = 5;
1189 let ResourceCycles = [1,1,1,2];
1191 def: InstRW<[HWWriteResGroup47], (instregex "XADD(8|16|32|64)rm")>;
1193 def HWWriteResGroup48 : SchedWriteRes<[HWPort4,HWPort6,HWPort23,HWPort237,HWPort0156]> {
1195 let NumMicroOps = 5;
1196 let ResourceCycles = [1,1,1,1,1];
1198 def: InstRW<[HWWriteResGroup48], (instregex "CALL(16|32|64)m")>;
1199 def: InstRW<[HWWriteResGroup48], (instrs FARCALL64)>;
1201 def HWWriteResGroup50 : SchedWriteRes<[HWPort1]> {
1203 let NumMicroOps = 1;
1204 let ResourceCycles = [1];
1206 def: InstRW<[HWWriteResGroup50], (instrs MMX_CVTPI2PSirr)>;
1207 def: InstRW<[HWWriteResGroup50], (instregex "P(DEP|EXT)(32|64)rr",
1208 "(V?)CVTDQ2PS(Y?)rr")>;
1210 def HWWriteResGroup51 : SchedWriteRes<[HWPort5]> {
1212 let NumMicroOps = 1;
1213 let ResourceCycles = [1];
1215 def: InstRW<[HWWriteResGroup51], (instregex "VPBROADCAST(B|W)rr")>;
1217 def HWWriteResGroup52 : SchedWriteRes<[HWPort1,HWPort23]> {
1219 let NumMicroOps = 2;
1220 let ResourceCycles = [1,1];
1222 def: InstRW<[HWWriteResGroup52], (instregex "(V?)CVTPS2DQrm",
1223 "(V?)CVTTPS2DQrm")>;
1225 def HWWriteResGroup52_1 : SchedWriteRes<[HWPort1,HWPort23]> {
1227 let NumMicroOps = 2;
1228 let ResourceCycles = [1,1];
1230 def: InstRW<[HWWriteResGroup52_1], (instregex "(ADD|SUB|SUBR)_F(32|64)m",
1231 "ILD_F(16|32|64)m")>;
1232 def: InstRW<[HWWriteResGroup52_1], (instrs VCVTDQ2PSYrm,
1236 def HWWriteResGroup53_1 : SchedWriteRes<[HWPort5,HWPort23]> {
1238 let NumMicroOps = 2;
1239 let ResourceCycles = [1,1];
1241 def: InstRW<[HWWriteResGroup53_1], (instrs VPMOVSXBWYrm,
1246 def HWWriteResGroup57 : SchedWriteRes<[HWPort5,HWPort0156]> {
1248 let NumMicroOps = 3;
1249 let ResourceCycles = [2,1];
1251 def: InstRW<[HWWriteResGroup57], (instrs MMX_PACKSSDWirr,
1255 def HWWriteResGroup58 : SchedWriteRes<[HWPort6,HWPort0156]> {
1257 let NumMicroOps = 3;
1258 let ResourceCycles = [1,2];
1260 def: InstRW<[HWWriteResGroup58], (instregex "CLD")>;
1262 def HWWriteResGroup59 : SchedWriteRes<[HWPort06,HWPort0156]> {
1264 let NumMicroOps = 3;
1265 let ResourceCycles = [1,2];
1267 def: InstRW<[HWWriteResGroup59], (instregex "RCL(8|16|32|64)r(1|i)",
1268 "RCR(8|16|32|64)r(1|i)")>;
1270 def HWWriteResGroup61 : SchedWriteRes<[HWPort0,HWPort4,HWPort237]> {
1272 let NumMicroOps = 3;
1273 let ResourceCycles = [1,1,1];
1275 def: InstRW<[HWWriteResGroup61], (instrs FNSTSWm)>;
1277 def HWWriteResGroup62 : SchedWriteRes<[HWPort1,HWPort4,HWPort237]> {
1279 let NumMicroOps = 3;
1280 let ResourceCycles = [1,1,1];
1282 def: InstRW<[HWWriteResGroup62], (instregex "IST(T?)_FP(16|32|64)m",
1285 def HWWriteResGroup66 : SchedWriteRes<[HWPort23,HWPort237,HWPort06,HWPort0156]> {
1287 let NumMicroOps = 5;
1288 let ResourceCycles = [1,1,1,2];
1290 def: InstRW<[HWWriteResGroup66], (instregex "RCL(8|16|32|64)m(1|i)",
1291 "RCR(8|16|32|64)m(1|i)")>;
1293 def HWWriteResGroup68 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort0156]> {
1295 let NumMicroOps = 6;
1296 let ResourceCycles = [1,1,1,3];
1298 def: InstRW<[HWWriteResGroup68], (instregex "XCHG(8|16|32|64)rm")>;
1300 def HWWriteResGroup69 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort06,HWPort0156]> {
1302 let NumMicroOps = 6;
1303 let ResourceCycles = [1,1,1,2,1];
1305 def: InstRW<[HWWriteResGroup69], (instregex "ROL(8|16|32|64)mCL",
1306 "ROR(8|16|32|64)mCL",
1307 "SAR(8|16|32|64)mCL",
1308 "SHL(8|16|32|64)mCL",
1309 "SHR(8|16|32|64)mCL")>;
1310 def: SchedAlias<WriteADCRMW, HWWriteResGroup69>;
1312 def HWWriteResGroup70 : SchedWriteRes<[HWPort0,HWPort1]> {
1314 let NumMicroOps = 2;
1315 let ResourceCycles = [1,1];
1317 def: InstRW<[HWWriteResGroup70], (instregex "(V?)CVT(T?)SD2SI(64)?rr",
1318 "(V?)CVT(T?)SS2SI(64)?rr")>;
1320 def HWWriteResGroup71 : SchedWriteRes<[HWPort0,HWPort5]> {
1322 let NumMicroOps = 2;
1323 let ResourceCycles = [1,1];
1325 def: InstRW<[HWWriteResGroup71], (instrs VCVTPS2PDYrr)>;
1327 def HWWriteResGroup72 : SchedWriteRes<[HWPort0,HWPort0156]> {
1329 let NumMicroOps = 2;
1330 let ResourceCycles = [1,1];
1332 def: InstRW<[HWWriteResGroup72], (instrs FNSTSW16r)>;
1334 def HWWriteResGroup73 : SchedWriteRes<[HWPort1,HWPort5]> {
1336 let NumMicroOps = 2;
1337 let ResourceCycles = [1,1];
1339 def: InstRW<[HWWriteResGroup73], (instrs MMX_CVTPI2PDirr,
1344 def: InstRW<[HWWriteResGroup73], (instregex "(V?)CVTDQ2PDrr",
1347 "(V?)CVTSI(64)?2SDrr",
1349 "(V?)CVT(T?)PD2DQrr")>;
1351 def HWWriteResGroup75 : SchedWriteRes<[HWPort1,HWPort23]> {
1353 let NumMicroOps = 3;
1354 let ResourceCycles = [2,1];
1356 def: InstRW<[HWWriteResGroup75], (instregex "FICOM(P?)(16|32)m")>;
1358 def HWWriteResGroup76 : SchedWriteRes<[HWPort0,HWPort1,HWPort23]> {
1360 let NumMicroOps = 3;
1361 let ResourceCycles = [1,1,1];
1363 def: InstRW<[HWWriteResGroup76], (instregex "(V?)CVTSD2SI(64)?rm",
1364 "(V?)CVTSS2SI(64)?rm",
1365 "(V?)CVTTSD2SI(64)?rm",
1367 "(V?)CVTTSS2SIrm")>;
1369 def HWWriteResGroup77 : SchedWriteRes<[HWPort0,HWPort5,HWPort23]> {
1371 let NumMicroOps = 3;
1372 let ResourceCycles = [1,1,1];
1374 def: InstRW<[HWWriteResGroup77], (instrs VCVTPS2PDYrm)>;
1376 def HWWriteResGroup78 : SchedWriteRes<[HWPort1,HWPort5,HWPort23]> {
1378 let NumMicroOps = 3;
1379 let ResourceCycles = [1,1,1];
1381 def: InstRW<[HWWriteResGroup78], (instrs CVTPD2PSrm,
1389 def HWWriteResGroup78_1 : SchedWriteRes<[HWPort1,HWPort5,HWPort23]> {
1391 let NumMicroOps = 3;
1392 let ResourceCycles = [1,1,1];
1394 def: InstRW<[HWWriteResGroup78_1], (instrs MMX_CVTPI2PDirm,
1398 def HWWriteResGroup80 : SchedWriteRes<[HWPort5,HWPort23,HWPort015]> {
1400 let NumMicroOps = 3;
1401 let ResourceCycles = [1,1,1];
1403 def: InstRW<[HWWriteResGroup80], (instregex "VPBROADCAST(B|W)(Y?)rm")>;
1405 def HWWriteResGroup81 : SchedWriteRes<[HWPort0156]> {
1407 let NumMicroOps = 4;
1408 let ResourceCycles = [4];
1410 def: InstRW<[HWWriteResGroup81], (instrs FNCLEX)>;
1412 def HWWriteResGroup82 : SchedWriteRes<[]> {
1414 let NumMicroOps = 4;
1415 let ResourceCycles = [];
1417 def: InstRW<[HWWriteResGroup82], (instrs VZEROUPPER)>;
1419 def HWWriteResGroup83 : SchedWriteRes<[HWPort1,HWPort6,HWPort0156]> {
1421 let NumMicroOps = 4;
1422 let ResourceCycles = [1,1,2];
1424 def: InstRW<[HWWriteResGroup83], (instregex "LAR(16|32|64)rr")>;
1426 def HWWriteResGroup87 : SchedWriteRes<[HWPort1,HWPort6,HWPort23,HWPort0156]> {
1428 let NumMicroOps = 5;
1429 let ResourceCycles = [1,2,1,1];
1431 def: InstRW<[HWWriteResGroup87], (instregex "LAR(16|32|64)rm",
1432 "LSL(16|32|64)rm")>;
1434 def HWWriteResGroup88 : SchedWriteRes<[HWPort4,HWPort237,HWPort0156]> {
1436 let NumMicroOps = 6;
1437 let ResourceCycles = [1,1,4];
1439 def: InstRW<[HWWriteResGroup88], (instregex "PUSHF(16|64)")>;
1441 def HWWriteResGroup89 : SchedWriteRes<[HWPort0]> {
1443 let NumMicroOps = 1;
1444 let ResourceCycles = [1];
1446 def: InstRW<[HWWriteResGroup89], (instregex "(V?)PCMPGTQ(Y?)rr",
1447 "MUL_(FPrST0|FST0r|FrST0)")>;
1449 def HWWriteResGroup91_2 : SchedWriteRes<[HWPort0,HWPort23]> {
1451 let NumMicroOps = 2;
1452 let ResourceCycles = [1,1];
1454 def: InstRW<[HWWriteResGroup91_2], (instregex "(V?)PCMPGTQrm")>;
1456 def HWWriteResGroup91_3 : SchedWriteRes<[HWPort0,HWPort23]> {
1458 let NumMicroOps = 2;
1459 let ResourceCycles = [1,1];
1461 def: InstRW<[HWWriteResGroup91_3], (instregex "MUL_F(32|64)m")>;
1462 def: InstRW<[HWWriteResGroup91_3], (instrs VPCMPGTQYrm)>;
1464 def HWWriteResGroup93 : SchedWriteRes<[HWPort1,HWPort5]> {
1466 let NumMicroOps = 3;
1467 let ResourceCycles = [1,2];
1469 def: InstRW<[HWWriteResGroup93], (instregex "(V?)CVTSI642SSrr")>;
1471 def HWWriteResGroup94 : SchedWriteRes<[HWPort1,HWPort6,HWPort06]> {
1473 let NumMicroOps = 3;
1474 let ResourceCycles = [1,1,1];
1476 def: InstRW<[HWWriteResGroup94], (instregex "STR(16|32|64)r")>;
1478 def HWWriteResGroup97 : SchedWriteRes<[HWPort0,HWPort1,HWPort5,HWPort23]> {
1480 let NumMicroOps = 4;
1481 let ResourceCycles = [1,1,1,1];
1483 def: InstRW<[HWWriteResGroup97], (instregex "CVTTSS2SI64rm")>;
1485 def HWWriteResGroup99 : SchedWriteRes<[HWPort6,HWPort0156]> {
1487 let NumMicroOps = 5;
1488 let ResourceCycles = [1,4];
1490 def: InstRW<[HWWriteResGroup99], (instrs PAUSE)>;
1492 def HWWriteResGroup100 : SchedWriteRes<[HWPort06,HWPort0156]> {
1494 let NumMicroOps = 5;
1495 let ResourceCycles = [1,4];
1497 def: InstRW<[HWWriteResGroup100], (instrs XSETBV)>;
1499 def HWWriteResGroup102 : SchedWriteRes<[HWPort1,HWPort5]> {
1501 let NumMicroOps = 2;
1502 let ResourceCycles = [1,1];
1504 def: InstRW<[HWWriteResGroup102], (instrs VCVTDQ2PDYrr,
1509 def HWWriteResGroup103 : SchedWriteRes<[HWPort1,HWPort23]> {
1511 let NumMicroOps = 3;
1512 let ResourceCycles = [2,1];
1514 def: InstRW<[HWWriteResGroup103], (instregex "(ADD|SUB|SUBR)_FI(16|32)m")>;
1516 def HWWriteResGroup104 : SchedWriteRes<[HWPort1,HWPort5,HWPort23]> {
1518 let NumMicroOps = 3;
1519 let ResourceCycles = [1,1,1];
1521 def: InstRW<[HWWriteResGroup104], (instrs VCVTDQ2PDYrm)>;
1523 def HWWriteResGroup107 : SchedWriteRes<[HWPort1,HWPort6,HWPort06,HWPort0156]> {
1525 let NumMicroOps = 4;
1526 let ResourceCycles = [1,1,1,1];
1528 def: InstRW<[HWWriteResGroup107], (instregex "SLDT(16|32|64)r")>;
1530 def HWWriteResGroup108 : SchedWriteRes<[HWPort6,HWPort0156]> {
1532 let NumMicroOps = 6;
1533 let ResourceCycles = [1,5];
1535 def: InstRW<[HWWriteResGroup108], (instrs STD)>;
1537 def HWWriteResGroup114 : SchedWriteRes<[HWPort6,HWPort06,HWPort15,HWPort0156]> {
1539 let NumMicroOps = 7;
1540 let ResourceCycles = [2,2,1,2];
1542 def: InstRW<[HWWriteResGroup114], (instrs LOOP)>;
1544 def HWWriteResGroup115 : SchedWriteRes<[HWPort0,HWPort1,HWPort23]> {
1546 let NumMicroOps = 3;
1547 let ResourceCycles = [1,1,1];
1549 def: InstRW<[HWWriteResGroup115], (instregex "MUL_FI(16|32)m")>;
1551 def HWWriteResGroup120 : SchedWriteRes<[HWPort1,HWPort23,HWPort237,HWPort06,HWPort15,HWPort0156]> {
1553 let NumMicroOps = 10;
1554 let ResourceCycles = [1,1,1,4,1,2];
1556 def: InstRW<[HWWriteResGroup120], (instregex "RCL(8|16|32|64)mCL")>;
1558 def HWWriteResGroup129 : SchedWriteRes<[HWPort1,HWPort06,HWPort0156]> {
1560 let NumMicroOps = 7;
1561 let ResourceCycles = [2,2,3];
1563 def: InstRW<[HWWriteResGroup129], (instregex "RCL(16|32|64)rCL",
1564 "RCR(16|32|64)rCL")>;
1566 def HWWriteResGroup130 : SchedWriteRes<[HWPort1,HWPort06,HWPort15,HWPort0156]> {
1568 let NumMicroOps = 9;
1569 let ResourceCycles = [1,4,1,3];
1571 def: InstRW<[HWWriteResGroup130], (instrs RCL8rCL)>;
1573 def HWWriteResGroup131 : SchedWriteRes<[HWPort06,HWPort0156]> {
1575 let NumMicroOps = 11;
1576 let ResourceCycles = [2,9];
1578 def: InstRW<[HWWriteResGroup131], (instrs LOOPE, LOOPNE)>;
1580 def HWWriteResGroup132 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort06,HWPort15,HWPort0156]> {
1582 let NumMicroOps = 14;
1583 let ResourceCycles = [1,1,1,4,2,5];
1585 def: InstRW<[HWWriteResGroup132], (instrs CMPXCHG8B)>;
1587 def HWWriteResGroup135 : SchedWriteRes<[HWPort1,HWPort23,HWPort237,HWPort06,HWPort15,HWPort0156]> {
1589 let NumMicroOps = 11;
1590 let ResourceCycles = [2,1,1,3,1,3];
1592 def: InstRW<[HWWriteResGroup135], (instregex "RCR(8|16|32|64)mCL")>;
1594 def HWWriteResGroup142 : SchedWriteRes<[HWPort1,HWPort06,HWPort15,HWPort0156]> {
1596 let NumMicroOps = 10;
1597 let ResourceCycles = [2,3,1,4];
1599 def: InstRW<[HWWriteResGroup142], (instrs RCR8rCL)>;
1601 def HWWriteResGroup143 : SchedWriteRes<[HWPort23,HWPort0156]> {
1603 let NumMicroOps = 15;
1604 let ResourceCycles = [1,14];
1606 def: InstRW<[HWWriteResGroup143], (instrs POPF16)>;
1608 def HWWriteResGroup144 : SchedWriteRes<[HWPort4,HWPort5,HWPort6,HWPort23,HWPort237,HWPort06,HWPort0156]> {
1610 let NumMicroOps = 8;
1611 let ResourceCycles = [1,1,1,1,1,1,2];
1613 def: InstRW<[HWWriteResGroup144], (instrs INSB, INSL, INSW)>;
1615 def HWWriteResGroup145 : SchedWriteRes<[HWPort5, HWPort6]> {
1617 let NumMicroOps = 20;
1618 let ResourceCycles = [1,1];
1620 def: InstRW<[HWWriteResGroup145], (instrs VZEROALL)>;
1622 def HWWriteResGroup146 : SchedWriteRes<[HWPort0,HWPort4,HWPort5,HWPort23,HWPort237,HWPort06,HWPort0156]> {
1624 let NumMicroOps = 19;
1625 let ResourceCycles = [2,1,4,1,1,4,6];
1627 def: InstRW<[HWWriteResGroup146], (instrs CMPXCHG16B)>;
1629 def HWWriteResGroup147 : SchedWriteRes<[HWPort0,HWPort1,HWPort5,HWPort6,HWPort01,HWPort0156]> {
1631 let NumMicroOps = 15;
1632 let ResourceCycles = [2,1,2,4,2,4];
1634 def: InstRW<[HWWriteResGroup147], (instrs XCH_F)>;
1636 def HWWriteResGroup149 : SchedWriteRes<[HWPort5,HWPort6,HWPort06,HWPort0156]> {
1638 let NumMicroOps = 8;
1639 let ResourceCycles = [1,1,1,5];
1641 def: InstRW<[HWWriteResGroup149], (instrs CPUID, RDTSC)>;
1643 def HWWriteResGroup151 : SchedWriteRes<[HWPort6,HWPort23,HWPort0156]> {
1645 let NumMicroOps = 19;
1646 let ResourceCycles = [3,1,15];
1648 def: InstRW<[HWWriteResGroup151], (instregex "XRSTOR(64)?")>;
1650 def HWWriteResGroup154 : SchedWriteRes<[HWPort0]> {
1652 let NumMicroOps = 1;
1653 let ResourceCycles = [1];
1655 def: InstRW<[HWWriteResGroup154], (instregex "DIV_(FPrST0|FST0r|FrST0)")>;
1657 def HWWriteResGroup155 : SchedWriteRes<[HWPort0,HWPort23]> {
1659 let NumMicroOps = 2;
1660 let ResourceCycles = [1,1];
1662 def: InstRW<[HWWriteResGroup155], (instregex "DIVR_F(32|64)m")>;
1664 def HWWriteResGroup156 : SchedWriteRes<[HWPort5,HWPort6,HWPort0156]> {
1666 let NumMicroOps = 10;
1667 let ResourceCycles = [1,2,7];
1669 def: InstRW<[HWWriteResGroup156], (instrs MWAITrr)>;
1671 def HWWriteResGroup161 : SchedWriteRes<[HWPort0,HWPort1,HWPort23]> {
1673 let NumMicroOps = 3;
1674 let ResourceCycles = [1,1,1];
1676 def: InstRW<[HWWriteResGroup161], (instregex "DIVR_FI(16|32)m")>;
1678 def HWWriteResGroup162 : SchedWriteRes<[HWPort0]> {
1680 let NumMicroOps = 1;
1681 let ResourceCycles = [1];
1683 def: InstRW<[HWWriteResGroup162], (instregex "DIVR_(FPrST0|FST0r|FrST0)")>;
1685 def HWWriteResGroup163 : SchedWriteRes<[HWPort0,HWPort23]> {
1687 let NumMicroOps = 2;
1688 let ResourceCycles = [1,1];
1690 def: InstRW<[HWWriteResGroup163], (instregex "DIV_F(32|64)m")>;
1692 def HWWriteResGroup164 : SchedWriteRes<[HWPort4,HWPort6,HWPort23,HWPort237,HWPort0156]> {
1694 let NumMicroOps = 27;
1695 let ResourceCycles = [1,5,1,1,19];
1697 def: InstRW<[HWWriteResGroup164], (instrs XSAVE64)>;
1699 def HWWriteResGroup165 : SchedWriteRes<[HWPort4,HWPort6,HWPort23,HWPort237,HWPort0156]> {
1701 let NumMicroOps = 28;
1702 let ResourceCycles = [1,6,1,1,19];
1704 def: InstRW<[HWWriteResGroup165], (instrs XSAVE)>;
1705 def: InstRW<[HWWriteResGroup165], (instregex "XSAVEC", "XSAVES", "XSAVEOPT")>;
1707 def HWWriteResGroup166 : SchedWriteRes<[HWPort0,HWPort1,HWPort23]> {
1709 let NumMicroOps = 3;
1710 let ResourceCycles = [1,1,1];
1712 def: InstRW<[HWWriteResGroup166], (instregex "DIV_FI(16|32)m")>;
1714 def HWWriteResGroup170 : SchedWriteRes<[HWPort5,HWPort6,HWPort23,HWPort06,HWPort0156]> {
1716 let NumMicroOps = 23;
1717 let ResourceCycles = [1,5,3,4,10];
1719 def: InstRW<[HWWriteResGroup170], (instregex "IN(8|16|32)ri",
1722 def HWWriteResGroup171 : SchedWriteRes<[HWPort5,HWPort6,HWPort23,HWPort237,HWPort06,HWPort0156]> {
1724 let NumMicroOps = 23;
1725 let ResourceCycles = [1,5,2,1,4,10];
1727 def: InstRW<[HWWriteResGroup171], (instregex "OUT(8|16|32)ir",
1730 def HWWriteResGroup175 : SchedWriteRes<[HWPort1,HWPort4,HWPort5,HWPort6,HWPort23,HWPort237,HWPort15,HWPort0156]> {
1732 let NumMicroOps = 18;
1733 let ResourceCycles = [1,1,2,3,1,1,1,8];
1735 def: InstRW<[HWWriteResGroup175], (instrs VMCLEARm)>;
1737 def HWWriteResGroup176 : SchedWriteRes<[HWPort5,HWPort0156]> {
1739 let NumMicroOps = 22;
1740 let ResourceCycles = [2,20];
1742 def: InstRW<[HWWriteResGroup176], (instrs RDTSCP)>;
1744 def HWWriteResGroup177 : SchedWriteRes<[HWPort0,HWPort01,HWPort23,HWPort05,HWPort06,HWPort015,HWPort0156]> {
1746 let NumMicroOps = 64;
1747 let ResourceCycles = [2,2,8,1,10,2,39];
1749 def: InstRW<[HWWriteResGroup177], (instrs FLDENVm)>;
1751 def HWWriteResGroup178 : SchedWriteRes<[HWPort0,HWPort6,HWPort23,HWPort05,HWPort06,HWPort15,HWPort0156]> {
1753 let NumMicroOps = 88;
1754 let ResourceCycles = [4,4,31,1,2,1,45];
1756 def: InstRW<[HWWriteResGroup178], (instrs FXRSTOR64)>;
1758 def HWWriteResGroup179 : SchedWriteRes<[HWPort0,HWPort6,HWPort23,HWPort05,HWPort06,HWPort15,HWPort0156]> {
1760 let NumMicroOps = 90;
1761 let ResourceCycles = [4,2,33,1,2,1,47];
1763 def: InstRW<[HWWriteResGroup179], (instrs FXRSTOR)>;
1765 def HWWriteResGroup180 : SchedWriteRes<[HWPort5,HWPort01,HWPort0156]> {
1767 let NumMicroOps = 15;
1768 let ResourceCycles = [6,3,6];
1770 def: InstRW<[HWWriteResGroup180], (instrs FNINIT)>;
1772 def HWWriteResGroup183 : SchedWriteRes<[HWPort0,HWPort1,HWPort4,HWPort5,HWPort6,HWPort237,HWPort06,HWPort0156]> {
1774 let NumMicroOps = 100;
1775 let ResourceCycles = [9,9,11,8,1,11,21,30];
1777 def: InstRW<[HWWriteResGroup183], (instrs FSTENVm)>;
1779 def HWWriteResGroup184 : SchedWriteRes<[HWPort0, HWPort5, HWPort15, HWPort015, HWPort06, HWPort23]> {
1781 let NumMicroOps = 12;
1782 let ResourceCycles = [2,2,1,3,2,2];
1784 def: InstRW<[HWWriteResGroup184], (instrs VGATHERDPDrm,
1788 def HWWriteResGroup185 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1790 let NumMicroOps = 22;
1791 let ResourceCycles = [5,3,4,1,5,4];
1793 def: InstRW<[HWWriteResGroup185], (instrs VGATHERQPDYrm,
1796 def HWWriteResGroup186 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1798 let NumMicroOps = 22;
1799 let ResourceCycles = [5,3,4,1,5,4];
1801 def: InstRW<[HWWriteResGroup186], (instrs VPGATHERQDYrm)>;
1803 def HWWriteResGroup187 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1805 let NumMicroOps = 22;
1806 let ResourceCycles = [5,3,4,1,5,4];
1808 def: InstRW<[HWWriteResGroup187], (instrs VPGATHERQDrm)>;
1810 def HWWriteResGroup188 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1812 let NumMicroOps = 20;
1813 let ResourceCycles = [3,3,4,1,5,4];
1815 def: InstRW<[HWWriteResGroup188], (instrs VGATHERDPDYrm,
1818 def HWWriteResGroup189 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1820 let NumMicroOps = 34;
1821 let ResourceCycles = [5,3,8,1,9,8];
1823 def: InstRW<[HWWriteResGroup189], (instrs VGATHERDPSYrm,
1826 def HWWriteResGroup190 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1828 let NumMicroOps = 14;
1829 let ResourceCycles = [3,3,2,1,3,2];
1831 def: InstRW<[HWWriteResGroup190], (instrs VGATHERQPDrm,
1834 def HWWriteResGroup191 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1836 let NumMicroOps = 15;
1837 let ResourceCycles = [3,3,2,1,4,2];
1839 def: InstRW<[HWWriteResGroup191], (instrs VGATHERQPSYrm)>;
1841 def HWWriteResGroup192 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1843 let NumMicroOps = 15;
1844 let ResourceCycles = [3,3,2,1,4,2];
1846 def: InstRW<[HWWriteResGroup192], (instrs VGATHERQPSrm,
1849 def: InstRW<[WriteZero], (instrs CLC)>;