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], 1, [1], 1>;
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 : X86WriteRes<WriteFCMOV, [HWPort1], 3, [1], 1>; // x87 conditional move.
169 def : WriteRes<WriteSETCC, [HWPort06]>; // Setcc.
170 def : WriteRes<WriteSETCCStore, [HWPort06,HWPort4,HWPort237]> {
175 defm : X86WriteRes<WriteLAHFSAHF, [HWPort06], 1, [1], 1>;
176 defm : X86WriteRes<WriteBitTest, [HWPort06], 1, [1], 1>;
177 defm : X86WriteRes<WriteBitTestImmLd, [HWPort06,HWPort23], 6, [1,1], 2>;
178 defm : X86WriteRes<WriteBitTestRegLd, [], 1, [], 10>;
179 defm : X86WriteRes<WriteBitTestSet, [HWPort06], 1, [1], 1>;
180 defm : X86WriteRes<WriteBitTestSetImmLd, [HWPort06,HWPort23], 6, [1,1], 3>;
181 //defm : X86WriteRes<WriteBitTestSetRegLd, [], 1, [], 11>;
183 // This is for simple LEAs with one or two input operands.
184 // The complex ones can only execute on port 1, and they require two cycles on
185 // the port to read all inputs. We don't model that.
186 def : WriteRes<WriteLEA, [HWPort15]>;
189 defm : HWWriteResPair<WriteBSF, [HWPort1], 3>;
190 defm : HWWriteResPair<WriteBSR, [HWPort1], 3>;
191 defm : HWWriteResPair<WriteLZCNT, [HWPort1], 3>;
192 defm : HWWriteResPair<WriteTZCNT, [HWPort1], 3>;
193 defm : HWWriteResPair<WritePOPCNT, [HWPort1], 3>;
195 // BMI1 BEXTR/BLS, BMI2 BZHI
196 defm : HWWriteResPair<WriteBEXTR, [HWPort06,HWPort15], 2, [1,1], 2>;
197 defm : HWWriteResPair<WriteBLS, [HWPort15], 1>;
198 defm : HWWriteResPair<WriteBZHI, [HWPort15], 1>;
200 // TODO: Why isn't the HWDivider used?
201 defm : X86WriteRes<WriteDiv8, [HWPort0,HWPort1,HWPort5,HWPort6], 22, [], 9>;
202 defm : X86WriteRes<WriteDiv16, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort01,HWPort0156], 98, [7,7,3,3,1,11], 32>;
203 defm : X86WriteRes<WriteDiv32, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort01,HWPort0156], 98, [7,7,3,3,1,11], 32>;
204 defm : X86WriteRes<WriteDiv64, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort01,HWPort0156], 98, [7,7,3,3,1,11], 32>;
205 defm : X86WriteRes<WriteDiv8Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
206 defm : X86WriteRes<WriteDiv16Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
207 defm : X86WriteRes<WriteDiv32Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
208 defm : X86WriteRes<WriteDiv64Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
210 defm : X86WriteRes<WriteIDiv8, [HWPort0,HWPort1,HWPort5,HWPort6], 23, [], 9>;
211 defm : X86WriteRes<WriteIDiv16, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort06,HWPort0156], 112, [4,2,4,8,14,34], 66>;
212 defm : X86WriteRes<WriteIDiv32, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort06,HWPort0156], 112, [4,2,4,8,14,34], 66>;
213 defm : X86WriteRes<WriteIDiv64, [HWPort0,HWPort1,HWPort5,HWPort6,HWPort06,HWPort0156], 112, [4,2,4,8,14,34], 66>;
214 defm : X86WriteRes<WriteIDiv8Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
215 defm : X86WriteRes<WriteIDiv16Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
216 defm : X86WriteRes<WriteIDiv32Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
217 defm : X86WriteRes<WriteIDiv64Ld, [HWPort0,HWPort23,HWDivider], 29, [1,1,10], 2>;
219 // Scalar and vector floating point.
220 defm : X86WriteRes<WriteFLD0, [HWPort01], 1, [1], 1>;
221 defm : X86WriteRes<WriteFLD1, [HWPort01], 1, [2], 2>;
222 defm : X86WriteRes<WriteFLDC, [HWPort01], 1, [2], 2>;
223 defm : X86WriteRes<WriteFLoad, [HWPort23], 5, [1], 1>;
224 defm : X86WriteRes<WriteFLoadX, [HWPort23], 6, [1], 1>;
225 defm : X86WriteRes<WriteFLoadY, [HWPort23], 7, [1], 1>;
226 defm : X86WriteRes<WriteFMaskedLoad, [HWPort23,HWPort5], 8, [1,2], 3>;
227 defm : X86WriteRes<WriteFMaskedLoadY, [HWPort23,HWPort5], 9, [1,2], 3>;
228 defm : X86WriteRes<WriteFStore, [HWPort237,HWPort4], 1, [1,1], 2>;
229 defm : X86WriteRes<WriteFStoreX, [HWPort237,HWPort4], 1, [1,1], 2>;
230 defm : X86WriteRes<WriteFStoreY, [HWPort237,HWPort4], 1, [1,1], 2>;
231 defm : X86WriteRes<WriteFStoreNT, [HWPort237,HWPort4], 1, [1,1], 2>;
232 defm : X86WriteRes<WriteFStoreNTX, [HWPort237,HWPort4], 1, [1,1], 2>;
233 defm : X86WriteRes<WriteFStoreNTY, [HWPort237,HWPort4], 1, [1,1], 2>;
235 defm : X86WriteRes<WriteFMaskedStore32, [HWPort0,HWPort4,HWPort237,HWPort15], 5, [1,1,1,1], 4>;
236 defm : X86WriteRes<WriteFMaskedStore32Y, [HWPort0,HWPort4,HWPort237,HWPort15], 5, [1,1,1,1], 4>;
237 defm : X86WriteRes<WriteFMaskedStore64, [HWPort0,HWPort4,HWPort237,HWPort15], 5, [1,1,1,1], 4>;
238 defm : X86WriteRes<WriteFMaskedStore64Y, [HWPort0,HWPort4,HWPort237,HWPort15], 5, [1,1,1,1], 4>;
240 defm : X86WriteRes<WriteFMove, [HWPort5], 1, [1], 1>;
241 defm : X86WriteRes<WriteFMoveX, [HWPort5], 1, [1], 1>;
242 defm : X86WriteRes<WriteFMoveY, [HWPort5], 1, [1], 1>;
243 defm : X86WriteRes<WriteEMMS, [HWPort01,HWPort15,HWPort015,HWPort0156], 31, [8,1,21,1], 31>;
245 defm : HWWriteResPair<WriteFAdd, [HWPort1], 3, [1], 1, 5>;
246 defm : HWWriteResPair<WriteFAddX, [HWPort1], 3, [1], 1, 6>;
247 defm : HWWriteResPair<WriteFAddY, [HWPort1], 3, [1], 1, 7>;
248 defm : HWWriteResPair<WriteFAddZ, [HWPort1], 3, [1], 1, 7>; // Unsupported = 1
249 defm : HWWriteResPair<WriteFAdd64, [HWPort1], 3, [1], 1, 5>;
250 defm : HWWriteResPair<WriteFAdd64X, [HWPort1], 3, [1], 1, 6>;
251 defm : HWWriteResPair<WriteFAdd64Y, [HWPort1], 3, [1], 1, 7>;
252 defm : HWWriteResPair<WriteFAdd64Z, [HWPort1], 3, [1], 1, 7>; // Unsupported = 1
254 defm : HWWriteResPair<WriteFCmp, [HWPort1], 3, [1], 1, 5>;
255 defm : HWWriteResPair<WriteFCmpX, [HWPort1], 3, [1], 1, 6>;
256 defm : HWWriteResPair<WriteFCmpY, [HWPort1], 3, [1], 1, 7>;
257 defm : HWWriteResPair<WriteFCmpZ, [HWPort1], 3, [1], 1, 7>; // Unsupported = 1
258 defm : HWWriteResPair<WriteFCmp64, [HWPort1], 3, [1], 1, 5>;
259 defm : HWWriteResPair<WriteFCmp64X, [HWPort1], 3, [1], 1, 6>;
260 defm : HWWriteResPair<WriteFCmp64Y, [HWPort1], 3, [1], 1, 7>;
261 defm : HWWriteResPair<WriteFCmp64Z, [HWPort1], 3, [1], 1, 7>; // Unsupported = 1
263 defm : HWWriteResPair<WriteFCom, [HWPort1], 3>;
265 defm : HWWriteResPair<WriteFMul, [HWPort01], 5, [1], 1, 5>;
266 defm : HWWriteResPair<WriteFMulX, [HWPort01], 5, [1], 1, 6>;
267 defm : HWWriteResPair<WriteFMulY, [HWPort01], 5, [1], 1, 7>;
268 defm : HWWriteResPair<WriteFMulZ, [HWPort01], 5, [1], 1, 7>; // Unsupported = 1
269 defm : HWWriteResPair<WriteFMul64, [HWPort01], 5, [1], 1, 5>;
270 defm : HWWriteResPair<WriteFMul64X, [HWPort01], 5, [1], 1, 6>;
271 defm : HWWriteResPair<WriteFMul64Y, [HWPort01], 5, [1], 1, 7>;
272 defm : HWWriteResPair<WriteFMul64Z, [HWPort01], 5, [1], 1, 7>; // Unsupported = 1
274 defm : HWWriteResPair<WriteFDiv, [HWPort0,HWFPDivider], 13, [1,7], 1, 5>;
275 defm : HWWriteResPair<WriteFDivX, [HWPort0,HWFPDivider], 13, [1,7], 1, 6>;
276 defm : HWWriteResPair<WriteFDivY, [HWPort0,HWPort15,HWFPDivider], 21, [2,1,14], 3, 7>;
277 defm : HWWriteResPair<WriteFDivZ, [HWPort0,HWPort15,HWFPDivider], 21, [2,1,14], 3, 7>; // Unsupported = 1
278 defm : HWWriteResPair<WriteFDiv64, [HWPort0,HWFPDivider], 20, [1,14], 1, 5>;
279 defm : HWWriteResPair<WriteFDiv64X, [HWPort0,HWFPDivider], 20, [1,14], 1, 6>;
280 defm : HWWriteResPair<WriteFDiv64Y, [HWPort0,HWPort15,HWFPDivider], 35, [2,1,28], 3, 7>;
281 defm : HWWriteResPair<WriteFDiv64Z, [HWPort0,HWPort15,HWFPDivider], 35, [2,1,28], 3, 7>; // Unsupported = 1
283 defm : HWWriteResPair<WriteFRcp, [HWPort0], 5, [1], 1, 5>;
284 defm : HWWriteResPair<WriteFRcpX, [HWPort0], 5, [1], 1, 6>;
285 defm : HWWriteResPair<WriteFRcpY, [HWPort0,HWPort015], 11, [2,1], 3, 7>;
286 defm : HWWriteResPair<WriteFRcpZ, [HWPort0,HWPort015], 11, [2,1], 3, 7>; // Unsupported = 1
288 defm : HWWriteResPair<WriteFRsqrt, [HWPort0], 5, [1], 1, 5>;
289 defm : HWWriteResPair<WriteFRsqrtX,[HWPort0], 5, [1], 1, 6>;
290 defm : HWWriteResPair<WriteFRsqrtY,[HWPort0,HWPort015], 11, [2,1], 3, 7>;
291 defm : HWWriteResPair<WriteFRsqrtZ,[HWPort0,HWPort015], 11, [2,1], 3, 7>; // Unsupported = 1
293 defm : HWWriteResPair<WriteFSqrt, [HWPort0,HWFPDivider], 11, [1,7], 1, 5>;
294 defm : HWWriteResPair<WriteFSqrtX, [HWPort0,HWFPDivider], 11, [1,7], 1, 6>;
295 defm : HWWriteResPair<WriteFSqrtY, [HWPort0,HWPort15,HWFPDivider], 21, [2,1,14], 3, 7>;
296 defm : HWWriteResPair<WriteFSqrtZ, [HWPort0,HWPort15,HWFPDivider], 21, [2,1,14], 3, 7>; // Unsupported = 1
297 defm : HWWriteResPair<WriteFSqrt64, [HWPort0,HWFPDivider], 16, [1,14], 1, 5>;
298 defm : HWWriteResPair<WriteFSqrt64X, [HWPort0,HWFPDivider], 16, [1,14], 1, 6>;
299 defm : HWWriteResPair<WriteFSqrt64Y, [HWPort0,HWPort15,HWFPDivider], 35, [2,1,28], 3, 7>;
300 defm : HWWriteResPair<WriteFSqrt64Z, [HWPort0,HWPort15,HWFPDivider], 35, [2,1,28], 3, 7>; // Unsupported = 1
301 defm : HWWriteResPair<WriteFSqrt80, [HWPort0,HWFPDivider], 23, [1,17]>;
303 defm : HWWriteResPair<WriteFMA, [HWPort01], 5, [1], 1, 5>;
304 defm : HWWriteResPair<WriteFMAX, [HWPort01], 5, [1], 1, 6>;
305 defm : HWWriteResPair<WriteFMAY, [HWPort01], 5, [1], 1, 7>;
306 defm : HWWriteResPair<WriteFMAZ, [HWPort01], 5, [1], 1, 7>; // Unsupported = 1
307 defm : HWWriteResPair<WriteDPPD, [HWPort0,HWPort1,HWPort5], 9, [1,1,1], 3, 6>;
308 defm : HWWriteResPair<WriteDPPS, [HWPort0,HWPort1,HWPort5], 14, [2,1,1], 4, 6>;
309 defm : HWWriteResPair<WriteDPPSY, [HWPort0,HWPort1,HWPort5], 14, [2,1,1], 4, 7>;
310 defm : HWWriteResPair<WriteDPPSZ, [HWPort0,HWPort1,HWPort5], 14, [2,1,1], 4, 7>; // Unsupported = 1
311 defm : HWWriteResPair<WriteFSign, [HWPort0], 1>;
312 defm : X86WriteRes<WriteFRnd, [HWPort23], 6, [1], 1>;
313 defm : X86WriteRes<WriteFRndY, [HWPort23], 6, [1], 1>;
314 defm : X86WriteRes<WriteFRndZ, [HWPort23], 6, [1], 1>; // Unsupported = 1
315 defm : X86WriteRes<WriteFRndLd, [HWPort1,HWPort23], 12, [2,1], 3>;
316 defm : X86WriteRes<WriteFRndYLd, [HWPort1,HWPort23], 13, [2,1], 3>;
317 defm : X86WriteRes<WriteFRndZLd, [HWPort1,HWPort23], 13, [2,1], 3>; // Unsupported = 1
318 defm : HWWriteResPair<WriteFLogic, [HWPort5], 1, [1], 1, 6>;
319 defm : HWWriteResPair<WriteFLogicY, [HWPort5], 1, [1], 1, 7>;
320 defm : HWWriteResPair<WriteFLogicZ, [HWPort5], 1, [1], 1, 7>; // Unsupported = 1
321 defm : HWWriteResPair<WriteFTest, [HWPort0], 1, [1], 1, 6>;
322 defm : HWWriteResPair<WriteFTestY, [HWPort0], 1, [1], 1, 7>;
323 defm : HWWriteResPair<WriteFTestZ, [HWPort0], 1, [1], 1, 7>; // Unsupported = 1
324 defm : HWWriteResPair<WriteFShuffle, [HWPort5], 1, [1], 1, 6>;
325 defm : HWWriteResPair<WriteFShuffleY, [HWPort5], 1, [1], 1, 7>;
326 defm : HWWriteResPair<WriteFShuffleZ, [HWPort5], 1, [1], 1, 7>; // Unsupported = 1
327 defm : HWWriteResPair<WriteFVarShuffle, [HWPort5], 1, [1], 1, 6>;
328 defm : HWWriteResPair<WriteFVarShuffleY, [HWPort5], 1, [1], 1, 7>;
329 defm : HWWriteResPair<WriteFVarShuffleZ, [HWPort5], 1, [1], 1, 7>; // Unsupported = 1
330 defm : HWWriteResPair<WriteFBlend, [HWPort015], 1, [1], 1, 6>;
331 defm : HWWriteResPair<WriteFBlendY, [HWPort015], 1, [1], 1, 7>;
332 defm : HWWriteResPair<WriteFBlendZ, [HWPort015], 1, [1], 1, 7>; // Unsupported = 1
333 defm : HWWriteResPair<WriteFShuffle256, [HWPort5], 3, [1], 1, 7>;
334 defm : HWWriteResPair<WriteFVarShuffle256, [HWPort5], 3, [1], 1, 7>;
335 defm : HWWriteResPair<WriteFVarBlend, [HWPort5], 2, [2], 2, 6>;
336 defm : HWWriteResPair<WriteFVarBlendY, [HWPort5], 2, [2], 2, 7>;
337 defm : HWWriteResPair<WriteFVarBlendZ, [HWPort5], 2, [2], 2, 7>; // Unsupported = 1
339 // Conversion between integer and float.
340 defm : HWWriteResPair<WriteCvtSD2I, [HWPort1], 3>;
341 defm : HWWriteResPair<WriteCvtPD2I, [HWPort1], 3>;
342 defm : HWWriteResPair<WriteCvtPD2IY, [HWPort1], 3>;
343 defm : HWWriteResPair<WriteCvtPD2IZ, [HWPort1], 3>; // Unsupported = 1
344 defm : HWWriteResPair<WriteCvtSS2I, [HWPort1], 3>;
345 defm : HWWriteResPair<WriteCvtPS2I, [HWPort1], 3>;
346 defm : HWWriteResPair<WriteCvtPS2IY, [HWPort1], 3>;
347 defm : HWWriteResPair<WriteCvtPS2IZ, [HWPort1], 3>; // Unsupported = 1
349 defm : HWWriteResPair<WriteCvtI2SD, [HWPort1], 4>;
350 defm : HWWriteResPair<WriteCvtI2PD, [HWPort1], 4>;
351 defm : HWWriteResPair<WriteCvtI2PDY, [HWPort1], 4>;
352 defm : HWWriteResPair<WriteCvtI2PDZ, [HWPort1], 4>; // Unsupported = 1
353 defm : HWWriteResPair<WriteCvtI2SS, [HWPort1], 4>;
354 defm : HWWriteResPair<WriteCvtI2PS, [HWPort1], 4>;
355 defm : HWWriteResPair<WriteCvtI2PSY, [HWPort1], 4>;
356 defm : HWWriteResPair<WriteCvtI2PSZ, [HWPort1], 4>; // Unsupported = 1
358 defm : HWWriteResPair<WriteCvtSS2SD, [HWPort1], 3>;
359 defm : HWWriteResPair<WriteCvtPS2PD, [HWPort1], 3>;
360 defm : HWWriteResPair<WriteCvtPS2PDY, [HWPort1], 3>;
361 defm : HWWriteResPair<WriteCvtPS2PDZ, [HWPort1], 3>; // Unsupported = 1
362 defm : HWWriteResPair<WriteCvtSD2SS, [HWPort1], 3>;
363 defm : HWWriteResPair<WriteCvtPD2PS, [HWPort1], 3>;
364 defm : HWWriteResPair<WriteCvtPD2PSY, [HWPort1], 3>;
365 defm : HWWriteResPair<WriteCvtPD2PSZ, [HWPort1], 3>; // Unsupported = 1
367 defm : X86WriteRes<WriteCvtPH2PS, [HWPort0,HWPort5], 2, [1,1], 2>;
368 defm : X86WriteRes<WriteCvtPH2PSY, [HWPort0,HWPort5], 2, [1,1], 2>;
369 defm : X86WriteRes<WriteCvtPH2PSZ, [HWPort0,HWPort5], 2, [1,1], 2>; // Unsupported = 1
370 defm : X86WriteRes<WriteCvtPH2PSLd, [HWPort0,HWPort23], 6, [1,1], 2>;
371 defm : X86WriteRes<WriteCvtPH2PSYLd, [HWPort0,HWPort23], 7, [1,1], 2>;
372 defm : X86WriteRes<WriteCvtPH2PSZLd, [HWPort0,HWPort23], 7, [1,1], 2>; // Unsupported = 1
374 defm : X86WriteRes<WriteCvtPS2PH, [HWPort1,HWPort5], 4, [1,1], 2>;
375 defm : X86WriteRes<WriteCvtPS2PHY, [HWPort1,HWPort5], 6, [1,1], 2>;
376 defm : X86WriteRes<WriteCvtPS2PHZ, [HWPort1,HWPort5], 6, [1,1], 2>; // Unsupported = 1
377 defm : X86WriteRes<WriteCvtPS2PHSt, [HWPort1,HWPort4,HWPort5,HWPort237], 5, [1,1,1,1], 4>;
378 defm : X86WriteRes<WriteCvtPS2PHYSt, [HWPort1,HWPort4,HWPort5,HWPort237], 7, [1,1,1,1], 4>;
379 defm : X86WriteRes<WriteCvtPS2PHZSt, [HWPort1,HWPort4,HWPort5,HWPort237], 7, [1,1,1,1], 4>; // Unsupported = 1
381 // Vector integer operations.
382 defm : X86WriteRes<WriteVecLoad, [HWPort23], 5, [1], 1>;
383 defm : X86WriteRes<WriteVecLoadX, [HWPort23], 6, [1], 1>;
384 defm : X86WriteRes<WriteVecLoadY, [HWPort23], 7, [1], 1>;
385 defm : X86WriteRes<WriteVecLoadNT, [HWPort23], 6, [1], 1>;
386 defm : X86WriteRes<WriteVecLoadNTY, [HWPort23], 7, [1], 1>;
387 defm : X86WriteRes<WriteVecMaskedLoad, [HWPort23,HWPort5], 8, [1,2], 3>;
388 defm : X86WriteRes<WriteVecMaskedLoadY, [HWPort23,HWPort5], 9, [1,2], 3>;
389 defm : X86WriteRes<WriteVecStore, [HWPort237,HWPort4], 1, [1,1], 2>;
390 defm : X86WriteRes<WriteVecStoreX, [HWPort237,HWPort4], 1, [1,1], 2>;
391 defm : X86WriteRes<WriteVecStoreY, [HWPort237,HWPort4], 1, [1,1], 2>;
392 defm : X86WriteRes<WriteVecStoreNT, [HWPort237,HWPort4], 1, [1,1], 2>;
393 defm : X86WriteRes<WriteVecStoreNTY, [HWPort237,HWPort4], 1, [1,1], 2>;
394 defm : X86WriteRes<WriteVecMaskedStore, [HWPort0,HWPort4,HWPort237,HWPort15], 5, [1,1,1,1], 4>;
395 defm : X86WriteRes<WriteVecMaskedStoreY, [HWPort0,HWPort4,HWPort237,HWPort15], 5, [1,1,1,1], 4>;
396 defm : X86WriteRes<WriteVecMove, [HWPort015], 1, [1], 1>;
397 defm : X86WriteRes<WriteVecMoveX, [HWPort015], 1, [1], 1>;
398 defm : X86WriteRes<WriteVecMoveY, [HWPort015], 1, [1], 1>;
399 defm : X86WriteRes<WriteVecMoveToGpr, [HWPort0], 1, [1], 1>;
400 defm : X86WriteRes<WriteVecMoveFromGpr, [HWPort5], 1, [1], 1>;
402 defm : HWWriteResPair<WriteVecLogic, [HWPort015], 1, [1], 1, 5>;
403 defm : HWWriteResPair<WriteVecLogicX,[HWPort015], 1, [1], 1, 6>;
404 defm : HWWriteResPair<WriteVecLogicY,[HWPort015], 1, [1], 1, 7>;
405 defm : HWWriteResPair<WriteVecLogicZ,[HWPort015], 1, [1], 1, 7>; // Unsupported = 1
406 defm : HWWriteResPair<WriteVecTest, [HWPort0,HWPort5], 2, [1,1], 2, 6>;
407 defm : HWWriteResPair<WriteVecTestY, [HWPort0,HWPort5], 4, [1,1], 2, 7>;
408 defm : HWWriteResPair<WriteVecTestZ, [HWPort0,HWPort5], 4, [1,1], 2, 7>; // Unsupported = 1
409 defm : HWWriteResPair<WriteVecALU, [HWPort15], 1, [1], 1, 5>;
410 defm : HWWriteResPair<WriteVecALUX, [HWPort15], 1, [1], 1, 6>;
411 defm : HWWriteResPair<WriteVecALUY, [HWPort15], 1, [1], 1, 7>;
412 defm : HWWriteResPair<WriteVecALUZ, [HWPort15], 1, [1], 1, 7>; // Unsupported = 1
413 defm : HWWriteResPair<WriteVecIMul, [HWPort0], 5, [1], 1, 5>;
414 defm : HWWriteResPair<WriteVecIMulX, [HWPort0], 5, [1], 1, 6>;
415 defm : HWWriteResPair<WriteVecIMulY, [HWPort0], 5, [1], 1, 7>;
416 defm : HWWriteResPair<WriteVecIMulZ, [HWPort0], 5, [1], 1, 7>; // Unsupported = 1
417 defm : HWWriteResPair<WritePMULLD, [HWPort0], 10, [2], 2, 6>;
418 defm : HWWriteResPair<WritePMULLDY, [HWPort0], 10, [2], 2, 7>;
419 defm : HWWriteResPair<WritePMULLDZ, [HWPort0], 10, [2], 2, 7>; // Unsupported = 1
420 defm : HWWriteResPair<WriteShuffle, [HWPort5], 1, [1], 1, 5>;
421 defm : HWWriteResPair<WriteShuffleX, [HWPort5], 1, [1], 1, 6>;
422 defm : HWWriteResPair<WriteShuffleY, [HWPort5], 1, [1], 1, 7>;
423 defm : HWWriteResPair<WriteShuffleZ, [HWPort5], 1, [1], 1, 7>; // Unsupported = 1
424 defm : HWWriteResPair<WriteVarShuffle, [HWPort5], 1, [1], 1, 5>;
425 defm : HWWriteResPair<WriteVarShuffleX,[HWPort5], 1, [1], 1, 6>;
426 defm : HWWriteResPair<WriteVarShuffleY,[HWPort5], 1, [1], 1, 7>;
427 defm : HWWriteResPair<WriteVarShuffleZ,[HWPort5], 1, [1], 1, 7>; // Unsupported = 1
428 defm : HWWriteResPair<WriteBlend, [HWPort5], 1, [1], 1, 6>;
429 defm : HWWriteResPair<WriteBlendY, [HWPort5], 1, [1], 1, 7>;
430 defm : HWWriteResPair<WriteBlendZ, [HWPort5], 1, [1], 1, 7>; // Unsupported = 1
431 defm : HWWriteResPair<WriteShuffle256, [HWPort5], 3, [1], 1, 7>;
432 defm : HWWriteResPair<WriteVarShuffle256, [HWPort5], 3, [1], 1, 7>;
433 defm : HWWriteResPair<WriteVarBlend, [HWPort5], 2, [2], 2, 6>;
434 defm : HWWriteResPair<WriteVarBlendY, [HWPort5], 2, [2], 2, 7>;
435 defm : HWWriteResPair<WriteVarBlendZ, [HWPort5], 2, [2], 2, 7>; // Unsupported = 1
436 defm : HWWriteResPair<WriteMPSAD, [HWPort0, HWPort5], 7, [1, 2], 3, 6>;
437 defm : HWWriteResPair<WriteMPSADY, [HWPort0, HWPort5], 7, [1, 2], 3, 7>;
438 defm : HWWriteResPair<WriteMPSADZ, [HWPort0, HWPort5], 7, [1, 2], 3, 7>; // Unsupported = 1
439 defm : HWWriteResPair<WritePSADBW, [HWPort0], 5, [1], 1, 5>;
440 defm : HWWriteResPair<WritePSADBWX, [HWPort0], 5, [1], 1, 6>;
441 defm : HWWriteResPair<WritePSADBWY, [HWPort0], 5, [1], 1, 7>;
442 defm : HWWriteResPair<WritePSADBWZ, [HWPort0], 5, [1], 1, 7>; // Unsupported = 1
443 defm : HWWriteResPair<WritePHMINPOS, [HWPort0], 5, [1], 1, 6>;
445 // Vector integer shifts.
446 defm : HWWriteResPair<WriteVecShift, [HWPort0], 1, [1], 1, 5>;
447 defm : HWWriteResPair<WriteVecShiftX, [HWPort0,HWPort5], 2, [1,1], 2, 6>;
448 defm : X86WriteRes<WriteVecShiftY, [HWPort0,HWPort5], 4, [1,1], 2>;
449 defm : X86WriteRes<WriteVecShiftZ, [HWPort0,HWPort5], 4, [1,1], 2>; // Unsupported = 1
450 defm : X86WriteRes<WriteVecShiftYLd, [HWPort0,HWPort23], 8, [1,1], 2>;
451 defm : X86WriteRes<WriteVecShiftZLd, [HWPort0,HWPort23], 8, [1,1], 2>; // Unsupported = 1
453 defm : HWWriteResPair<WriteVecShiftImm, [HWPort0], 1, [1], 1, 5>;
454 defm : HWWriteResPair<WriteVecShiftImmX, [HWPort0], 1, [1], 1, 6>;
455 defm : HWWriteResPair<WriteVecShiftImmY, [HWPort0], 1, [1], 1, 7>;
456 defm : HWWriteResPair<WriteVecShiftImmZ, [HWPort0], 1, [1], 1, 7>; // Unsupported = 1
457 defm : HWWriteResPair<WriteVarVecShift, [HWPort0, HWPort5], 3, [2,1], 3, 6>;
458 defm : HWWriteResPair<WriteVarVecShiftY, [HWPort0, HWPort5], 3, [2,1], 3, 7>;
459 defm : HWWriteResPair<WriteVarVecShiftZ, [HWPort0, HWPort5], 3, [2,1], 3, 7>; // Unsupported = 1
461 // Vector insert/extract operations.
462 def : WriteRes<WriteVecInsert, [HWPort5]> {
465 let ResourceCycles = [2];
467 def : WriteRes<WriteVecInsertLd, [HWPort5,HWPort23]> {
471 def: InstRW<[WriteVecInsertLd], (instregex "(V?)MOV(H|L)(PD|PS)rm")>;
473 def : WriteRes<WriteVecExtract, [HWPort0,HWPort5]> {
477 def : WriteRes<WriteVecExtractSt, [HWPort4,HWPort5,HWPort237]> {
482 // String instructions.
484 // Packed Compare Implicit Length Strings, Return Mask
485 def : WriteRes<WritePCmpIStrM, [HWPort0]> {
488 let ResourceCycles = [3];
490 def : WriteRes<WritePCmpIStrMLd, [HWPort0, HWPort23]> {
493 let ResourceCycles = [3,1];
496 // Packed Compare Explicit Length Strings, Return Mask
497 def : WriteRes<WritePCmpEStrM, [HWPort0, HWPort5, HWPort015, HWPort0156]> {
500 let ResourceCycles = [4,3,1,1];
502 def : WriteRes<WritePCmpEStrMLd, [HWPort0, HWPort5, HWPort23, HWPort015, HWPort0156]> {
504 let NumMicroOps = 10;
505 let ResourceCycles = [4,3,1,1,1];
508 // Packed Compare Implicit Length Strings, Return Index
509 def : WriteRes<WritePCmpIStrI, [HWPort0]> {
512 let ResourceCycles = [3];
514 def : WriteRes<WritePCmpIStrILd, [HWPort0, HWPort23]> {
517 let ResourceCycles = [3,1];
520 // Packed Compare Explicit Length Strings, Return Index
521 def : WriteRes<WritePCmpEStrI, [HWPort0, HWPort5, HWPort0156]> {
524 let ResourceCycles = [4,3,1];
526 def : WriteRes<WritePCmpEStrILd, [HWPort0, HWPort5, HWPort23, HWPort0156]> {
529 let ResourceCycles = [4,3,1,1];
532 // MOVMSK Instructions.
533 def : WriteRes<WriteFMOVMSK, [HWPort0]> { let Latency = 3; }
534 def : WriteRes<WriteVecMOVMSK, [HWPort0]> { let Latency = 3; }
535 def : WriteRes<WriteVecMOVMSKY, [HWPort0]> { let Latency = 3; }
536 def : WriteRes<WriteMMXMOVMSK, [HWPort0]> { let Latency = 1; }
539 def : WriteRes<WriteAESDecEnc, [HWPort5]> {
542 let ResourceCycles = [1];
544 def : WriteRes<WriteAESDecEncLd, [HWPort5, HWPort23]> {
547 let ResourceCycles = [1,1];
550 def : WriteRes<WriteAESIMC, [HWPort5]> {
553 let ResourceCycles = [2];
555 def : WriteRes<WriteAESIMCLd, [HWPort5, HWPort23]> {
558 let ResourceCycles = [2,1];
561 def : WriteRes<WriteAESKeyGen, [HWPort0,HWPort5,HWPort015]> {
563 let NumMicroOps = 11;
564 let ResourceCycles = [2,7,2];
566 def : WriteRes<WriteAESKeyGenLd, [HWPort0,HWPort5,HWPort23,HWPort015]> {
568 let NumMicroOps = 11;
569 let ResourceCycles = [2,7,1,1];
572 // Carry-less multiplication instructions.
573 def : WriteRes<WriteCLMul, [HWPort0, HWPort5]> {
576 let ResourceCycles = [2,1];
578 def : WriteRes<WriteCLMulLd, [HWPort0, HWPort5, HWPort23]> {
581 let ResourceCycles = [2,1,1];
585 def : WriteRes<WriteLDMXCSR, [HWPort0,HWPort23,HWPort0156]> { let Latency = 7; let NumMicroOps = 3; let ResourceCycles = [1,1,1]; }
586 def : WriteRes<WriteSTMXCSR, [HWPort4,HWPort5,HWPort237]> { let Latency = 2; let NumMicroOps = 3; let ResourceCycles = [1,1,1]; }
588 def : WriteRes<WriteSystem, [HWPort0156]> { let Latency = 100; }
589 def : WriteRes<WriteMicrocoded, [HWPort0156]> { let Latency = 100; }
590 def : WriteRes<WriteFence, [HWPort23, HWPort4]>;
591 def : WriteRes<WriteNop, []>;
593 //================ Exceptions ================//
595 //-- Specific Scheduling Models --//
598 def HWWriteP0 : SchedWriteRes<[HWPort0]>;
600 def HWWriteP01 : SchedWriteRes<[HWPort01]>;
602 def HWWrite2P01 : SchedWriteRes<[HWPort01]> {
605 def HWWrite3P01 : SchedWriteRes<[HWPort01]> {
609 def HWWriteP0156_P23 : SchedWriteRes<[HWPort0156, HWPort23]> {
613 def HWWrite2P0156_P23 : SchedWriteRes<[HWPort0156, HWPort23]> {
615 let ResourceCycles = [2, 1];
619 def HWWriteP1 : SchedWriteRes<[HWPort1]>;
622 def HWWrite2P1 : SchedWriteRes<[HWPort1]> {
624 let ResourceCycles = [2];
629 // - mm: 64 bit mmx register.
630 // - x = 128 bit xmm register.
631 // - (x)mm = mmx or xmm register.
632 // - y = 256 bit ymm register.
633 // - v = any vector register.
636 //=== Integer Instructions ===//
637 //-- Move instructions --//
640 def HWWriteXLAT : SchedWriteRes<[]> {
644 def : InstRW<[HWWriteXLAT], (instrs XLAT)>;
647 def HWWritePushA : SchedWriteRes<[]> {
648 let NumMicroOps = 19;
650 def : InstRW<[HWWritePushA], (instregex "PUSHA(16|32)")>;
653 def HWWritePopA : SchedWriteRes<[]> {
654 let NumMicroOps = 18;
656 def : InstRW<[HWWritePopA], (instregex "POPA(16|32)")>;
658 //-- Arithmetic instructions --//
662 def HWWriteBTRSCmr : SchedWriteRes<[]> {
663 let NumMicroOps = 11;
665 def : SchedAlias<WriteBitTestSetRegRMW, HWWriteBTRSCmr>;
667 //-- Control transfer instructions --//
671 def HWWriteRETI : SchedWriteRes<[HWPort23, HWPort6, HWPort015]> {
673 let ResourceCycles = [1, 2, 1];
675 def : InstRW<[HWWriteRETI], (instregex "RETI(L|Q|W)", "LRETI(L|Q|W)")>;
679 def HWWriteBOUND : SchedWriteRes<[]> {
680 let NumMicroOps = 15;
682 def : InstRW<[HWWriteBOUND], (instregex "BOUNDS(16|32)rm")>;
685 def HWWriteINTO : SchedWriteRes<[]> {
688 def : InstRW<[HWWriteINTO], (instrs INTO)>;
690 //-- String instructions --//
693 def : InstRW<[HWWrite2P0156_P23], (instregex "LODS(B|W)")>;
696 def : InstRW<[HWWriteP0156_P23], (instregex "LODS(L|Q)")>;
699 def HWWriteMOVS : SchedWriteRes<[HWPort23, HWPort4, HWPort0156]> {
702 let ResourceCycles = [2, 1, 2];
704 def : InstRW<[HWWriteMOVS], (instrs MOVSB, MOVSL, MOVSQ, MOVSW)>;
707 def HWWriteCMPS : SchedWriteRes<[HWPort23, HWPort0156]> {
710 let ResourceCycles = [2, 3];
712 def : InstRW<[HWWriteCMPS], (instregex "CMPS(B|L|Q|W)")>;
717 def HWWriteRDPMC : SchedWriteRes<[]> {
718 let NumMicroOps = 34;
720 def : InstRW<[HWWriteRDPMC], (instrs RDPMC)>;
723 def HWWriteRDRAND : SchedWriteRes<[HWPort23, HWPort015]> {
724 let NumMicroOps = 17;
725 let ResourceCycles = [1, 16];
727 def : InstRW<[HWWriteRDRAND], (instrs RDRAND16r, RDRAND32r, RDRAND64r)>;
729 //=== Floating Point x87 Instructions ===//
730 //-- Move instructions --//
734 def : InstRW<[HWWriteP01], (instrs LD_Frr)>;
738 def HWWriteFBLD : SchedWriteRes<[]> {
740 let NumMicroOps = 43;
742 def : InstRW<[HWWriteFBLD], (instrs FBLDm)>;
746 def : InstRW<[HWWriteP01], (instregex "ST_(F|FP)rr")>;
749 def : InstRW<[HWWriteP01], (instregex "FFREE")>;
752 def HWWriteFNSAVE : SchedWriteRes<[]> {
753 let NumMicroOps = 147;
755 def : InstRW<[HWWriteFNSAVE], (instrs FSAVEm)>;
758 def HWWriteFRSTOR : SchedWriteRes<[]> {
759 let NumMicroOps = 90;
761 def : InstRW<[HWWriteFRSTOR], (instrs FRSTORm)>;
763 //-- Arithmetic instructions --//
767 def : InstRW<[HWWrite2P01], (instrs FCOMPP, UCOM_FPPr)>;
769 // FCOMI(P) FUCOMI(P).
771 def : InstRW<[HWWrite3P01], (instrs COM_FIPr, COM_FIr, UCOM_FIPr, UCOM_FIr)>;
774 def : InstRW<[HWWriteP1], (instregex "TST_F")>;
777 def : InstRW<[HWWrite2P1], (instrs FXAM)>;
780 def HWWriteFPREM : SchedWriteRes<[]> {
782 let NumMicroOps = 28;
784 def : InstRW<[HWWriteFPREM], (instrs FPREM)>;
787 def HWWriteFPREM1 : SchedWriteRes<[]> {
789 let NumMicroOps = 41;
791 def : InstRW<[HWWriteFPREM1], (instrs FPREM1)>;
794 def HWWriteFRNDINT : SchedWriteRes<[]> {
796 let NumMicroOps = 17;
798 def : InstRW<[HWWriteFRNDINT], (instrs FRNDINT)>;
800 //-- Math instructions --//
803 def HWWriteFSCALE : SchedWriteRes<[]> {
804 let Latency = 75; // 49-125
805 let NumMicroOps = 50; // 25-75
807 def : InstRW<[HWWriteFSCALE], (instrs FSCALE)>;
810 def HWWriteFXTRACT : SchedWriteRes<[]> {
812 let NumMicroOps = 17;
814 def : InstRW<[HWWriteFXTRACT], (instrs FXTRACT)>;
816 ////////////////////////////////////////////////////////////////////////////////
817 // Horizontal add/sub instructions.
818 ////////////////////////////////////////////////////////////////////////////////
820 defm : HWWriteResPair<WriteFHAdd, [HWPort1, HWPort5], 5, [1,2], 3, 6>;
821 defm : HWWriteResPair<WriteFHAddY, [HWPort1, HWPort5], 5, [1,2], 3, 7>;
822 defm : HWWriteResPair<WritePHAdd, [HWPort5, HWPort15], 3, [2,1], 3, 5>;
823 defm : HWWriteResPair<WritePHAddX, [HWPort5, HWPort15], 3, [2,1], 3, 6>;
824 defm : HWWriteResPair<WritePHAddY, [HWPort5, HWPort15], 3, [2,1], 3, 7>;
826 //=== Floating Point XMM and YMM Instructions ===//
830 def HWWriteResGroup0 : SchedWriteRes<[HWPort23]> {
833 let ResourceCycles = [1];
835 def: InstRW<[HWWriteResGroup0], (instrs VBROADCASTSSrm)>;
836 def: InstRW<[HWWriteResGroup0], (instregex "(V?)MOVSHDUPrm",
838 "VPBROADCAST(D|Q)rm")>;
840 def HWWriteResGroup0_1 : SchedWriteRes<[HWPort23]> {
843 let ResourceCycles = [1];
845 def: InstRW<[HWWriteResGroup0_1], (instrs VBROADCASTF128,
852 def: InstRW<[HWWriteResGroup0_1], (instregex "LD_F(32|64|80)m",
853 "VPBROADCAST(D|Q)Yrm")>;
855 def HWWriteResGroup0_2 : SchedWriteRes<[HWPort23]> {
858 let ResourceCycles = [1];
860 def: InstRW<[HWWriteResGroup0_2], (instregex "MOVSX(16|32|64)rm(8|16|32)",
861 "MOVZX(16|32|64)rm(8|16)",
864 def HWWriteResGroup1 : SchedWriteRes<[HWPort4,HWPort237]> {
867 let ResourceCycles = [1,1];
869 def: InstRW<[HWWriteResGroup1], (instrs FBSTPm, VMPTRSTm)>;
870 def: InstRW<[HWWriteResGroup1], (instregex "ST_FP(32|64|80)m")>;
872 def HWWriteResGroup2 : SchedWriteRes<[HWPort0]> {
875 let ResourceCycles = [1];
877 def: InstRW<[HWWriteResGroup2], (instregex "VPSLLVQ(Y?)rr",
880 def HWWriteResGroup3 : SchedWriteRes<[HWPort1]> {
883 let ResourceCycles = [1];
885 def: InstRW<[HWWriteResGroup3], (instregex "COM(P?)_FST0r",
888 def HWWriteResGroup4 : SchedWriteRes<[HWPort5]> {
891 let ResourceCycles = [1];
893 def: InstRW<[HWWriteResGroup4], (instrs MMX_MOVQ2DQrr)>;
895 def HWWriteResGroup5 : SchedWriteRes<[HWPort6]> {
898 let ResourceCycles = [1];
900 def: InstRW<[HWWriteResGroup5], (instregex "JMP(16|32|64)r")>;
902 def HWWriteResGroup6 : SchedWriteRes<[HWPort01]> {
905 let ResourceCycles = [1];
907 def: InstRW<[HWWriteResGroup6], (instrs FINCSTP, FNOP)>;
909 def HWWriteResGroup7 : SchedWriteRes<[HWPort06]> {
912 let ResourceCycles = [1];
914 def: InstRW<[HWWriteResGroup7], (instrs CDQ, CQO)>;
916 def HWWriteResGroup8 : SchedWriteRes<[HWPort15]> {
919 let ResourceCycles = [1];
921 def: InstRW<[HWWriteResGroup8], (instregex "ANDN(32|64)rr")>;
923 def HWWriteResGroup9 : SchedWriteRes<[HWPort015]> {
926 let ResourceCycles = [1];
928 def: InstRW<[HWWriteResGroup9], (instregex "VPBLENDD(Y?)rri")>;
930 def HWWriteResGroup10 : SchedWriteRes<[HWPort0156]> {
933 let ResourceCycles = [1];
935 def: InstRW<[HWWriteResGroup10], (instrs CBW, CWDE, CDQE,
943 def HWWriteResGroup11 : SchedWriteRes<[HWPort0,HWPort23]> {
946 let ResourceCycles = [1,1];
948 def: InstRW<[HWWriteResGroup11], (instregex "(V?)CVTPS2PDrm")>;
950 def HWWriteResGroup11_1 : SchedWriteRes<[HWPort0,HWPort23]> {
953 let ResourceCycles = [1,1];
955 def: InstRW<[HWWriteResGroup11_1], (instrs VPSLLVQrm, VPSRLVQrm)>;
956 def: InstRW<[HWWriteResGroup11_1], (instregex "(V?)CVTSS2SDrm")>;
958 def HWWriteResGroup11_2 : SchedWriteRes<[HWPort0,HWPort23]> {
961 let ResourceCycles = [1,1];
963 def: InstRW<[HWWriteResGroup11_2], (instrs VPSLLVQYrm, VPSRLVQYrm)>;
965 def HWWriteResGroup12 : SchedWriteRes<[HWPort1,HWPort23]> {
968 let ResourceCycles = [1,1];
970 def: InstRW<[HWWriteResGroup12], (instrs MMX_CVTPI2PSirm)>;
971 def: InstRW<[HWWriteResGroup12], (instregex "P(DEP|EXT)(32|64)rm")>;
973 def HWWriteResGroup13 : SchedWriteRes<[HWPort5,HWPort23]> {
976 let ResourceCycles = [1,1];
978 def: InstRW<[HWWriteResGroup13], (instregex "(V?)PMOV(SX|ZX)BDrm",
979 "(V?)PMOV(SX|ZX)BQrm",
980 "(V?)PMOV(SX|ZX)BWrm",
981 "(V?)PMOV(SX|ZX)DQrm",
982 "(V?)PMOV(SX|ZX)WDrm",
983 "(V?)PMOV(SX|ZX)WQrm")>;
985 def HWWriteResGroup13_1 : SchedWriteRes<[HWPort5,HWPort23]> {
988 let ResourceCycles = [1,1];
990 def: InstRW<[HWWriteResGroup13_1], (instrs VPMOVSXBDYrm,
994 def HWWriteResGroup14 : SchedWriteRes<[HWPort6,HWPort23]> {
997 let ResourceCycles = [1,1];
999 def: InstRW<[HWWriteResGroup14], (instrs FARJMP64)>;
1000 def: InstRW<[HWWriteResGroup14], (instregex "JMP(16|32|64)m")>;
1002 def HWWriteResGroup16 : SchedWriteRes<[HWPort23,HWPort15]> {
1004 let NumMicroOps = 2;
1005 let ResourceCycles = [1,1];
1007 def: InstRW<[HWWriteResGroup16], (instregex "ANDN(32|64)rm",
1008 "MOVBE(16|32|64)rm")>;
1010 def HWWriteResGroup17 : SchedWriteRes<[HWPort23,HWPort015]> {
1012 let NumMicroOps = 2;
1013 let ResourceCycles = [1,1];
1015 def: InstRW<[HWWriteResGroup17], (instrs VINSERTF128rm,
1019 def HWWriteResGroup17_2 : SchedWriteRes<[HWPort23,HWPort015]> {
1021 let NumMicroOps = 2;
1022 let ResourceCycles = [1,1];
1024 def: InstRW<[HWWriteResGroup17_2], (instrs VPBLENDDYrmi)>;
1026 def HWWriteResGroup18 : SchedWriteRes<[HWPort23,HWPort0156]> {
1028 let NumMicroOps = 2;
1029 let ResourceCycles = [1,1];
1031 def: InstRW<[HWWriteResGroup18], (instrs POP16r, POP32r, POP64r)>;
1032 def: InstRW<[HWWriteResGroup18], (instregex "POP(16|32|64)rmr")>;
1034 def HWWriteResGroup19 : SchedWriteRes<[HWPort237,HWPort0156]> {
1036 let NumMicroOps = 2;
1037 let ResourceCycles = [1,1];
1039 def: InstRW<[HWWriteResGroup19], (instrs SFENCE)>;
1041 def HWWriteResGroup21 : SchedWriteRes<[HWPort4,HWPort6,HWPort237]> {
1043 let NumMicroOps = 3;
1044 let ResourceCycles = [1,1,1];
1046 def: InstRW<[HWWriteResGroup21], (instrs FNSTCW16m)>;
1048 def HWWriteResGroup23 : SchedWriteRes<[HWPort4,HWPort237,HWPort15]> {
1050 let NumMicroOps = 3;
1051 let ResourceCycles = [1,1,1];
1053 def: InstRW<[HWWriteResGroup23], (instregex "MOVBE(32|64)mr")>;
1055 def HWWriteResGroup23_16 : SchedWriteRes<[HWPort06, HWPort237, HWPort4]> {
1057 let NumMicroOps = 3;
1058 let ResourceCycles = [1,1,1];
1060 def: InstRW<[HWWriteResGroup23_16], (instrs MOVBE16mr)>;
1062 def HWWriteResGroup24 : SchedWriteRes<[HWPort4,HWPort237,HWPort0156]> {
1064 let NumMicroOps = 3;
1065 let ResourceCycles = [1,1,1];
1067 def: InstRW<[HWWriteResGroup24], (instrs PUSH16r, PUSH32r, PUSH64r, PUSH64i8,
1068 STOSB, STOSL, STOSQ, STOSW)>;
1069 def: InstRW<[HWWriteResGroup24], (instregex "PUSH(16|32|64)rmr")>;
1071 def HWWriteResGroup25 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort06]> {
1073 let NumMicroOps = 4;
1074 let ResourceCycles = [1,1,1,1];
1076 def: InstRW<[HWWriteResGroup25], (instregex "SAR(8|16|32|64)m(1|i)",
1077 "SHL(8|16|32|64)m(1|i)",
1078 "SHR(8|16|32|64)m(1|i)")>;
1080 def HWWriteResGroup26 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort0156]> {
1082 let NumMicroOps = 4;
1083 let ResourceCycles = [1,1,1,1];
1085 def: InstRW<[HWWriteResGroup26], (instregex "POP(16|32|64)rmm",
1086 "PUSH(16|32|64)rmm")>;
1088 def HWWriteResGroup28 : SchedWriteRes<[HWPort01]> {
1090 let NumMicroOps = 2;
1091 let ResourceCycles = [2];
1093 def: InstRW<[HWWriteResGroup28], (instrs FDECSTP)>;
1095 def HWWriteResGroup30 : SchedWriteRes<[HWPort0156]> {
1097 let NumMicroOps = 2;
1098 let ResourceCycles = [2];
1100 def: InstRW<[HWWriteResGroup30], (instrs LFENCE,
1105 def HWWriteResGroup31 : SchedWriteRes<[HWPort0,HWPort5]> {
1107 let NumMicroOps = 2;
1108 let ResourceCycles = [1,1];
1110 def: InstRW<[HWWriteResGroup31], (instregex "(V?)CVTPS2PDrr",
1113 def HWWriteResGroup32 : SchedWriteRes<[HWPort6,HWPort0156]> {
1115 let NumMicroOps = 2;
1116 let ResourceCycles = [1,1];
1118 def: InstRW<[HWWriteResGroup32], (instregex "CLFLUSH")>;
1120 def HWWriteResGroup33 : SchedWriteRes<[HWPort01,HWPort015]> {
1122 let NumMicroOps = 2;
1123 let ResourceCycles = [1,1];
1125 def: InstRW<[HWWriteResGroup33], (instrs MMX_MOVDQ2Qrr)>;
1127 def HWWriteResGroup35 : SchedWriteRes<[HWPort06,HWPort0156]> {
1129 let NumMicroOps = 2;
1130 let ResourceCycles = [1,1];
1132 def: InstRW<[HWWriteResGroup35], (instrs CWD, JCXZ, JECXZ, JRCXZ)>;
1134 def HWWriteResGroup36_2 : SchedWriteRes<[HWPort5,HWPort23]> {
1136 let NumMicroOps = 3;
1137 let ResourceCycles = [2,1];
1139 def: InstRW<[HWWriteResGroup36_2], (instrs MMX_PACKSSDWirm,
1143 def HWWriteResGroup37 : SchedWriteRes<[HWPort23,HWPort0156]> {
1145 let NumMicroOps = 3;
1146 let ResourceCycles = [1,2];
1148 def: InstRW<[HWWriteResGroup37], (instrs LEAVE, LEAVE64,
1149 SCASB, SCASL, SCASQ, SCASW)>;
1151 def HWWriteResGroup39 : SchedWriteRes<[HWPort0,HWPort01,HWPort23]> {
1153 let NumMicroOps = 3;
1154 let ResourceCycles = [1,1,1];
1156 def: InstRW<[HWWriteResGroup39], (instrs FLDCW16m)>;
1158 def HWWriteResGroup41 : SchedWriteRes<[HWPort6,HWPort23,HWPort0156]> {
1160 let NumMicroOps = 3;
1161 let ResourceCycles = [1,1,1];
1163 def: InstRW<[HWWriteResGroup41], (instrs LRETQ, RETL, RETQ)>;
1165 def HWWriteResGroup44 : SchedWriteRes<[HWPort4,HWPort6,HWPort237,HWPort0156]> {
1167 let NumMicroOps = 4;
1168 let ResourceCycles = [1,1,1,1];
1170 def: InstRW<[HWWriteResGroup44], (instregex "CALL(16|32|64)r")>;
1172 def HWWriteResGroup45 : SchedWriteRes<[HWPort4,HWPort237,HWPort06,HWPort0156]> {
1174 let NumMicroOps = 4;
1175 let ResourceCycles = [1,1,1,1];
1177 def: InstRW<[HWWriteResGroup45], (instrs CALL64pcrel32)>;
1179 def HWWriteResGroup46 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort06]> {
1181 let NumMicroOps = 5;
1182 let ResourceCycles = [1,1,1,2];
1184 def: InstRW<[HWWriteResGroup46], (instregex "ROL(8|16|32|64)m(1|i)",
1185 "ROR(8|16|32|64)m(1|i)")>;
1187 def HWWriteResGroup46_1 : SchedWriteRes<[HWPort06]> {
1189 let NumMicroOps = 2;
1190 let ResourceCycles = [2];
1192 def: InstRW<[HWWriteResGroup46_1], (instrs ROL8r1, ROL16r1, ROL32r1, ROL64r1,
1193 ROR8r1, ROR16r1, ROR32r1, ROR64r1)>;
1195 def HWWriteResGroup47 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort0156]> {
1197 let NumMicroOps = 5;
1198 let ResourceCycles = [1,1,1,2];
1200 def: InstRW<[HWWriteResGroup47], (instregex "XADD(8|16|32|64)rm")>;
1202 def HWWriteResGroup48 : SchedWriteRes<[HWPort4,HWPort6,HWPort23,HWPort237,HWPort0156]> {
1204 let NumMicroOps = 5;
1205 let ResourceCycles = [1,1,1,1,1];
1207 def: InstRW<[HWWriteResGroup48], (instregex "CALL(16|32|64)m")>;
1208 def: InstRW<[HWWriteResGroup48], (instrs FARCALL64)>;
1210 def HWWriteResGroup50 : SchedWriteRes<[HWPort1]> {
1212 let NumMicroOps = 1;
1213 let ResourceCycles = [1];
1215 def: InstRW<[HWWriteResGroup50], (instrs MMX_CVTPI2PSirr)>;
1216 def: InstRW<[HWWriteResGroup50], (instregex "P(DEP|EXT)(32|64)rr",
1217 "(V?)CVTDQ2PS(Y?)rr")>;
1219 def HWWriteResGroup51 : SchedWriteRes<[HWPort5]> {
1221 let NumMicroOps = 1;
1222 let ResourceCycles = [1];
1224 def: InstRW<[HWWriteResGroup51], (instregex "VPBROADCAST(B|W)rr")>;
1226 def HWWriteResGroup52 : SchedWriteRes<[HWPort1,HWPort23]> {
1228 let NumMicroOps = 2;
1229 let ResourceCycles = [1,1];
1231 def: InstRW<[HWWriteResGroup52], (instregex "(V?)CVTPS2DQrm",
1232 "(V?)CVTTPS2DQrm")>;
1234 def HWWriteResGroup52_1 : SchedWriteRes<[HWPort1,HWPort23]> {
1236 let NumMicroOps = 2;
1237 let ResourceCycles = [1,1];
1239 def: InstRW<[HWWriteResGroup52_1], (instregex "(ADD|SUB|SUBR)_F(32|64)m",
1240 "ILD_F(16|32|64)m")>;
1241 def: InstRW<[HWWriteResGroup52_1], (instrs VCVTDQ2PSYrm,
1245 def HWWriteResGroup53_1 : SchedWriteRes<[HWPort5,HWPort23]> {
1247 let NumMicroOps = 2;
1248 let ResourceCycles = [1,1];
1250 def: InstRW<[HWWriteResGroup53_1], (instrs VPMOVSXBWYrm,
1255 def HWWriteResGroup57 : SchedWriteRes<[HWPort5,HWPort0156]> {
1257 let NumMicroOps = 3;
1258 let ResourceCycles = [2,1];
1260 def: InstRW<[HWWriteResGroup57], (instrs MMX_PACKSSDWirr,
1264 def HWWriteResGroup58 : SchedWriteRes<[HWPort6,HWPort0156]> {
1266 let NumMicroOps = 3;
1267 let ResourceCycles = [1,2];
1269 def: InstRW<[HWWriteResGroup58], (instregex "CLD")>;
1271 def HWWriteResGroup59 : SchedWriteRes<[HWPort06,HWPort0156]> {
1273 let NumMicroOps = 3;
1274 let ResourceCycles = [1,2];
1276 def: InstRW<[HWWriteResGroup59], (instregex "RCL(8|16|32|64)r(1|i)",
1277 "RCR(8|16|32|64)r(1|i)")>;
1279 def HWWriteResGroup61 : SchedWriteRes<[HWPort0,HWPort4,HWPort237]> {
1281 let NumMicroOps = 3;
1282 let ResourceCycles = [1,1,1];
1284 def: InstRW<[HWWriteResGroup61], (instrs FNSTSWm)>;
1286 def HWWriteResGroup62 : SchedWriteRes<[HWPort1,HWPort4,HWPort237]> {
1288 let NumMicroOps = 3;
1289 let ResourceCycles = [1,1,1];
1291 def: InstRW<[HWWriteResGroup62], (instregex "IST(T?)_FP(16|32|64)m",
1294 def HWWriteResGroup66 : SchedWriteRes<[HWPort23,HWPort237,HWPort06,HWPort0156]> {
1296 let NumMicroOps = 5;
1297 let ResourceCycles = [1,1,1,2];
1299 def: InstRW<[HWWriteResGroup66], (instregex "RCL(8|16|32|64)m(1|i)",
1300 "RCR(8|16|32|64)m(1|i)")>;
1302 def HWWriteResGroup68 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort0156]> {
1304 let NumMicroOps = 6;
1305 let ResourceCycles = [1,1,1,3];
1307 def: InstRW<[HWWriteResGroup68], (instregex "XCHG(8|16|32|64)rm")>;
1309 def HWWriteResGroup69 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort06,HWPort0156]> {
1311 let NumMicroOps = 6;
1312 let ResourceCycles = [1,1,1,2,1];
1314 def: InstRW<[HWWriteResGroup69], (instregex "ROL(8|16|32|64)mCL",
1315 "ROR(8|16|32|64)mCL",
1316 "SAR(8|16|32|64)mCL",
1317 "SHL(8|16|32|64)mCL",
1318 "SHR(8|16|32|64)mCL")>;
1319 def: SchedAlias<WriteADCRMW, HWWriteResGroup69>;
1321 def HWWriteResGroup70 : SchedWriteRes<[HWPort0,HWPort1]> {
1323 let NumMicroOps = 2;
1324 let ResourceCycles = [1,1];
1326 def: InstRW<[HWWriteResGroup70], (instregex "(V?)CVT(T?)SD2SI(64)?rr",
1327 "(V?)CVT(T?)SS2SI(64)?rr")>;
1329 def HWWriteResGroup71 : SchedWriteRes<[HWPort0,HWPort5]> {
1331 let NumMicroOps = 2;
1332 let ResourceCycles = [1,1];
1334 def: InstRW<[HWWriteResGroup71], (instrs VCVTPS2PDYrr)>;
1336 def HWWriteResGroup72 : SchedWriteRes<[HWPort0,HWPort0156]> {
1338 let NumMicroOps = 2;
1339 let ResourceCycles = [1,1];
1341 def: InstRW<[HWWriteResGroup72], (instrs FNSTSW16r)>;
1343 def HWWriteResGroup73 : SchedWriteRes<[HWPort1,HWPort5]> {
1345 let NumMicroOps = 2;
1346 let ResourceCycles = [1,1];
1348 def: InstRW<[HWWriteResGroup73], (instrs MMX_CVTPI2PDirr,
1353 def: InstRW<[HWWriteResGroup73], (instregex "(V?)CVTDQ2PDrr",
1356 "(V?)CVTSI(64)?2SDrr",
1358 "(V?)CVT(T?)PD2DQrr")>;
1360 def HWWriteResGroup75 : SchedWriteRes<[HWPort1,HWPort23]> {
1362 let NumMicroOps = 3;
1363 let ResourceCycles = [2,1];
1365 def: InstRW<[HWWriteResGroup75], (instregex "FICOM(P?)(16|32)m")>;
1367 def HWWriteResGroup76 : SchedWriteRes<[HWPort0,HWPort1,HWPort23]> {
1369 let NumMicroOps = 3;
1370 let ResourceCycles = [1,1,1];
1372 def: InstRW<[HWWriteResGroup76], (instregex "(V?)CVTSD2SI(64)?rm",
1373 "(V?)CVTSS2SI(64)?rm",
1374 "(V?)CVTTSD2SI(64)?rm",
1376 "(V?)CVTTSS2SIrm")>;
1378 def HWWriteResGroup77 : SchedWriteRes<[HWPort0,HWPort5,HWPort23]> {
1380 let NumMicroOps = 3;
1381 let ResourceCycles = [1,1,1];
1383 def: InstRW<[HWWriteResGroup77], (instrs VCVTPS2PDYrm)>;
1385 def HWWriteResGroup78 : SchedWriteRes<[HWPort1,HWPort5,HWPort23]> {
1387 let NumMicroOps = 3;
1388 let ResourceCycles = [1,1,1];
1390 def: InstRW<[HWWriteResGroup78], (instrs CVTPD2PSrm,
1398 def HWWriteResGroup78_1 : SchedWriteRes<[HWPort1,HWPort5,HWPort23]> {
1400 let NumMicroOps = 3;
1401 let ResourceCycles = [1,1,1];
1403 def: InstRW<[HWWriteResGroup78_1], (instrs MMX_CVTPI2PDirm,
1404 CVTSD2SSrm, CVTSD2SSrm_Int,
1405 VCVTSD2SSrm, VCVTSD2SSrm_Int)>;
1407 def HWWriteResGroup80 : SchedWriteRes<[HWPort5,HWPort23,HWPort015]> {
1409 let NumMicroOps = 3;
1410 let ResourceCycles = [1,1,1];
1412 def: InstRW<[HWWriteResGroup80], (instregex "VPBROADCAST(B|W)(Y?)rm")>;
1414 def HWWriteResGroup81 : SchedWriteRes<[HWPort0156]> {
1416 let NumMicroOps = 4;
1417 let ResourceCycles = [4];
1419 def: InstRW<[HWWriteResGroup81], (instrs FNCLEX)>;
1421 def HWWriteResGroup82 : SchedWriteRes<[]> {
1423 let NumMicroOps = 4;
1424 let ResourceCycles = [];
1426 def: InstRW<[HWWriteResGroup82], (instrs VZEROUPPER)>;
1428 def HWWriteResGroup83 : SchedWriteRes<[HWPort1,HWPort6,HWPort0156]> {
1430 let NumMicroOps = 4;
1431 let ResourceCycles = [1,1,2];
1433 def: InstRW<[HWWriteResGroup83], (instregex "LAR(16|32|64)rr")>;
1435 def HWWriteResGroup87 : SchedWriteRes<[HWPort1,HWPort6,HWPort23,HWPort0156]> {
1437 let NumMicroOps = 5;
1438 let ResourceCycles = [1,2,1,1];
1440 def: InstRW<[HWWriteResGroup87], (instregex "LAR(16|32|64)rm",
1441 "LSL(16|32|64)rm")>;
1443 def HWWriteResGroup88 : SchedWriteRes<[HWPort4,HWPort237,HWPort0156]> {
1445 let NumMicroOps = 6;
1446 let ResourceCycles = [1,1,4];
1448 def: InstRW<[HWWriteResGroup88], (instregex "PUSHF(16|64)")>;
1450 def HWWriteResGroup89 : SchedWriteRes<[HWPort0]> {
1452 let NumMicroOps = 1;
1453 let ResourceCycles = [1];
1455 def: InstRW<[HWWriteResGroup89], (instregex "MUL_(FPrST0|FST0r|FrST0)")>;
1457 def HWWriteResGroup91_2 : SchedWriteRes<[HWPort0,HWPort23]> {
1459 let NumMicroOps = 2;
1460 let ResourceCycles = [1,1];
1462 def: InstRW<[HWWriteResGroup91_2], (instregex "(V?)PCMPGTQrm")>;
1464 def HWWriteResGroup91_3 : SchedWriteRes<[HWPort0,HWPort23]> {
1466 let NumMicroOps = 2;
1467 let ResourceCycles = [1,1];
1469 def: InstRW<[HWWriteResGroup91_3], (instregex "MUL_F(32|64)m")>;
1470 def: InstRW<[HWWriteResGroup91_3], (instrs VPCMPGTQYrm)>;
1472 def HWWriteResGroup93 : SchedWriteRes<[HWPort1,HWPort5]> {
1474 let NumMicroOps = 3;
1475 let ResourceCycles = [1,2];
1477 def: InstRW<[HWWriteResGroup93], (instregex "(V?)CVTSI642SSrr")>;
1479 def HWWriteResGroup94 : SchedWriteRes<[HWPort1,HWPort6,HWPort06]> {
1481 let NumMicroOps = 3;
1482 let ResourceCycles = [1,1,1];
1484 def: InstRW<[HWWriteResGroup94], (instregex "STR(16|32|64)r")>;
1486 def HWWriteResGroup97 : SchedWriteRes<[HWPort0,HWPort1,HWPort5,HWPort23]> {
1488 let NumMicroOps = 4;
1489 let ResourceCycles = [1,1,1,1];
1491 def: InstRW<[HWWriteResGroup97], (instregex "CVTTSS2SI64rm")>;
1493 def HWWriteResGroup99 : SchedWriteRes<[HWPort6,HWPort0156]> {
1495 let NumMicroOps = 5;
1496 let ResourceCycles = [1,4];
1498 def: InstRW<[HWWriteResGroup99], (instrs PAUSE)>;
1500 def HWWriteResGroup100 : SchedWriteRes<[HWPort06,HWPort0156]> {
1502 let NumMicroOps = 5;
1503 let ResourceCycles = [1,4];
1505 def: InstRW<[HWWriteResGroup100], (instrs XSETBV)>;
1507 def HWWriteResGroup102 : SchedWriteRes<[HWPort1,HWPort5]> {
1509 let NumMicroOps = 2;
1510 let ResourceCycles = [1,1];
1512 def: InstRW<[HWWriteResGroup102], (instrs VCVTDQ2PDYrr,
1517 def HWWriteResGroup103 : SchedWriteRes<[HWPort1,HWPort23]> {
1519 let NumMicroOps = 3;
1520 let ResourceCycles = [2,1];
1522 def: InstRW<[HWWriteResGroup103], (instregex "(ADD|SUB|SUBR)_FI(16|32)m")>;
1524 def HWWriteResGroup104 : SchedWriteRes<[HWPort1,HWPort5,HWPort23]> {
1526 let NumMicroOps = 3;
1527 let ResourceCycles = [1,1,1];
1529 def: InstRW<[HWWriteResGroup104], (instrs VCVTDQ2PDYrm)>;
1531 def HWWriteResGroup107 : SchedWriteRes<[HWPort1,HWPort6,HWPort06,HWPort0156]> {
1533 let NumMicroOps = 4;
1534 let ResourceCycles = [1,1,1,1];
1536 def: InstRW<[HWWriteResGroup107], (instregex "SLDT(16|32|64)r")>;
1538 def HWWriteResGroup108 : SchedWriteRes<[HWPort6,HWPort0156]> {
1540 let NumMicroOps = 6;
1541 let ResourceCycles = [1,5];
1543 def: InstRW<[HWWriteResGroup108], (instrs STD)>;
1545 def HWWriteResGroup114 : SchedWriteRes<[HWPort6,HWPort06,HWPort15,HWPort0156]> {
1547 let NumMicroOps = 7;
1548 let ResourceCycles = [2,2,1,2];
1550 def: InstRW<[HWWriteResGroup114], (instrs LOOP)>;
1552 def HWWriteResGroup115 : SchedWriteRes<[HWPort0,HWPort1,HWPort23]> {
1554 let NumMicroOps = 3;
1555 let ResourceCycles = [1,1,1];
1557 def: InstRW<[HWWriteResGroup115], (instregex "MUL_FI(16|32)m")>;
1559 def HWWriteResGroup120 : SchedWriteRes<[HWPort1,HWPort23,HWPort237,HWPort06,HWPort15,HWPort0156]> {
1561 let NumMicroOps = 10;
1562 let ResourceCycles = [1,1,1,4,1,2];
1564 def: InstRW<[HWWriteResGroup120], (instregex "RCL(8|16|32|64)mCL")>;
1566 def HWWriteResGroup129 : SchedWriteRes<[HWPort1,HWPort06,HWPort0156]> {
1568 let NumMicroOps = 7;
1569 let ResourceCycles = [2,2,3];
1571 def: InstRW<[HWWriteResGroup129], (instregex "RCL(16|32|64)rCL",
1572 "RCR(16|32|64)rCL")>;
1574 def HWWriteResGroup130 : SchedWriteRes<[HWPort1,HWPort06,HWPort15,HWPort0156]> {
1576 let NumMicroOps = 9;
1577 let ResourceCycles = [1,4,1,3];
1579 def: InstRW<[HWWriteResGroup130], (instrs RCL8rCL)>;
1581 def HWWriteResGroup131 : SchedWriteRes<[HWPort06,HWPort0156]> {
1583 let NumMicroOps = 11;
1584 let ResourceCycles = [2,9];
1586 def: InstRW<[HWWriteResGroup131], (instrs LOOPE, LOOPNE)>;
1588 def HWWriteResGroup132 : SchedWriteRes<[HWPort4,HWPort23,HWPort237,HWPort06,HWPort15,HWPort0156]> {
1590 let NumMicroOps = 14;
1591 let ResourceCycles = [1,1,1,4,2,5];
1593 def: InstRW<[HWWriteResGroup132], (instrs CMPXCHG8B)>;
1595 def HWWriteResGroup135 : SchedWriteRes<[HWPort1,HWPort23,HWPort237,HWPort06,HWPort15,HWPort0156]> {
1597 let NumMicroOps = 11;
1598 let ResourceCycles = [2,1,1,3,1,3];
1600 def: InstRW<[HWWriteResGroup135], (instregex "RCR(8|16|32|64)mCL")>;
1602 def HWWriteResGroup142 : SchedWriteRes<[HWPort1,HWPort06,HWPort15,HWPort0156]> {
1604 let NumMicroOps = 10;
1605 let ResourceCycles = [2,3,1,4];
1607 def: InstRW<[HWWriteResGroup142], (instrs RCR8rCL)>;
1609 def HWWriteResGroup143 : SchedWriteRes<[HWPort23,HWPort0156]> {
1611 let NumMicroOps = 15;
1612 let ResourceCycles = [1,14];
1614 def: InstRW<[HWWriteResGroup143], (instrs POPF16)>;
1616 def HWWriteResGroup144 : SchedWriteRes<[HWPort4,HWPort5,HWPort6,HWPort23,HWPort237,HWPort06,HWPort0156]> {
1618 let NumMicroOps = 8;
1619 let ResourceCycles = [1,1,1,1,1,1,2];
1621 def: InstRW<[HWWriteResGroup144], (instrs INSB, INSL, INSW)>;
1623 def HWWriteResGroup145 : SchedWriteRes<[HWPort5, HWPort6]> {
1625 let NumMicroOps = 20;
1626 let ResourceCycles = [1,1];
1628 def: InstRW<[HWWriteResGroup145], (instrs VZEROALL)>;
1630 def HWWriteResGroup146 : SchedWriteRes<[HWPort0,HWPort4,HWPort5,HWPort23,HWPort237,HWPort06,HWPort0156]> {
1632 let NumMicroOps = 19;
1633 let ResourceCycles = [2,1,4,1,1,4,6];
1635 def: InstRW<[HWWriteResGroup146], (instrs CMPXCHG16B)>;
1637 def HWWriteResGroup147 : SchedWriteRes<[HWPort0,HWPort1,HWPort5,HWPort6,HWPort01,HWPort0156]> {
1639 let NumMicroOps = 15;
1640 let ResourceCycles = [2,1,2,4,2,4];
1642 def: InstRW<[HWWriteResGroup147], (instrs XCH_F)>;
1644 def HWWriteResGroup149 : SchedWriteRes<[HWPort5,HWPort6,HWPort06,HWPort0156]> {
1646 let NumMicroOps = 8;
1647 let ResourceCycles = [1,1,1,5];
1649 def: InstRW<[HWWriteResGroup149], (instrs CPUID, RDTSC)>;
1651 def HWWriteResGroup151 : SchedWriteRes<[HWPort6,HWPort23,HWPort0156]> {
1653 let NumMicroOps = 19;
1654 let ResourceCycles = [3,1,15];
1656 def: InstRW<[HWWriteResGroup151], (instregex "XRSTOR(64)?")>;
1658 def HWWriteResGroup154 : SchedWriteRes<[HWPort0]> {
1660 let NumMicroOps = 1;
1661 let ResourceCycles = [1];
1663 def: InstRW<[HWWriteResGroup154], (instregex "DIV_(FPrST0|FST0r|FrST0)")>;
1665 def HWWriteResGroup155 : SchedWriteRes<[HWPort0,HWPort23]> {
1667 let NumMicroOps = 2;
1668 let ResourceCycles = [1,1];
1670 def: InstRW<[HWWriteResGroup155], (instregex "DIVR_F(32|64)m")>;
1672 def HWWriteResGroup156 : SchedWriteRes<[HWPort5,HWPort6,HWPort0156]> {
1674 let NumMicroOps = 10;
1675 let ResourceCycles = [1,2,7];
1677 def: InstRW<[HWWriteResGroup156], (instrs MWAITrr)>;
1679 def HWWriteResGroup161 : SchedWriteRes<[HWPort0,HWPort1,HWPort23]> {
1681 let NumMicroOps = 3;
1682 let ResourceCycles = [1,1,1];
1684 def: InstRW<[HWWriteResGroup161], (instregex "DIVR_FI(16|32)m")>;
1686 def HWWriteResGroup162 : SchedWriteRes<[HWPort0]> {
1688 let NumMicroOps = 1;
1689 let ResourceCycles = [1];
1691 def: InstRW<[HWWriteResGroup162], (instregex "DIVR_(FPrST0|FST0r|FrST0)")>;
1693 def HWWriteResGroup163 : SchedWriteRes<[HWPort0,HWPort23]> {
1695 let NumMicroOps = 2;
1696 let ResourceCycles = [1,1];
1698 def: InstRW<[HWWriteResGroup163], (instregex "DIV_F(32|64)m")>;
1700 def HWWriteResGroup164 : SchedWriteRes<[HWPort4,HWPort6,HWPort23,HWPort237,HWPort0156]> {
1702 let NumMicroOps = 27;
1703 let ResourceCycles = [1,5,1,1,19];
1705 def: InstRW<[HWWriteResGroup164], (instrs XSAVE64)>;
1707 def HWWriteResGroup165 : SchedWriteRes<[HWPort4,HWPort6,HWPort23,HWPort237,HWPort0156]> {
1709 let NumMicroOps = 28;
1710 let ResourceCycles = [1,6,1,1,19];
1712 def: InstRW<[HWWriteResGroup165], (instrs XSAVE)>;
1713 def: InstRW<[HWWriteResGroup165], (instregex "XSAVEC", "XSAVES", "XSAVEOPT")>;
1715 def HWWriteResGroup166 : SchedWriteRes<[HWPort0,HWPort1,HWPort23]> {
1717 let NumMicroOps = 3;
1718 let ResourceCycles = [1,1,1];
1720 def: InstRW<[HWWriteResGroup166], (instregex "DIV_FI(16|32)m")>;
1722 def HWWriteResGroup170 : SchedWriteRes<[HWPort5,HWPort6,HWPort23,HWPort06,HWPort0156]> {
1724 let NumMicroOps = 23;
1725 let ResourceCycles = [1,5,3,4,10];
1727 def: InstRW<[HWWriteResGroup170], (instregex "IN(8|16|32)ri",
1730 def HWWriteResGroup171 : SchedWriteRes<[HWPort5,HWPort6,HWPort23,HWPort237,HWPort06,HWPort0156]> {
1732 let NumMicroOps = 23;
1733 let ResourceCycles = [1,5,2,1,4,10];
1735 def: InstRW<[HWWriteResGroup171], (instregex "OUT(8|16|32)ir",
1738 def HWWriteResGroup175 : SchedWriteRes<[HWPort1,HWPort4,HWPort5,HWPort6,HWPort23,HWPort237,HWPort15,HWPort0156]> {
1740 let NumMicroOps = 18;
1741 let ResourceCycles = [1,1,2,3,1,1,1,8];
1743 def: InstRW<[HWWriteResGroup175], (instrs VMCLEARm)>;
1745 def HWWriteResGroup176 : SchedWriteRes<[HWPort5,HWPort0156]> {
1747 let NumMicroOps = 22;
1748 let ResourceCycles = [2,20];
1750 def: InstRW<[HWWriteResGroup176], (instrs RDTSCP)>;
1752 def HWWriteResGroup177 : SchedWriteRes<[HWPort0,HWPort01,HWPort23,HWPort05,HWPort06,HWPort015,HWPort0156]> {
1754 let NumMicroOps = 64;
1755 let ResourceCycles = [2,2,8,1,10,2,39];
1757 def: InstRW<[HWWriteResGroup177], (instrs FLDENVm)>;
1759 def HWWriteResGroup178 : SchedWriteRes<[HWPort0,HWPort6,HWPort23,HWPort05,HWPort06,HWPort15,HWPort0156]> {
1761 let NumMicroOps = 88;
1762 let ResourceCycles = [4,4,31,1,2,1,45];
1764 def: InstRW<[HWWriteResGroup178], (instrs FXRSTOR64)>;
1766 def HWWriteResGroup179 : SchedWriteRes<[HWPort0,HWPort6,HWPort23,HWPort05,HWPort06,HWPort15,HWPort0156]> {
1768 let NumMicroOps = 90;
1769 let ResourceCycles = [4,2,33,1,2,1,47];
1771 def: InstRW<[HWWriteResGroup179], (instrs FXRSTOR)>;
1773 def HWWriteResGroup180 : SchedWriteRes<[HWPort5,HWPort01,HWPort0156]> {
1775 let NumMicroOps = 15;
1776 let ResourceCycles = [6,3,6];
1778 def: InstRW<[HWWriteResGroup180], (instrs FNINIT)>;
1780 def HWWriteResGroup183 : SchedWriteRes<[HWPort0,HWPort1,HWPort4,HWPort5,HWPort6,HWPort237,HWPort06,HWPort0156]> {
1782 let NumMicroOps = 100;
1783 let ResourceCycles = [9,9,11,8,1,11,21,30];
1785 def: InstRW<[HWWriteResGroup183], (instrs FSTENVm)>;
1787 def HWWriteResGroup184 : SchedWriteRes<[HWPort0, HWPort5, HWPort15, HWPort015, HWPort06, HWPort23]> {
1789 let NumMicroOps = 12;
1790 let ResourceCycles = [2,2,1,3,2,2];
1792 def: InstRW<[HWWriteResGroup184], (instrs VGATHERDPDrm,
1796 def HWWriteResGroup185 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1798 let NumMicroOps = 22;
1799 let ResourceCycles = [5,3,4,1,5,4];
1801 def: InstRW<[HWWriteResGroup185], (instrs VGATHERQPDYrm,
1804 def HWWriteResGroup186 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1806 let NumMicroOps = 22;
1807 let ResourceCycles = [5,3,4,1,5,4];
1809 def: InstRW<[HWWriteResGroup186], (instrs VPGATHERQDYrm)>;
1811 def HWWriteResGroup187 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1813 let NumMicroOps = 22;
1814 let ResourceCycles = [5,3,4,1,5,4];
1816 def: InstRW<[HWWriteResGroup187], (instrs VPGATHERQDrm)>;
1818 def HWWriteResGroup188 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1820 let NumMicroOps = 20;
1821 let ResourceCycles = [3,3,4,1,5,4];
1823 def: InstRW<[HWWriteResGroup188], (instrs VGATHERDPDYrm,
1826 def HWWriteResGroup189 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1828 let NumMicroOps = 34;
1829 let ResourceCycles = [5,3,8,1,9,8];
1831 def: InstRW<[HWWriteResGroup189], (instrs VGATHERDPSYrm,
1834 def HWWriteResGroup190 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1836 let NumMicroOps = 14;
1837 let ResourceCycles = [3,3,2,1,3,2];
1839 def: InstRW<[HWWriteResGroup190], (instrs VGATHERQPDrm,
1842 def HWWriteResGroup191 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1844 let NumMicroOps = 15;
1845 let ResourceCycles = [3,3,2,1,4,2];
1847 def: InstRW<[HWWriteResGroup191], (instrs VGATHERQPSYrm)>;
1849 def HWWriteResGroup192 : SchedWriteRes<[HWPort0, HWPort5, HWPort06, HWPort15, HWPort015, HWPort23]> {
1851 let NumMicroOps = 15;
1852 let ResourceCycles = [3,3,2,1,4,2];
1854 def: InstRW<[HWWriteResGroup192], (instrs VGATHERQPSrm,
1857 def: InstRW<[WriteZero], (instrs CLC)>;
1860 // Intruction variants handled by the renamer. These might not need execution
1861 // ports in certain conditions.
1862 // See Agner's Fog "The microarchitecture of Intel, AMD and VIA CPUs",
1863 // section "Haswell and Broadwell Pipeline" > "Register allocation and
1865 // These can be investigated with llvm-exegesis, e.g.
1866 // echo 'pxor %mm0, %mm0' | /tmp/llvm-exegesis -mode=uops -snippets-file=-
1867 // echo 'vxorpd %xmm0, %xmm0, %xmm1' | /tmp/llvm-exegesis -mode=uops -snippets-file=-
1869 def HWWriteZeroLatency : SchedWriteRes<[]> {
1873 def HWWriteZeroIdiom : SchedWriteVariant<[
1874 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [HWWriteZeroLatency]>,
1875 SchedVar<NoSchedPred, [WriteALU]>
1877 def : InstRW<[HWWriteZeroIdiom], (instrs SUB32rr, SUB64rr,
1880 def HWWriteFZeroIdiom : SchedWriteVariant<[
1881 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [HWWriteZeroLatency]>,
1882 SchedVar<NoSchedPred, [WriteFLogic]>
1884 def : InstRW<[HWWriteFZeroIdiom], (instrs XORPSrr, VXORPSrr, XORPDrr,
1887 def HWWriteFZeroIdiomY : SchedWriteVariant<[
1888 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [HWWriteZeroLatency]>,
1889 SchedVar<NoSchedPred, [WriteFLogicY]>
1891 def : InstRW<[HWWriteFZeroIdiomY], (instrs VXORPSYrr, VXORPDYrr)>;
1893 def HWWriteVZeroIdiomLogicX : SchedWriteVariant<[
1894 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [HWWriteZeroLatency]>,
1895 SchedVar<NoSchedPred, [WriteVecLogicX]>
1897 def : InstRW<[HWWriteVZeroIdiomLogicX], (instrs PXORrr, VPXORrr)>;
1899 def HWWriteVZeroIdiomLogicY : SchedWriteVariant<[
1900 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [HWWriteZeroLatency]>,
1901 SchedVar<NoSchedPred, [WriteVecLogicY]>
1903 def : InstRW<[HWWriteVZeroIdiomLogicY], (instrs VPXORYrr)>;
1905 def HWWriteVZeroIdiomALUX : SchedWriteVariant<[
1906 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [HWWriteZeroLatency]>,
1907 SchedVar<NoSchedPred, [WriteVecALUX]>
1909 def : InstRW<[HWWriteVZeroIdiomALUX], (instrs PSUBBrr, VPSUBBrr,
1913 PCMPGTBrr, VPCMPGTBrr,
1914 PCMPGTDrr, VPCMPGTDrr,
1915 PCMPGTWrr, VPCMPGTWrr)>;
1917 def HWWriteVZeroIdiomALUY : SchedWriteVariant<[
1918 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [HWWriteZeroLatency]>,
1919 SchedVar<NoSchedPred, [WriteVecALUY]>
1921 def : InstRW<[HWWriteVZeroIdiomALUY], (instrs VPSUBBYrr,
1929 def HWWritePCMPGTQ : SchedWriteRes<[HWPort0]> {
1931 let NumMicroOps = 1;
1932 let ResourceCycles = [1];
1935 def HWWriteVZeroIdiomPCMPGTQ : SchedWriteVariant<[
1936 SchedVar<MCSchedPredicate<ZeroIdiomPredicate>, [HWWriteZeroLatency]>,
1937 SchedVar<NoSchedPred, [HWWritePCMPGTQ]>
1939 def : InstRW<[HWWriteVZeroIdiomPCMPGTQ], (instrs PCMPGTQrr, VPCMPGTQrr,
1943 // The 0x83 ADC/SBB opcodes have special support for immediate 0 to only require
1944 // a single uop. It does not apply to the GR8 encoding. And only applies to the
1945 // 8-bit immediate since using larger immediate for 0 would be silly.
1946 // Unfortunately, this optimization does not apply to the AX/EAX/RAX short
1947 // encodings we convert to in MCInstLowering so we exclude AX/EAX/RAX here since
1948 // we schedule before that point.
1949 // TODO: Should we disable using the short encodings on these CPUs?
1950 def HWFastADC0 : MCSchedPredicate<
1952 CheckImmOperand<2, 0>, // Second MCOperand is Imm and has value 0.
1953 CheckNot<CheckRegOperand<1, AX>>, // First MCOperand is not register AX
1954 CheckNot<CheckRegOperand<1, EAX>>, // First MCOperand is not register EAX
1955 CheckNot<CheckRegOperand<1, RAX>> // First MCOperand is not register RAX
1959 def HWWriteADC0 : SchedWriteRes<[HWPort06]> {
1961 let NumMicroOps = 1;
1962 let ResourceCycles = [1];
1965 def HWWriteADC : SchedWriteVariant<[
1966 SchedVar<HWFastADC0, [HWWriteADC0]>,
1967 SchedVar<NoSchedPred, [WriteADC]>
1970 def : InstRW<[HWWriteADC], (instrs ADC16ri8, ADC32ri8, ADC64ri8,
1971 SBB16ri8, SBB32ri8, SBB64ri8)>;
1973 // CMOVs that use both Z and C flag require an extra uop.
1974 def HWWriteCMOVA_CMOVBErr : SchedWriteRes<[HWPort06,HWPort0156]> {
1976 let ResourceCycles = [1,2];
1977 let NumMicroOps = 3;
1980 def HWWriteCMOVA_CMOVBErm : SchedWriteRes<[HWPort23,HWPort06,HWPort0156]> {
1982 let ResourceCycles = [1,1,2];
1983 let NumMicroOps = 4;
1986 def HWCMOVA_CMOVBErr : SchedWriteVariant<[
1987 SchedVar<MCSchedPredicate<IsCMOVArr_Or_CMOVBErr>, [HWWriteCMOVA_CMOVBErr]>,
1988 SchedVar<NoSchedPred, [WriteCMOV]>
1991 def HWCMOVA_CMOVBErm : SchedWriteVariant<[
1992 SchedVar<MCSchedPredicate<IsCMOVArm_Or_CMOVBErm>, [HWWriteCMOVA_CMOVBErm]>,
1993 SchedVar<NoSchedPred, [WriteCMOV.Folded]>
1996 def : InstRW<[HWCMOVA_CMOVBErr], (instrs CMOV16rr, CMOV32rr, CMOV64rr)>;
1997 def : InstRW<[HWCMOVA_CMOVBErm], (instrs CMOV16rm, CMOV32rm, CMOV64rm)>;
1999 // SETCCs that use both Z and C flag require an extra uop.
2000 def HWWriteSETA_SETBEr : SchedWriteRes<[HWPort06,HWPort0156]> {
2002 let ResourceCycles = [1,1];
2003 let NumMicroOps = 2;
2006 def HWWriteSETA_SETBEm : SchedWriteRes<[HWPort4,HWPort237,HWPort06,HWPort0156]> {
2008 let ResourceCycles = [1,1,1,1];
2009 let NumMicroOps = 4;
2012 def HWSETA_SETBErr : SchedWriteVariant<[
2013 SchedVar<MCSchedPredicate<IsSETAr_Or_SETBEr>, [HWWriteSETA_SETBEr]>,
2014 SchedVar<NoSchedPred, [WriteSETCC]>
2017 def HWSETA_SETBErm : SchedWriteVariant<[
2018 SchedVar<MCSchedPredicate<IsSETAm_Or_SETBEm>, [HWWriteSETA_SETBEm]>,
2019 SchedVar<NoSchedPred, [WriteSETCCStore]>
2022 def : InstRW<[HWSETA_SETBErr], (instrs SETCCr)>;
2023 def : InstRW<[HWSETA_SETBErm], (instrs SETCCm)>;