xref: /freebsd/contrib/llvm-project/llvm/lib/Target/X86/X86Schedule.td (revision 5e801ac66d24704442eba426ed13c3effb8a34e7)
1//===-- X86Schedule.td - X86 Scheduling Definitions --------*- tablegen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9//===----------------------------------------------------------------------===//
10// InstrSchedModel annotations for out-of-order CPUs.
11
12// Instructions with folded loads need to read the memory operand immediately,
13// but other register operands don't have to be read until the load is ready.
14// These operands are marked with ReadAfterLd.
15def ReadAfterLd : SchedRead;
16def ReadAfterVecLd : SchedRead;
17def ReadAfterVecXLd : SchedRead;
18def ReadAfterVecYLd : SchedRead;
19
20// Instructions that move data between general purpose registers and vector
21// registers may be subject to extra latency due to data bypass delays.
22// This SchedRead describes a bypass delay caused by data being moved from the
23// integer unit to the floating point unit.
24def ReadInt2Fpu : SchedRead;
25
26// Instructions with both a load and a store folded are modeled as a folded
27// load + WriteRMW.
28def WriteRMW : SchedWrite;
29
30// Helper to set SchedWrite ExePorts/Latency/ResourceCycles/NumMicroOps.
31multiclass X86WriteRes<SchedWrite SchedRW,
32                       list<ProcResourceKind> ExePorts,
33                       int Lat, list<int> Res, int UOps> {
34  def : WriteRes<SchedRW, ExePorts> {
35    let Latency = Lat;
36    let ResourceCycles = Res;
37    let NumMicroOps = UOps;
38  }
39}
40
41// Most instructions can fold loads, so almost every SchedWrite comes in two
42// variants: With and without a folded load.
43// An X86FoldableSchedWrite holds a reference to the corresponding SchedWrite
44// with a folded load.
45class X86FoldableSchedWrite : SchedWrite {
46  // The SchedWrite to use when a load is folded into the instruction.
47  SchedWrite Folded;
48  // The SchedRead to tag register operands than don't need to be ready
49  // until the folded load has completed.
50  SchedRead ReadAfterFold;
51}
52
53// Multiclass that produces a linked pair of SchedWrites.
54multiclass X86SchedWritePair<SchedRead ReadAfter = ReadAfterLd> {
55  // Register-Memory operation.
56  def Ld : SchedWrite;
57  // Register-Register operation.
58  def NAME : X86FoldableSchedWrite {
59    let Folded = !cast<SchedWrite>(NAME#"Ld");
60    let ReadAfterFold = ReadAfter;
61  }
62}
63
64// Helpers to mark SchedWrites as unsupported.
65multiclass X86WriteResUnsupported<SchedWrite SchedRW> {
66  let Unsupported = 1 in {
67    def : WriteRes<SchedRW, []>;
68  }
69}
70multiclass X86WriteResPairUnsupported<X86FoldableSchedWrite SchedRW> {
71  let Unsupported = 1 in {
72    def : WriteRes<SchedRW, []>;
73    def : WriteRes<SchedRW.Folded, []>;
74  }
75}
76
77// Multiclass that wraps X86FoldableSchedWrite for each vector width.
78class X86SchedWriteWidths<X86FoldableSchedWrite sScl,
79                          X86FoldableSchedWrite s128,
80                          X86FoldableSchedWrite s256,
81                          X86FoldableSchedWrite s512> {
82  X86FoldableSchedWrite Scl = sScl; // Scalar float/double operations.
83  X86FoldableSchedWrite MMX = sScl; // MMX operations.
84  X86FoldableSchedWrite XMM = s128; // XMM operations.
85  X86FoldableSchedWrite YMM = s256; // YMM operations.
86  X86FoldableSchedWrite ZMM = s512; // ZMM operations.
87}
88
89// Multiclass that wraps X86SchedWriteWidths for each fp vector type.
90class X86SchedWriteSizes<X86SchedWriteWidths sPH,
91                         X86SchedWriteWidths sPS,
92                         X86SchedWriteWidths sPD> {
93  X86SchedWriteWidths PH = sPH;
94  X86SchedWriteWidths PS = sPS;
95  X86SchedWriteWidths PD = sPD;
96}
97
98// Multiclass that wraps move/load/store triple for a vector width.
99class X86SchedWriteMoveLS<SchedWrite MoveRR,
100                          SchedWrite LoadRM,
101                          SchedWrite StoreMR> {
102  SchedWrite RR = MoveRR;
103  SchedWrite RM = LoadRM;
104  SchedWrite MR = StoreMR;
105}
106
107// Multiclass that wraps masked load/store writes for a vector width.
108class X86SchedWriteMaskMove<SchedWrite LoadRM, SchedWrite StoreMR> {
109  SchedWrite RM = LoadRM;
110  SchedWrite MR = StoreMR;
111}
112
113// Multiclass that wraps X86SchedWriteMoveLS for each vector width.
114class X86SchedWriteMoveLSWidths<X86SchedWriteMoveLS sScl,
115                                X86SchedWriteMoveLS s128,
116                                X86SchedWriteMoveLS s256,
117                                X86SchedWriteMoveLS s512> {
118  X86SchedWriteMoveLS Scl = sScl; // Scalar float/double operations.
119  X86SchedWriteMoveLS MMX = sScl; // MMX operations.
120  X86SchedWriteMoveLS XMM = s128; // XMM operations.
121  X86SchedWriteMoveLS YMM = s256; // YMM operations.
122  X86SchedWriteMoveLS ZMM = s512; // ZMM operations.
123}
124
125// Loads, stores, and moves, not folded with other operations.
126def WriteLoad    : SchedWrite;
127def WriteStore   : SchedWrite;
128def WriteStoreNT : SchedWrite;
129def WriteMove    : SchedWrite;
130def WriteVecMaskedGatherWriteback : SchedWrite;
131def WriteCopy    : WriteSequence<[WriteLoad, WriteStore]>; // mem->mem copy
132
133// Arithmetic.
134defm WriteALU    : X86SchedWritePair; // Simple integer ALU op.
135defm WriteADC    : X86SchedWritePair; // Integer ALU + flags op.
136def  WriteALURMW : WriteSequence<[WriteALULd, WriteRMW]>;
137def  WriteADCRMW : WriteSequence<[WriteADCLd, WriteRMW]>;
138def  WriteLEA    : SchedWrite;        // LEA instructions can't fold loads.
139
140// Integer multiplication
141defm WriteIMul8     : X86SchedWritePair; // Integer 8-bit multiplication.
142defm WriteIMul16    : X86SchedWritePair; // Integer 16-bit multiplication.
143defm WriteIMul16Imm : X86SchedWritePair; // Integer 16-bit multiplication by immediate.
144defm WriteIMul16Reg : X86SchedWritePair; // Integer 16-bit multiplication by register.
145defm WriteIMul32    : X86SchedWritePair; // Integer 32-bit multiplication.
146defm WriteIMul32Imm : X86SchedWritePair; // Integer 32-bit multiplication by immediate.
147defm WriteIMul32Reg : X86SchedWritePair; // Integer 32-bit multiplication by register.
148defm WriteIMul64    : X86SchedWritePair; // Integer 64-bit multiplication.
149defm WriteIMul64Imm : X86SchedWritePair; // Integer 64-bit multiplication by immediate.
150defm WriteIMul64Reg : X86SchedWritePair; // Integer 64-bit multiplication by register.
151defm WriteMULX32    : X86SchedWritePair; // Integer 32-bit Multiplication without affecting flags.
152defm WriteMULX64    : X86SchedWritePair; // Integer 64-bit Multiplication without affecting flags.
153def  WriteIMulH     : SchedWrite;        // Integer multiplication, high part (only used by the RR variant of MULX).
154def  WriteIMulHLd   : SchedWrite;        // Integer multiplication, high part (only used by the RM variant of MULX).
155
156def  WriteBSWAP32 : SchedWrite; // Byte Order (Endianness) 32-bit Swap.
157def  WriteBSWAP64 : SchedWrite; // Byte Order (Endianness) 64-bit Swap.
158defm WriteCMPXCHG : X86SchedWritePair; // Compare and set, compare and swap.
159def  WriteCMPXCHGRMW : SchedWrite;     // Compare and set, compare and swap.
160def  WriteXCHG    : SchedWrite;        // Compare+Exchange - TODO RMW support.
161
162// Integer division.
163defm WriteDiv8   : X86SchedWritePair;
164defm WriteDiv16  : X86SchedWritePair;
165defm WriteDiv32  : X86SchedWritePair;
166defm WriteDiv64  : X86SchedWritePair;
167defm WriteIDiv8  : X86SchedWritePair;
168defm WriteIDiv16 : X86SchedWritePair;
169defm WriteIDiv32 : X86SchedWritePair;
170defm WriteIDiv64 : X86SchedWritePair;
171
172defm WriteBSF : X86SchedWritePair; // Bit scan forward.
173defm WriteBSR : X86SchedWritePair; // Bit scan reverse.
174defm WritePOPCNT : X86SchedWritePair; // Bit population count.
175defm WriteLZCNT : X86SchedWritePair; // Leading zero count.
176defm WriteTZCNT : X86SchedWritePair; // Trailing zero count.
177defm WriteCMOV  : X86SchedWritePair; // Conditional move.
178def  WriteFCMOV : SchedWrite; // X87 conditional move.
179def  WriteSETCC : SchedWrite; // Set register based on condition code.
180def  WriteSETCCStore : SchedWrite;
181def  WriteLAHFSAHF : SchedWrite; // Load/Store flags in AH.
182
183def  WriteBitTest      : SchedWrite; // Bit Test
184def  WriteBitTestImmLd : SchedWrite;
185def  WriteBitTestRegLd : SchedWrite;
186
187def  WriteBitTestSet       : SchedWrite; // Bit Test + Set
188def  WriteBitTestSetImmLd  : SchedWrite;
189def  WriteBitTestSetRegLd  : SchedWrite;
190def  WriteBitTestSetImmRMW : WriteSequence<[WriteBitTestSetImmLd, WriteRMW]>;
191def  WriteBitTestSetRegRMW : WriteSequence<[WriteBitTestSetRegLd, WriteRMW]>;
192
193// Integer shifts and rotates.
194defm WriteShift    : X86SchedWritePair;
195defm WriteShiftCL  : X86SchedWritePair;
196defm WriteRotate   : X86SchedWritePair;
197defm WriteRotateCL : X86SchedWritePair;
198
199// Double shift instructions.
200def  WriteSHDrri  : SchedWrite;
201def  WriteSHDrrcl : SchedWrite;
202def  WriteSHDmri  : SchedWrite;
203def  WriteSHDmrcl : SchedWrite;
204
205// BMI1 BEXTR/BLS, BMI2 BZHI
206defm WriteBEXTR : X86SchedWritePair;
207defm WriteBLS   : X86SchedWritePair;
208defm WriteBZHI  : X86SchedWritePair;
209
210// Idioms that clear a register, like xorps %xmm0, %xmm0.
211// These can often bypass execution ports completely.
212def WriteZero : SchedWrite;
213
214// Branches don't produce values, so they have no latency, but they still
215// consume resources. Indirect branches can fold loads.
216defm WriteJump : X86SchedWritePair;
217
218// Floating point. This covers both scalar and vector operations.
219def  WriteFLD0          : SchedWrite;
220def  WriteFLD1          : SchedWrite;
221def  WriteFLDC          : SchedWrite;
222def  WriteFLoad         : SchedWrite;
223def  WriteFLoadX        : SchedWrite;
224def  WriteFLoadY        : SchedWrite;
225def  WriteFMaskedLoad   : SchedWrite;
226def  WriteFMaskedLoadY  : SchedWrite;
227def  WriteFStore        : SchedWrite;
228def  WriteFStoreX       : SchedWrite;
229def  WriteFStoreY       : SchedWrite;
230def  WriteFStoreNT      : SchedWrite;
231def  WriteFStoreNTX     : SchedWrite;
232def  WriteFStoreNTY     : SchedWrite;
233
234def  WriteFMaskedStore32  : SchedWrite;
235def  WriteFMaskedStore64  : SchedWrite;
236def  WriteFMaskedStore32Y : SchedWrite;
237def  WriteFMaskedStore64Y : SchedWrite;
238
239def  WriteFMove         : SchedWrite;
240def  WriteFMoveX        : SchedWrite;
241def  WriteFMoveY        : SchedWrite;
242
243defm WriteFAdd    : X86SchedWritePair<ReadAfterVecLd>;  // Floating point add/sub.
244defm WriteFAddX   : X86SchedWritePair<ReadAfterVecXLd>; // Floating point add/sub (XMM).
245defm WriteFAddY   : X86SchedWritePair<ReadAfterVecYLd>; // Floating point add/sub (YMM).
246defm WriteFAddZ   : X86SchedWritePair<ReadAfterVecYLd>; // Floating point add/sub (ZMM).
247defm WriteFAdd64  : X86SchedWritePair<ReadAfterVecLd>;  // Floating point double add/sub.
248defm WriteFAdd64X : X86SchedWritePair<ReadAfterVecXLd>; // Floating point double add/sub (XMM).
249defm WriteFAdd64Y : X86SchedWritePair<ReadAfterVecYLd>; // Floating point double add/sub (YMM).
250defm WriteFAdd64Z : X86SchedWritePair<ReadAfterVecYLd>; // Floating point double add/sub (ZMM).
251defm WriteFCmp    : X86SchedWritePair<ReadAfterVecLd>;  // Floating point compare.
252defm WriteFCmpX   : X86SchedWritePair<ReadAfterVecXLd>; // Floating point compare (XMM).
253defm WriteFCmpY   : X86SchedWritePair<ReadAfterVecYLd>; // Floating point compare (YMM).
254defm WriteFCmpZ   : X86SchedWritePair<ReadAfterVecYLd>; // Floating point compare (ZMM).
255defm WriteFCmp64  : X86SchedWritePair<ReadAfterVecLd>;  // Floating point double compare.
256defm WriteFCmp64X : X86SchedWritePair<ReadAfterVecXLd>; // Floating point double compare (XMM).
257defm WriteFCmp64Y : X86SchedWritePair<ReadAfterVecYLd>; // Floating point double compare (YMM).
258defm WriteFCmp64Z : X86SchedWritePair<ReadAfterVecYLd>; // Floating point double compare (ZMM).
259defm WriteFCom    : X86SchedWritePair<ReadAfterVecLd>;  // Floating point compare to flags (X87).
260defm WriteFComX   : X86SchedWritePair<ReadAfterVecLd>;  // Floating point compare to flags (SSE).
261defm WriteFMul    : X86SchedWritePair<ReadAfterVecLd>;  // Floating point multiplication.
262defm WriteFMulX   : X86SchedWritePair<ReadAfterVecXLd>; // Floating point multiplication (XMM).
263defm WriteFMulY   : X86SchedWritePair<ReadAfterVecYLd>; // Floating point multiplication (YMM).
264defm WriteFMulZ   : X86SchedWritePair<ReadAfterVecYLd>; // Floating point multiplication (YMM).
265defm WriteFMul64  : X86SchedWritePair<ReadAfterVecLd>;  // Floating point double multiplication.
266defm WriteFMul64X : X86SchedWritePair<ReadAfterVecXLd>; // Floating point double multiplication (XMM).
267defm WriteFMul64Y : X86SchedWritePair<ReadAfterVecYLd>; // Floating point double multiplication (YMM).
268defm WriteFMul64Z : X86SchedWritePair<ReadAfterVecYLd>; // Floating point double multiplication (ZMM).
269defm WriteFDiv    : X86SchedWritePair<ReadAfterVecLd>;  // Floating point division.
270defm WriteFDivX   : X86SchedWritePair<ReadAfterVecXLd>; // Floating point division (XMM).
271defm WriteFDivY   : X86SchedWritePair<ReadAfterVecYLd>; // Floating point division (YMM).
272defm WriteFDivZ   : X86SchedWritePair<ReadAfterVecYLd>; // Floating point division (ZMM).
273defm WriteFDiv64  : X86SchedWritePair<ReadAfterVecLd>;  // Floating point double division.
274defm WriteFDiv64X : X86SchedWritePair<ReadAfterVecXLd>; // Floating point double division (XMM).
275defm WriteFDiv64Y : X86SchedWritePair<ReadAfterVecYLd>; // Floating point double division (YMM).
276defm WriteFDiv64Z : X86SchedWritePair<ReadAfterVecYLd>; // Floating point double division (ZMM).
277defm WriteFSqrt  : X86SchedWritePair<ReadAfterVecLd>;   // Floating point square root.
278defm WriteFSqrtX : X86SchedWritePair<ReadAfterVecXLd>;  // Floating point square root (XMM).
279defm WriteFSqrtY : X86SchedWritePair<ReadAfterVecYLd>;  // Floating point square root (YMM).
280defm WriteFSqrtZ : X86SchedWritePair<ReadAfterVecYLd>;  // Floating point square root (ZMM).
281defm WriteFSqrt64  : X86SchedWritePair<ReadAfterVecLd>;  // Floating point double square root.
282defm WriteFSqrt64X : X86SchedWritePair<ReadAfterVecXLd>; // Floating point double square root (XMM).
283defm WriteFSqrt64Y : X86SchedWritePair<ReadAfterVecYLd>; // Floating point double square root (YMM).
284defm WriteFSqrt64Z : X86SchedWritePair<ReadAfterVecYLd>; // Floating point double square root (ZMM).
285defm WriteFSqrt80  : X86SchedWritePair<ReadAfterVecLd>;  // Floating point long double square root.
286defm WriteFRcp   : X86SchedWritePair<ReadAfterVecLd>;  // Floating point reciprocal estimate.
287defm WriteFRcpX  : X86SchedWritePair<ReadAfterVecXLd>; // Floating point reciprocal estimate (XMM).
288defm WriteFRcpY  : X86SchedWritePair<ReadAfterVecYLd>; // Floating point reciprocal estimate (YMM).
289defm WriteFRcpZ  : X86SchedWritePair<ReadAfterVecYLd>; // Floating point reciprocal estimate (ZMM).
290defm WriteFRsqrt : X86SchedWritePair<ReadAfterVecLd>;  // Floating point reciprocal square root estimate.
291defm WriteFRsqrtX: X86SchedWritePair<ReadAfterVecXLd>; // Floating point reciprocal square root estimate (XMM).
292defm WriteFRsqrtY: X86SchedWritePair<ReadAfterVecYLd>; // Floating point reciprocal square root estimate (YMM).
293defm WriteFRsqrtZ: X86SchedWritePair<ReadAfterVecYLd>; // Floating point reciprocal square root estimate (ZMM).
294defm WriteFMA    : X86SchedWritePair<ReadAfterVecLd>;  // Fused Multiply Add.
295defm WriteFMAX   : X86SchedWritePair<ReadAfterVecXLd>; // Fused Multiply Add (XMM).
296defm WriteFMAY   : X86SchedWritePair<ReadAfterVecYLd>; // Fused Multiply Add (YMM).
297defm WriteFMAZ   : X86SchedWritePair<ReadAfterVecYLd>; // Fused Multiply Add (ZMM).
298defm WriteDPPD   : X86SchedWritePair<ReadAfterVecXLd>; // Floating point double dot product.
299defm WriteDPPS   : X86SchedWritePair<ReadAfterVecXLd>; // Floating point single dot product.
300defm WriteDPPSY  : X86SchedWritePair<ReadAfterVecYLd>; // Floating point single dot product (YMM).
301defm WriteDPPSZ  : X86SchedWritePair<ReadAfterVecYLd>; // Floating point single dot product (ZMM).
302defm WriteFSign  : X86SchedWritePair<ReadAfterVecLd>;  // Floating point fabs/fchs.
303defm WriteFRnd   : X86SchedWritePair<ReadAfterVecXLd>; // Floating point rounding.
304defm WriteFRndY  : X86SchedWritePair<ReadAfterVecYLd>; // Floating point rounding (YMM).
305defm WriteFRndZ  : X86SchedWritePair<ReadAfterVecYLd>; // Floating point rounding (ZMM).
306defm WriteFLogic  : X86SchedWritePair<ReadAfterVecXLd>; // Floating point and/or/xor logicals.
307defm WriteFLogicY : X86SchedWritePair<ReadAfterVecYLd>; // Floating point and/or/xor logicals (YMM).
308defm WriteFLogicZ : X86SchedWritePair<ReadAfterVecYLd>; // Floating point and/or/xor logicals (ZMM).
309defm WriteFTest   : X86SchedWritePair<ReadAfterVecXLd>; // Floating point TEST instructions.
310defm WriteFTestY  : X86SchedWritePair<ReadAfterVecYLd>; // Floating point TEST instructions (YMM).
311defm WriteFTestZ  : X86SchedWritePair<ReadAfterVecYLd>; // Floating point TEST instructions (ZMM).
312defm WriteFShuffle  : X86SchedWritePair<ReadAfterVecXLd>; // Floating point vector shuffles.
313defm WriteFShuffleY : X86SchedWritePair<ReadAfterVecYLd>; // Floating point vector shuffles (YMM).
314defm WriteFShuffleZ : X86SchedWritePair<ReadAfterVecYLd>; // Floating point vector shuffles (ZMM).
315defm WriteFVarShuffle  : X86SchedWritePair<ReadAfterVecXLd>; // Floating point vector variable shuffles.
316defm WriteFVarShuffleY : X86SchedWritePair<ReadAfterVecYLd>; // Floating point vector variable shuffles (YMM).
317defm WriteFVarShuffleZ : X86SchedWritePair<ReadAfterVecYLd>; // Floating point vector variable shuffles (ZMM).
318defm WriteFBlend  : X86SchedWritePair<ReadAfterVecXLd>; // Floating point vector blends.
319defm WriteFBlendY : X86SchedWritePair<ReadAfterVecYLd>; // Floating point vector blends (YMM).
320defm WriteFBlendZ : X86SchedWritePair<ReadAfterVecYLd>; // Floating point vector blends (ZMM).
321defm WriteFVarBlend  : X86SchedWritePair<ReadAfterVecXLd>; // Fp vector variable blends.
322defm WriteFVarBlendY : X86SchedWritePair<ReadAfterVecYLd>; // Fp vector variable blends (YMM).
323defm WriteFVarBlendZ : X86SchedWritePair<ReadAfterVecYLd>; // Fp vector variable blends (YMZMM).
324
325// FMA Scheduling helper class.
326class FMASC { X86FoldableSchedWrite Sched = WriteFAdd; }
327
328// Horizontal Add/Sub (float and integer)
329defm WriteFHAdd  : X86SchedWritePair<ReadAfterVecXLd>;
330defm WriteFHAddY : X86SchedWritePair<ReadAfterVecYLd>;
331defm WriteFHAddZ : X86SchedWritePair<ReadAfterVecYLd>;
332defm WritePHAdd  : X86SchedWritePair<ReadAfterVecLd>;
333defm WritePHAddX : X86SchedWritePair<ReadAfterVecXLd>;
334defm WritePHAddY : X86SchedWritePair<ReadAfterVecYLd>;
335defm WritePHAddZ : X86SchedWritePair<ReadAfterVecYLd>;
336
337// Vector integer operations.
338def  WriteVecLoad         : SchedWrite;
339def  WriteVecLoadX        : SchedWrite;
340def  WriteVecLoadY        : SchedWrite;
341def  WriteVecLoadNT       : SchedWrite;
342def  WriteVecLoadNTY      : SchedWrite;
343def  WriteVecMaskedLoad   : SchedWrite;
344def  WriteVecMaskedLoadY  : SchedWrite;
345def  WriteVecStore        : SchedWrite;
346def  WriteVecStoreX       : SchedWrite;
347def  WriteVecStoreY       : SchedWrite;
348def  WriteVecStoreNT      : SchedWrite;
349def  WriteVecStoreNTY     : SchedWrite;
350def  WriteVecMaskedStore32  : SchedWrite;
351def  WriteVecMaskedStore64  : SchedWrite;
352def  WriteVecMaskedStore32Y : SchedWrite;
353def  WriteVecMaskedStore64Y : SchedWrite;
354def  WriteVecMove         : SchedWrite;
355def  WriteVecMoveX        : SchedWrite;
356def  WriteVecMoveY        : SchedWrite;
357def  WriteVecMoveToGpr    : SchedWrite;
358def  WriteVecMoveFromGpr  : SchedWrite;
359
360defm WriteVecALU    : X86SchedWritePair<ReadAfterVecLd>;  // Vector integer ALU op, no logicals.
361defm WriteVecALUX   : X86SchedWritePair<ReadAfterVecXLd>; // Vector integer ALU op, no logicals (XMM).
362defm WriteVecALUY   : X86SchedWritePair<ReadAfterVecYLd>; // Vector integer ALU op, no logicals (YMM).
363defm WriteVecALUZ   : X86SchedWritePair<ReadAfterVecYLd>; // Vector integer ALU op, no logicals (ZMM).
364defm WriteVecLogic  : X86SchedWritePair<ReadAfterVecLd>;  // Vector integer and/or/xor logicals.
365defm WriteVecLogicX : X86SchedWritePair<ReadAfterVecXLd>; // Vector integer and/or/xor logicals (XMM).
366defm WriteVecLogicY : X86SchedWritePair<ReadAfterVecYLd>; // Vector integer and/or/xor logicals (YMM).
367defm WriteVecLogicZ : X86SchedWritePair<ReadAfterVecYLd>; // Vector integer and/or/xor logicals (ZMM).
368defm WriteVecTest  : X86SchedWritePair<ReadAfterVecXLd>;  // Vector integer TEST instructions.
369defm WriteVecTestY : X86SchedWritePair<ReadAfterVecYLd>;  // Vector integer TEST instructions (YMM).
370defm WriteVecTestZ : X86SchedWritePair<ReadAfterVecYLd>;  // Vector integer TEST instructions (ZMM).
371defm WriteVecShift  : X86SchedWritePair<ReadAfterVecLd>;  // Vector integer shifts (default).
372defm WriteVecShiftX : X86SchedWritePair<ReadAfterVecXLd>; // Vector integer shifts (XMM).
373defm WriteVecShiftY : X86SchedWritePair<ReadAfterVecYLd>; // Vector integer shifts (YMM).
374defm WriteVecShiftZ : X86SchedWritePair<ReadAfterVecYLd>; // Vector integer shifts (ZMM).
375defm WriteVecShiftImm : X86SchedWritePair<ReadAfterVecLd>;  // Vector integer immediate shifts (default).
376defm WriteVecShiftImmX: X86SchedWritePair<ReadAfterVecXLd>; // Vector integer immediate shifts (XMM).
377defm WriteVecShiftImmY: X86SchedWritePair<ReadAfterVecYLd>; // Vector integer immediate shifts (YMM).
378defm WriteVecShiftImmZ: X86SchedWritePair<ReadAfterVecYLd>; // Vector integer immediate shifts (ZMM).
379defm WriteVecIMul  : X86SchedWritePair<ReadAfterVecLd>;  // Vector integer multiply (default).
380defm WriteVecIMulX : X86SchedWritePair<ReadAfterVecXLd>; // Vector integer multiply (XMM).
381defm WriteVecIMulY : X86SchedWritePair<ReadAfterVecYLd>; // Vector integer multiply (YMM).
382defm WriteVecIMulZ : X86SchedWritePair<ReadAfterVecYLd>; // Vector integer multiply (ZMM).
383defm WritePMULLD   : X86SchedWritePair<ReadAfterVecXLd>; // Vector PMULLD.
384defm WritePMULLDY  : X86SchedWritePair<ReadAfterVecYLd>; // Vector PMULLD (YMM).
385defm WritePMULLDZ  : X86SchedWritePair<ReadAfterVecYLd>; // Vector PMULLD (ZMM).
386defm WriteShuffle  : X86SchedWritePair<ReadAfterVecLd>;  // Vector shuffles.
387defm WriteShuffleX : X86SchedWritePair<ReadAfterVecXLd>; // Vector shuffles (XMM).
388defm WriteShuffleY : X86SchedWritePair<ReadAfterVecYLd>; // Vector shuffles (YMM).
389defm WriteShuffleZ : X86SchedWritePair<ReadAfterVecYLd>; // Vector shuffles (ZMM).
390defm WriteVarShuffle  : X86SchedWritePair<ReadAfterVecLd>;  // Vector variable shuffles.
391defm WriteVarShuffleX : X86SchedWritePair<ReadAfterVecXLd>; // Vector variable shuffles (XMM).
392defm WriteVarShuffleY : X86SchedWritePair<ReadAfterVecYLd>; // Vector variable shuffles (YMM).
393defm WriteVarShuffleZ : X86SchedWritePair<ReadAfterVecYLd>; // Vector variable shuffles (ZMM).
394defm WriteBlend  : X86SchedWritePair<ReadAfterVecXLd>; // Vector blends.
395defm WriteBlendY : X86SchedWritePair<ReadAfterVecYLd>; // Vector blends (YMM).
396defm WriteBlendZ : X86SchedWritePair<ReadAfterVecYLd>; // Vector blends (ZMM).
397defm WriteVarBlend  : X86SchedWritePair<ReadAfterVecXLd>; // Vector variable blends.
398defm WriteVarBlendY : X86SchedWritePair<ReadAfterVecYLd>; // Vector variable blends (YMM).
399defm WriteVarBlendZ : X86SchedWritePair<ReadAfterVecYLd>; // Vector variable blends (ZMM).
400defm WritePSADBW  : X86SchedWritePair<ReadAfterVecLd>;  // Vector PSADBW.
401defm WritePSADBWX : X86SchedWritePair<ReadAfterVecXLd>; // Vector PSADBW (XMM).
402defm WritePSADBWY : X86SchedWritePair<ReadAfterVecYLd>; // Vector PSADBW (YMM).
403defm WritePSADBWZ : X86SchedWritePair<ReadAfterVecYLd>; // Vector PSADBW (ZMM).
404defm WriteMPSAD  : X86SchedWritePair<ReadAfterVecXLd>; // Vector MPSAD.
405defm WriteMPSADY : X86SchedWritePair<ReadAfterVecYLd>; // Vector MPSAD (YMM).
406defm WriteMPSADZ : X86SchedWritePair<ReadAfterVecYLd>; // Vector MPSAD (ZMM).
407defm WritePHMINPOS : X86SchedWritePair<ReadAfterVecXLd>;  // Vector PHMINPOS.
408
409// Vector insert/extract operations.
410defm WriteVecInsert : X86SchedWritePair; // Insert gpr to vector element.
411def  WriteVecExtract : SchedWrite; // Extract vector element to gpr.
412def  WriteVecExtractSt : SchedWrite; // Extract vector element and store.
413
414// MOVMSK operations.
415def WriteFMOVMSK    : SchedWrite;
416def WriteVecMOVMSK  : SchedWrite;
417def WriteVecMOVMSKY : SchedWrite;
418def WriteMMXMOVMSK  : SchedWrite;
419
420// Conversion between integer and float.
421defm WriteCvtSD2I  : X86SchedWritePair<ReadAfterVecLd>;  // Double -> Integer.
422defm WriteCvtPD2I  : X86SchedWritePair<ReadAfterVecXLd>; // Double -> Integer (XMM).
423defm WriteCvtPD2IY : X86SchedWritePair<ReadAfterVecYLd>; // Double -> Integer (YMM).
424defm WriteCvtPD2IZ : X86SchedWritePair<ReadAfterVecYLd>; // Double -> Integer (ZMM).
425
426defm WriteCvtSS2I  : X86SchedWritePair<ReadAfterVecLd>;  // Float -> Integer.
427defm WriteCvtPS2I  : X86SchedWritePair<ReadAfterVecXLd>; // Float -> Integer (XMM).
428defm WriteCvtPS2IY : X86SchedWritePair<ReadAfterVecYLd>; // Float -> Integer (YMM).
429defm WriteCvtPS2IZ : X86SchedWritePair<ReadAfterVecYLd>; // Float -> Integer (ZMM).
430
431defm WriteCvtI2SD  : X86SchedWritePair<ReadAfterVecLd>;  // Integer -> Double.
432defm WriteCvtI2PD  : X86SchedWritePair<ReadAfterVecXLd>; // Integer -> Double (XMM).
433defm WriteCvtI2PDY : X86SchedWritePair<ReadAfterVecYLd>; // Integer -> Double (YMM).
434defm WriteCvtI2PDZ : X86SchedWritePair<ReadAfterVecYLd>; // Integer -> Double (ZMM).
435
436defm WriteCvtI2SS  : X86SchedWritePair<ReadAfterVecLd>;  // Integer -> Float.
437defm WriteCvtI2PS  : X86SchedWritePair<ReadAfterVecXLd>; // Integer -> Float (XMM).
438defm WriteCvtI2PSY : X86SchedWritePair<ReadAfterVecYLd>; // Integer -> Float (YMM).
439defm WriteCvtI2PSZ : X86SchedWritePair<ReadAfterVecYLd>; // Integer -> Float (ZMM).
440
441defm WriteCvtSS2SD  : X86SchedWritePair<ReadAfterVecLd>;  // Float -> Double size conversion.
442defm WriteCvtPS2PD  : X86SchedWritePair<ReadAfterVecXLd>; // Float -> Double size conversion (XMM).
443defm WriteCvtPS2PDY : X86SchedWritePair<ReadAfterVecYLd>; // Float -> Double size conversion (YMM).
444defm WriteCvtPS2PDZ : X86SchedWritePair<ReadAfterVecYLd>; // Float -> Double size conversion (ZMM).
445
446defm WriteCvtSD2SS  : X86SchedWritePair<ReadAfterVecLd>;  // Double -> Float size conversion.
447defm WriteCvtPD2PS  : X86SchedWritePair<ReadAfterVecXLd>; // Double -> Float size conversion (XMM).
448defm WriteCvtPD2PSY : X86SchedWritePair<ReadAfterVecYLd>; // Double -> Float size conversion (YMM).
449defm WriteCvtPD2PSZ : X86SchedWritePair<ReadAfterVecYLd>; // Double -> Float size conversion (ZMM).
450
451defm WriteCvtPH2PS  : X86SchedWritePair<ReadAfterVecXLd>; // Half -> Float size conversion.
452defm WriteCvtPH2PSY : X86SchedWritePair<ReadAfterVecYLd>; // Half -> Float size conversion (YMM).
453defm WriteCvtPH2PSZ : X86SchedWritePair<ReadAfterVecYLd>; // Half -> Float size conversion (ZMM).
454
455def  WriteCvtPS2PH    : SchedWrite; // // Float -> Half size conversion.
456def  WriteCvtPS2PHY   : SchedWrite; // // Float -> Half size conversion (YMM).
457def  WriteCvtPS2PHZ   : SchedWrite; // // Float -> Half size conversion (ZMM).
458def  WriteCvtPS2PHSt  : SchedWrite; // // Float -> Half + store size conversion.
459def  WriteCvtPS2PHYSt : SchedWrite; // // Float -> Half + store size conversion (YMM).
460def  WriteCvtPS2PHZSt : SchedWrite; // // Float -> Half + store size conversion (ZMM).
461
462// CRC32 instruction.
463defm WriteCRC32 : X86SchedWritePair<ReadAfterLd>;
464
465// Strings instructions.
466// Packed Compare Implicit Length Strings, Return Mask
467defm WritePCmpIStrM : X86SchedWritePair<ReadAfterVecXLd>;
468// Packed Compare Explicit Length Strings, Return Mask
469defm WritePCmpEStrM : X86SchedWritePair<ReadAfterVecXLd>;
470// Packed Compare Implicit Length Strings, Return Index
471defm WritePCmpIStrI : X86SchedWritePair<ReadAfterVecXLd>;
472// Packed Compare Explicit Length Strings, Return Index
473defm WritePCmpEStrI : X86SchedWritePair<ReadAfterVecXLd>;
474
475// AES instructions.
476defm WriteAESDecEnc : X86SchedWritePair<ReadAfterVecXLd>; // Decryption, encryption.
477defm WriteAESIMC : X86SchedWritePair<ReadAfterVecXLd>; // InvMixColumn.
478defm WriteAESKeyGen : X86SchedWritePair<ReadAfterVecXLd>; // Key Generation.
479
480// Carry-less multiplication instructions.
481defm WriteCLMul : X86SchedWritePair<ReadAfterVecXLd>;
482
483// EMMS/FEMMS
484def WriteEMMS : SchedWrite;
485
486// Load/store MXCSR
487def WriteLDMXCSR : SchedWrite;
488def WriteSTMXCSR : SchedWrite;
489
490// Catch-all for expensive system instructions.
491def WriteSystem : SchedWrite;
492
493// AVX2.
494defm WriteFShuffle256 : X86SchedWritePair<ReadAfterVecYLd>; // Fp 256-bit width vector shuffles.
495defm WriteFVarShuffle256 : X86SchedWritePair<ReadAfterVecYLd>; // Fp 256-bit width variable shuffles.
496defm WriteShuffle256 : X86SchedWritePair<ReadAfterVecYLd>; // 256-bit width vector shuffles.
497defm WriteVPMOV256 : X86SchedWritePair<ReadAfterVecYLd>; // 256-bit width packed vector width-changing move.
498defm WriteVarShuffle256 : X86SchedWritePair<ReadAfterVecYLd>; // 256-bit width vector variable shuffles.
499defm WriteVarVecShift  : X86SchedWritePair<ReadAfterVecXLd>; // Variable vector shifts.
500defm WriteVarVecShiftY : X86SchedWritePair<ReadAfterVecYLd>; // Variable vector shifts (YMM).
501defm WriteVarVecShiftZ : X86SchedWritePair<ReadAfterVecYLd>; // Variable vector shifts (ZMM).
502
503// Old microcoded instructions that nobody use.
504def WriteMicrocoded : SchedWrite;
505
506// Fence instructions.
507def WriteFence : SchedWrite;
508
509// Nop, not very useful expect it provides a model for nops!
510def WriteNop : SchedWrite;
511
512// Move/Load/Store wrappers.
513def WriteFMoveLS
514 : X86SchedWriteMoveLS<WriteFMove, WriteFLoad, WriteFStore>;
515def WriteFMoveLSX
516 : X86SchedWriteMoveLS<WriteFMoveX, WriteFLoadX, WriteFStoreX>;
517def WriteFMoveLSY
518 : X86SchedWriteMoveLS<WriteFMoveY, WriteFLoadY, WriteFStoreY>;
519def SchedWriteFMoveLS
520  : X86SchedWriteMoveLSWidths<WriteFMoveLS, WriteFMoveLSX,
521                              WriteFMoveLSY, WriteFMoveLSY>;
522
523def WriteFMoveLSNT
524 : X86SchedWriteMoveLS<WriteFMove, WriteFLoad, WriteFStoreNT>;
525def WriteFMoveLSNTX
526 : X86SchedWriteMoveLS<WriteFMove, WriteFLoad, WriteFStoreNTX>;
527def WriteFMoveLSNTY
528 : X86SchedWriteMoveLS<WriteFMoveY, WriteFLoadY, WriteFStoreNTY>;
529def SchedWriteFMoveLSNT
530  : X86SchedWriteMoveLSWidths<WriteFMoveLSNT, WriteFMoveLSNTX,
531                              WriteFMoveLSNTY, WriteFMoveLSNTY>;
532
533def WriteVecMoveLS
534 : X86SchedWriteMoveLS<WriteVecMove, WriteVecLoad, WriteVecStore>;
535def WriteVecMoveLSX
536 : X86SchedWriteMoveLS<WriteVecMoveX, WriteVecLoadX, WriteVecStoreX>;
537def WriteVecMoveLSY
538 : X86SchedWriteMoveLS<WriteVecMoveY, WriteVecLoadY, WriteVecStoreY>;
539def SchedWriteVecMoveLS
540  : X86SchedWriteMoveLSWidths<WriteVecMoveLS, WriteVecMoveLSX,
541                              WriteVecMoveLSY, WriteVecMoveLSY>;
542
543def WriteVecMoveLSNT
544 : X86SchedWriteMoveLS<WriteVecMove, WriteVecLoadNT, WriteVecStoreNT>;
545def WriteVecMoveLSNTX
546 : X86SchedWriteMoveLS<WriteVecMoveX, WriteVecLoadNT, WriteVecStoreNT>;
547def WriteVecMoveLSNTY
548 : X86SchedWriteMoveLS<WriteVecMoveY, WriteVecLoadNTY, WriteVecStoreNTY>;
549def SchedWriteVecMoveLSNT
550  : X86SchedWriteMoveLSWidths<WriteVecMoveLSNT, WriteVecMoveLSNTX,
551                              WriteVecMoveLSNTY, WriteVecMoveLSNTY>;
552
553// Conditional SIMD Packed Loads and Stores wrappers.
554def WriteFMaskMove32
555  : X86SchedWriteMaskMove<WriteFMaskedLoad, WriteFMaskedStore32>;
556def WriteFMaskMove64
557  : X86SchedWriteMaskMove<WriteFMaskedLoad, WriteFMaskedStore64>;
558def WriteFMaskMove32Y
559  : X86SchedWriteMaskMove<WriteFMaskedLoadY, WriteFMaskedStore32Y>;
560def WriteFMaskMove64Y
561  : X86SchedWriteMaskMove<WriteFMaskedLoadY, WriteFMaskedStore64Y>;
562def WriteVecMaskMove32
563  : X86SchedWriteMaskMove<WriteVecMaskedLoad, WriteVecMaskedStore32>;
564def WriteVecMaskMove64
565  : X86SchedWriteMaskMove<WriteVecMaskedLoad, WriteVecMaskedStore64>;
566def WriteVecMaskMove32Y
567  : X86SchedWriteMaskMove<WriteVecMaskedLoadY, WriteVecMaskedStore32Y>;
568def WriteVecMaskMove64Y
569  : X86SchedWriteMaskMove<WriteVecMaskedLoadY, WriteVecMaskedStore64Y>;
570
571// Vector width wrappers.
572def SchedWriteFAdd
573 : X86SchedWriteWidths<WriteFAdd, WriteFAddX, WriteFAddY, WriteFAddZ>;
574def SchedWriteFAdd64
575 : X86SchedWriteWidths<WriteFAdd64, WriteFAdd64X, WriteFAdd64Y, WriteFAdd64Z>;
576def SchedWriteFHAdd
577 : X86SchedWriteWidths<WriteFHAdd, WriteFHAdd, WriteFHAddY, WriteFHAddZ>;
578def SchedWriteFCmp
579 : X86SchedWriteWidths<WriteFCmp, WriteFCmpX, WriteFCmpY, WriteFCmpZ>;
580def SchedWriteFCmp64
581 : X86SchedWriteWidths<WriteFCmp64, WriteFCmp64X, WriteFCmp64Y, WriteFCmp64Z>;
582def SchedWriteFMul
583 : X86SchedWriteWidths<WriteFMul, WriteFMulX, WriteFMulY, WriteFMulZ>;
584def SchedWriteFMul64
585 : X86SchedWriteWidths<WriteFMul64, WriteFMul64X, WriteFMul64Y, WriteFMul64Z>;
586def SchedWriteFMA
587 : X86SchedWriteWidths<WriteFMA, WriteFMAX, WriteFMAY, WriteFMAZ>;
588def SchedWriteDPPD
589 : X86SchedWriteWidths<WriteDPPD, WriteDPPD, WriteDPPD, WriteDPPD>;
590def SchedWriteDPPS
591 : X86SchedWriteWidths<WriteDPPS, WriteDPPS, WriteDPPSY, WriteDPPSZ>;
592def SchedWriteFDiv
593 : X86SchedWriteWidths<WriteFDiv, WriteFDivX, WriteFDivY, WriteFDivZ>;
594def SchedWriteFDiv64
595 : X86SchedWriteWidths<WriteFDiv64, WriteFDiv64X, WriteFDiv64Y, WriteFDiv64Z>;
596def SchedWriteFSqrt
597 : X86SchedWriteWidths<WriteFSqrt, WriteFSqrtX,
598                       WriteFSqrtY, WriteFSqrtZ>;
599def SchedWriteFSqrt64
600 : X86SchedWriteWidths<WriteFSqrt64, WriteFSqrt64X,
601                       WriteFSqrt64Y, WriteFSqrt64Z>;
602def SchedWriteFRcp
603 : X86SchedWriteWidths<WriteFRcp, WriteFRcpX, WriteFRcpY, WriteFRcpZ>;
604def SchedWriteFRsqrt
605 : X86SchedWriteWidths<WriteFRsqrt, WriteFRsqrtX, WriteFRsqrtY, WriteFRsqrtZ>;
606def SchedWriteFRnd
607 : X86SchedWriteWidths<WriteFRnd, WriteFRnd, WriteFRndY, WriteFRndZ>;
608def SchedWriteFLogic
609 : X86SchedWriteWidths<WriteFLogic, WriteFLogic, WriteFLogicY, WriteFLogicZ>;
610def SchedWriteFTest
611 : X86SchedWriteWidths<WriteFTest, WriteFTest, WriteFTestY, WriteFTestZ>;
612
613def SchedWriteFShuffle
614 : X86SchedWriteWidths<WriteFShuffle, WriteFShuffle,
615                       WriteFShuffleY, WriteFShuffleZ>;
616def SchedWriteFVarShuffle
617 : X86SchedWriteWidths<WriteFVarShuffle, WriteFVarShuffle,
618                       WriteFVarShuffleY, WriteFVarShuffleZ>;
619def SchedWriteFBlend
620 : X86SchedWriteWidths<WriteFBlend, WriteFBlend, WriteFBlendY, WriteFBlendZ>;
621def SchedWriteFVarBlend
622 : X86SchedWriteWidths<WriteFVarBlend, WriteFVarBlend,
623                       WriteFVarBlendY, WriteFVarBlendZ>;
624
625def SchedWriteCvtDQ2PD
626 : X86SchedWriteWidths<WriteCvtI2SD, WriteCvtI2PD,
627                       WriteCvtI2PDY, WriteCvtI2PDZ>;
628def SchedWriteCvtDQ2PS
629 : X86SchedWriteWidths<WriteCvtI2SS, WriteCvtI2PS,
630                       WriteCvtI2PSY, WriteCvtI2PSZ>;
631def SchedWriteCvtPD2DQ
632 : X86SchedWriteWidths<WriteCvtSD2I, WriteCvtPD2I,
633                       WriteCvtPD2IY, WriteCvtPD2IZ>;
634def SchedWriteCvtPS2DQ
635 : X86SchedWriteWidths<WriteCvtSS2I, WriteCvtPS2I,
636                       WriteCvtPS2IY, WriteCvtPS2IZ>;
637def SchedWriteCvtPS2PD
638 : X86SchedWriteWidths<WriteCvtSS2SD, WriteCvtPS2PD,
639                       WriteCvtPS2PDY, WriteCvtPS2PDZ>;
640def SchedWriteCvtPD2PS
641 : X86SchedWriteWidths<WriteCvtSD2SS, WriteCvtPD2PS,
642                       WriteCvtPD2PSY, WriteCvtPD2PSZ>;
643
644def SchedWriteVecALU
645 : X86SchedWriteWidths<WriteVecALU, WriteVecALUX, WriteVecALUY, WriteVecALUZ>;
646def SchedWritePHAdd
647 : X86SchedWriteWidths<WritePHAdd, WritePHAddX, WritePHAddY, WritePHAddZ>;
648def SchedWriteVecLogic
649 : X86SchedWriteWidths<WriteVecLogic, WriteVecLogicX,
650                       WriteVecLogicY, WriteVecLogicZ>;
651def SchedWriteVecTest
652 : X86SchedWriteWidths<WriteVecTest, WriteVecTest,
653                       WriteVecTestY, WriteVecTestZ>;
654def SchedWriteVecShift
655 : X86SchedWriteWidths<WriteVecShift, WriteVecShiftX,
656                       WriteVecShiftY, WriteVecShiftZ>;
657def SchedWriteVecShiftImm
658 : X86SchedWriteWidths<WriteVecShiftImm, WriteVecShiftImmX,
659                       WriteVecShiftImmY, WriteVecShiftImmZ>;
660def SchedWriteVarVecShift
661 : X86SchedWriteWidths<WriteVarVecShift, WriteVarVecShift,
662                       WriteVarVecShiftY, WriteVarVecShiftZ>;
663def SchedWriteVecIMul
664 : X86SchedWriteWidths<WriteVecIMul, WriteVecIMulX,
665                       WriteVecIMulY, WriteVecIMulZ>;
666def SchedWritePMULLD
667 : X86SchedWriteWidths<WritePMULLD, WritePMULLD,
668                       WritePMULLDY, WritePMULLDZ>;
669def SchedWriteMPSAD
670 : X86SchedWriteWidths<WriteMPSAD, WriteMPSAD,
671                       WriteMPSADY, WriteMPSADZ>;
672def SchedWritePSADBW
673 : X86SchedWriteWidths<WritePSADBW, WritePSADBWX,
674                       WritePSADBWY, WritePSADBWZ>;
675
676def SchedWriteShuffle
677 : X86SchedWriteWidths<WriteShuffle, WriteShuffleX,
678                       WriteShuffleY, WriteShuffleZ>;
679def SchedWriteVarShuffle
680 : X86SchedWriteWidths<WriteVarShuffle, WriteVarShuffleX,
681                       WriteVarShuffleY, WriteVarShuffleZ>;
682def SchedWriteBlend
683 : X86SchedWriteWidths<WriteBlend, WriteBlend, WriteBlendY, WriteBlendZ>;
684def SchedWriteVarBlend
685 : X86SchedWriteWidths<WriteVarBlend, WriteVarBlend,
686                       WriteVarBlendY, WriteVarBlendZ>;
687
688// Vector size wrappers.
689// FIXME: Currently PH uses the same schedule method as PS.
690// We may refine them later.
691def SchedWriteFAddSizes
692 : X86SchedWriteSizes<SchedWriteFAdd, SchedWriteFAdd, SchedWriteFAdd64>;
693def SchedWriteFCmpSizes
694 : X86SchedWriteSizes<SchedWriteFCmp, SchedWriteFCmp, SchedWriteFCmp64>;
695def SchedWriteFMulSizes
696 : X86SchedWriteSizes<SchedWriteFMul, SchedWriteFMul, SchedWriteFMul64>;
697def SchedWriteFDivSizes
698 : X86SchedWriteSizes<SchedWriteFDiv, SchedWriteFDiv, SchedWriteFDiv64>;
699def SchedWriteFSqrtSizes
700 : X86SchedWriteSizes<SchedWriteFSqrt, SchedWriteFSqrt, SchedWriteFSqrt64>;
701def SchedWriteFLogicSizes
702 : X86SchedWriteSizes<SchedWriteFLogic, SchedWriteFLogic, SchedWriteFLogic>;
703def SchedWriteFShuffleSizes
704 : X86SchedWriteSizes<SchedWriteFShuffle, SchedWriteFShuffle, SchedWriteFShuffle>;
705
706//===----------------------------------------------------------------------===//
707// Generic Processor Scheduler Models.
708
709// IssueWidth is analogous to the number of decode units. Core and its
710// descendents, including Nehalem and SandyBridge have 4 decoders.
711// Resources beyond the decoder operate on micro-ops and are bufferred
712// so adjacent micro-ops don't directly compete.
713//
714// MicroOpBufferSize > 1 indicates that RAW dependencies can be
715// decoded in the same cycle. The value 32 is a reasonably arbitrary
716// number of in-flight instructions.
717//
718// HighLatency=10 is optimistic. X86InstrInfo::isHighLatencyDef
719// indicates high latency opcodes. Alternatively, InstrItinData
720// entries may be included here to define specific operand
721// latencies. Since these latencies are not used for pipeline hazards,
722// they do not need to be exact.
723//
724// The GenericX86Model contains no instruction schedules
725// and disables PostRAScheduler.
726class GenericX86Model : SchedMachineModel {
727  let IssueWidth = 4;
728  let MicroOpBufferSize = 32;
729  let LoadLatency = 4;
730  let HighLatency = 10;
731  let PostRAScheduler = 0;
732  let CompleteModel = 0;
733}
734
735def GenericModel : GenericX86Model;
736
737// Define a model with the PostRAScheduler enabled.
738def GenericPostRAModel : GenericX86Model {
739  let PostRAScheduler = 1;
740}
741