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