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