blob: 7f381a891ad00c76aeb5480458945bf037ea8559 [file] [log] [blame]
Simon Pilgrima271c542017-05-03 15:42:29 +00001//===-- X86Schedule.td - X86 Scheduling Definitions --------*- tablegen -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// InstrSchedModel annotations for out-of-order CPUs.
11//
12// These annotations are independent of the itinerary classes defined below.
13
14// Instructions with folded loads need to read the memory operand immediately,
15// but other register operands don't have to be read until the load is ready.
16// These operands are marked with ReadAfterLd.
17def ReadAfterLd : SchedRead;
18
19// Instructions with both a load and a store folded are modeled as a folded
20// load + WriteRMW.
21def WriteRMW : SchedWrite;
22
23// Most instructions can fold loads, so almost every SchedWrite comes in two
24// variants: With and without a folded load.
25// An X86FoldableSchedWrite holds a reference to the corresponding SchedWrite
26// with a folded load.
27class X86FoldableSchedWrite : SchedWrite {
28 // The SchedWrite to use when a load is folded into the instruction.
29 SchedWrite Folded;
30}
31
32// Multiclass that produces a linked pair of SchedWrites.
33multiclass X86SchedWritePair {
34 // Register-Memory operation.
35 def Ld : SchedWrite;
36 // Register-Register operation.
37 def NAME : X86FoldableSchedWrite {
38 let Folded = !cast<SchedWrite>(NAME#"Ld");
39 }
40}
41
Craig Topperb7baa352018-04-08 17:53:18 +000042// Loads, stores, and moves, not folded with other operations.
43def WriteLoad : SchedWrite;
44def WriteStore : SchedWrite;
45def WriteMove : SchedWrite;
46
Simon Pilgrima271c542017-05-03 15:42:29 +000047// Arithmetic.
48defm WriteALU : X86SchedWritePair; // Simple integer ALU op.
Craig Topperb7baa352018-04-08 17:53:18 +000049def WriteALURMW : WriteSequence<[WriteALULd, WriteStore]>;
Simon Pilgrima271c542017-05-03 15:42:29 +000050defm WriteIMul : X86SchedWritePair; // Integer multiplication.
51def WriteIMulH : SchedWrite; // Integer multiplication, high part.
52defm WriteIDiv : X86SchedWritePair; // Integer division.
53def WriteLEA : SchedWrite; // LEA instructions can't fold loads.
54
Simon Pilgrimf33d9052018-03-26 18:19:28 +000055defm WriteBitScan : X86SchedWritePair; // Bit scan forward/reverse.
56defm WritePOPCNT : X86SchedWritePair; // Bit population count.
57defm WriteLZCNT : X86SchedWritePair; // Leading zero count.
58defm WriteTZCNT : X86SchedWritePair; // Trailing zero count.
Craig Topperb7baa352018-04-08 17:53:18 +000059defm WriteCMOV : X86SchedWritePair; // Conditional move.
60def WriteSETCC : SchedWrite; // Set register based on condition code.
61def WriteSETCCStore : SchedWrite;
Simon Pilgrimf33d9052018-03-26 18:19:28 +000062
Simon Pilgrima271c542017-05-03 15:42:29 +000063// Integer shifts and rotates.
64defm WriteShift : X86SchedWritePair;
65
Craig Topper89310f52018-03-29 20:41:39 +000066// BMI1 BEXTR, BMI2 BZHI
67defm WriteBEXTR : X86SchedWritePair;
68defm WriteBZHI : X86SchedWritePair;
69
Simon Pilgrima271c542017-05-03 15:42:29 +000070// Idioms that clear a register, like xorps %xmm0, %xmm0.
71// These can often bypass execution ports completely.
72def WriteZero : SchedWrite;
73
74// Branches don't produce values, so they have no latency, but they still
75// consume resources. Indirect branches can fold loads.
76defm WriteJump : X86SchedWritePair;
77
78// Floating point. This covers both scalar and vector operations.
Simon Pilgrimfb7aa572018-03-15 14:45:30 +000079def WriteFLoad : SchedWrite;
80def WriteFStore : SchedWrite;
81def WriteFMove : SchedWrite;
Simon Pilgrima271c542017-05-03 15:42:29 +000082defm WriteFAdd : X86SchedWritePair; // Floating point add/sub/compare.
83defm WriteFMul : X86SchedWritePair; // Floating point multiplication.
84defm WriteFDiv : X86SchedWritePair; // Floating point division.
85defm WriteFSqrt : X86SchedWritePair; // Floating point square root.
86defm WriteFRcp : X86SchedWritePair; // Floating point reciprocal estimate.
87defm WriteFRsqrt : X86SchedWritePair; // Floating point reciprocal square root estimate.
88defm WriteFMA : X86SchedWritePair; // Fused Multiply Add.
89defm WriteFShuffle : X86SchedWritePair; // Floating point vector shuffles.
90defm WriteFBlend : X86SchedWritePair; // Floating point vector blends.
91defm WriteFVarBlend : X86SchedWritePair; // Fp vector variable blends.
92
93// FMA Scheduling helper class.
94class FMASC { X86FoldableSchedWrite Sched = WriteFAdd; }
95
Andrew V. Tischenko8cb1d092017-06-08 16:44:13 +000096// Horizontal Add/Sub (float and integer)
97defm WriteFHAdd : X86SchedWritePair;
98defm WritePHAdd : X86SchedWritePair;
99
Simon Pilgrima271c542017-05-03 15:42:29 +0000100// Vector integer operations.
Simon Pilgrimfb7aa572018-03-15 14:45:30 +0000101def WriteVecLoad : SchedWrite;
102def WriteVecStore : SchedWrite;
103def WriteVecMove : SchedWrite;
Simon Pilgrima271c542017-05-03 15:42:29 +0000104defm WriteVecALU : X86SchedWritePair; // Vector integer ALU op, no logicals.
105defm WriteVecShift : X86SchedWritePair; // Vector integer shifts.
106defm WriteVecIMul : X86SchedWritePair; // Vector integer multiply.
Craig Topper13a0f832018-03-31 04:54:32 +0000107defm WritePMULLD : X86SchedWritePair; // PMULLD
Simon Pilgrima271c542017-05-03 15:42:29 +0000108defm WriteShuffle : X86SchedWritePair; // Vector shuffles.
109defm WriteBlend : X86SchedWritePair; // Vector blends.
110defm WriteVarBlend : X86SchedWritePair; // Vector variable blends.
111defm WriteMPSAD : X86SchedWritePair; // Vector MPSAD.
112
113// Vector bitwise operations.
114// These are often used on both floating point and integer vectors.
115defm WriteVecLogic : X86SchedWritePair; // Vector and/or/xor.
116
Simon Pilgrima2f26782018-03-27 20:38:54 +0000117// MOVMSK operations.
118def WriteFMOVMSK : SchedWrite;
119def WriteVecMOVMSK : SchedWrite;
120def WriteMMXMOVMSK : SchedWrite;
121
Simon Pilgrima271c542017-05-03 15:42:29 +0000122// Conversion between integer and float.
123defm WriteCvtF2I : X86SchedWritePair; // Float -> Integer.
124defm WriteCvtI2F : X86SchedWritePair; // Integer -> Float.
125defm WriteCvtF2F : X86SchedWritePair; // Float -> Float size conversion.
126
Simon Pilgrim28e7bcb2018-03-26 21:06:14 +0000127// CRC32 instruction.
128defm WriteCRC32 : X86SchedWritePair;
129
Simon Pilgrima271c542017-05-03 15:42:29 +0000130// Strings instructions.
131// Packed Compare Implicit Length Strings, Return Mask
132defm WritePCmpIStrM : X86SchedWritePair;
133// Packed Compare Explicit Length Strings, Return Mask
134defm WritePCmpEStrM : X86SchedWritePair;
135// Packed Compare Implicit Length Strings, Return Index
136defm WritePCmpIStrI : X86SchedWritePair;
137// Packed Compare Explicit Length Strings, Return Index
138defm WritePCmpEStrI : X86SchedWritePair;
139
140// AES instructions.
141defm WriteAESDecEnc : X86SchedWritePair; // Decryption, encryption.
142defm WriteAESIMC : X86SchedWritePair; // InvMixColumn.
143defm WriteAESKeyGen : X86SchedWritePair; // Key Generation.
144
145// Carry-less multiplication instructions.
146defm WriteCLMul : X86SchedWritePair;
147
148// Catch-all for expensive system instructions.
149def WriteSystem : SchedWrite;
150
151// AVX2.
152defm WriteFShuffle256 : X86SchedWritePair; // Fp 256-bit width vector shuffles.
153defm WriteShuffle256 : X86SchedWritePair; // 256-bit width vector shuffles.
154defm WriteVarVecShift : X86SchedWritePair; // Variable vector shifts.
155
156// Old microcoded instructions that nobody use.
157def WriteMicrocoded : SchedWrite;
158
159// Fence instructions.
160def WriteFence : SchedWrite;
161
162// Nop, not very useful expect it provides a model for nops!
163def WriteNop : SchedWrite;
164
165//===----------------------------------------------------------------------===//
166// Instruction Itinerary classes used for X86
167def IIC_ALU_MEM : InstrItinClass;
168def IIC_ALU_NONMEM : InstrItinClass;
169def IIC_LEA : InstrItinClass;
170def IIC_LEA_16 : InstrItinClass;
Craig Topper5ccd8722018-03-19 16:38:33 +0000171def IIC_MUL8_MEM : InstrItinClass;
172def IIC_MUL8_REG : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000173def IIC_MUL16_MEM : InstrItinClass;
174def IIC_MUL16_REG : InstrItinClass;
175def IIC_MUL32_MEM : InstrItinClass;
176def IIC_MUL32_REG : InstrItinClass;
Craig Topper5ccd8722018-03-19 16:38:33 +0000177def IIC_MUL64_MEM : InstrItinClass;
178def IIC_MUL64_REG : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000179// imul by al, ax, eax, tax
Craig Topper5ccd8722018-03-19 16:38:33 +0000180def IIC_IMUL8_MEM : InstrItinClass;
181def IIC_IMUL8_REG : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000182def IIC_IMUL16_MEM : InstrItinClass;
183def IIC_IMUL16_REG : InstrItinClass;
184def IIC_IMUL32_MEM : InstrItinClass;
185def IIC_IMUL32_REG : InstrItinClass;
Craig Topper5ccd8722018-03-19 16:38:33 +0000186def IIC_IMUL64_MEM : InstrItinClass;
187def IIC_IMUL64_REG : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000188// imul reg by reg|mem
189def IIC_IMUL16_RM : InstrItinClass;
190def IIC_IMUL16_RR : InstrItinClass;
191def IIC_IMUL32_RM : InstrItinClass;
192def IIC_IMUL32_RR : InstrItinClass;
193def IIC_IMUL64_RM : InstrItinClass;
194def IIC_IMUL64_RR : InstrItinClass;
195// imul reg = reg/mem * imm
196def IIC_IMUL16_RMI : InstrItinClass;
197def IIC_IMUL16_RRI : InstrItinClass;
198def IIC_IMUL32_RMI : InstrItinClass;
199def IIC_IMUL32_RRI : InstrItinClass;
200def IIC_IMUL64_RMI : InstrItinClass;
201def IIC_IMUL64_RRI : InstrItinClass;
202// div
203def IIC_DIV8_MEM : InstrItinClass;
204def IIC_DIV8_REG : InstrItinClass;
Craig Topper5ccd8722018-03-19 16:38:33 +0000205def IIC_DIV16_MEM : InstrItinClass;
206def IIC_DIV16_REG : InstrItinClass;
207def IIC_DIV32_MEM : InstrItinClass;
208def IIC_DIV32_REG : InstrItinClass;
209def IIC_DIV64_MEM : InstrItinClass;
210def IIC_DIV64_REG : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000211// idiv
Craig Topper5ccd8722018-03-19 16:38:33 +0000212def IIC_IDIV8_MEM : InstrItinClass;
213def IIC_IDIV8_REG : InstrItinClass;
214def IIC_IDIV16_MEM : InstrItinClass;
215def IIC_IDIV16_REG : InstrItinClass;
216def IIC_IDIV32_MEM : InstrItinClass;
217def IIC_IDIV32_REG : InstrItinClass;
218def IIC_IDIV64_MEM : InstrItinClass;
219def IIC_IDIV64_REG : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000220// neg/not/inc/dec
221def IIC_UNARY_REG : InstrItinClass;
222def IIC_UNARY_MEM : InstrItinClass;
223// add/sub/and/or/xor/sbc/cmp/test
224def IIC_BIN_MEM : InstrItinClass;
225def IIC_BIN_NONMEM : InstrItinClass;
226// adc/sbc
227def IIC_BIN_CARRY_MEM : InstrItinClass;
228def IIC_BIN_CARRY_NONMEM : InstrItinClass;
229// shift/rotate
230def IIC_SR : InstrItinClass;
231// shift double
232def IIC_SHD16_REG_IM : InstrItinClass;
233def IIC_SHD16_REG_CL : InstrItinClass;
234def IIC_SHD16_MEM_IM : InstrItinClass;
235def IIC_SHD16_MEM_CL : InstrItinClass;
236def IIC_SHD32_REG_IM : InstrItinClass;
237def IIC_SHD32_REG_CL : InstrItinClass;
238def IIC_SHD32_MEM_IM : InstrItinClass;
239def IIC_SHD32_MEM_CL : InstrItinClass;
240def IIC_SHD64_REG_IM : InstrItinClass;
241def IIC_SHD64_REG_CL : InstrItinClass;
242def IIC_SHD64_MEM_IM : InstrItinClass;
243def IIC_SHD64_MEM_CL : InstrItinClass;
244// cmov
245def IIC_CMOV16_RM : InstrItinClass;
246def IIC_CMOV16_RR : InstrItinClass;
247def IIC_CMOV32_RM : InstrItinClass;
248def IIC_CMOV32_RR : InstrItinClass;
249def IIC_CMOV64_RM : InstrItinClass;
250def IIC_CMOV64_RR : InstrItinClass;
251// set
252def IIC_SET_R : InstrItinClass;
253def IIC_SET_M : InstrItinClass;
254// jmp/jcc/jcxz
255def IIC_Jcc : InstrItinClass;
256def IIC_JCXZ : InstrItinClass;
257def IIC_JMP_REL : InstrItinClass;
258def IIC_JMP_REG : InstrItinClass;
259def IIC_JMP_MEM : InstrItinClass;
260def IIC_JMP_FAR_MEM : InstrItinClass;
261def IIC_JMP_FAR_PTR : InstrItinClass;
262// loop
263def IIC_LOOP : InstrItinClass;
264def IIC_LOOPE : InstrItinClass;
265def IIC_LOOPNE : InstrItinClass;
266// call
267def IIC_CALL_RI : InstrItinClass;
268def IIC_CALL_MEM : InstrItinClass;
269def IIC_CALL_FAR_MEM : InstrItinClass;
270def IIC_CALL_FAR_PTR : InstrItinClass;
271// ret
272def IIC_RET : InstrItinClass;
273def IIC_RET_IMM : InstrItinClass;
274//sign extension movs
275def IIC_MOVSX : InstrItinClass;
276def IIC_MOVSX_R16_R8 : InstrItinClass;
277def IIC_MOVSX_R16_M8 : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000278//zero extension movs
279def IIC_MOVZX : InstrItinClass;
280def IIC_MOVZX_R16_R8 : InstrItinClass;
281def IIC_MOVZX_R16_M8 : InstrItinClass;
282
283def IIC_REP_MOVS : InstrItinClass;
284def IIC_REP_STOS : InstrItinClass;
285
286// SSE scalar/parallel binary operations
287def IIC_SSE_ALU_F32S_RR : InstrItinClass;
288def IIC_SSE_ALU_F32S_RM : InstrItinClass;
289def IIC_SSE_ALU_F64S_RR : InstrItinClass;
290def IIC_SSE_ALU_F64S_RM : InstrItinClass;
291def IIC_SSE_MUL_F32S_RR : InstrItinClass;
292def IIC_SSE_MUL_F32S_RM : InstrItinClass;
293def IIC_SSE_MUL_F64S_RR : InstrItinClass;
294def IIC_SSE_MUL_F64S_RM : InstrItinClass;
295def IIC_SSE_DIV_F32S_RR : InstrItinClass;
296def IIC_SSE_DIV_F32S_RM : InstrItinClass;
297def IIC_SSE_DIV_F64S_RR : InstrItinClass;
298def IIC_SSE_DIV_F64S_RM : InstrItinClass;
299def IIC_SSE_ALU_F32P_RR : InstrItinClass;
300def IIC_SSE_ALU_F32P_RM : InstrItinClass;
301def IIC_SSE_ALU_F64P_RR : InstrItinClass;
302def IIC_SSE_ALU_F64P_RM : InstrItinClass;
303def IIC_SSE_MUL_F32P_RR : InstrItinClass;
304def IIC_SSE_MUL_F32P_RM : InstrItinClass;
305def IIC_SSE_MUL_F64P_RR : InstrItinClass;
306def IIC_SSE_MUL_F64P_RM : InstrItinClass;
307def IIC_SSE_DIV_F32P_RR : InstrItinClass;
308def IIC_SSE_DIV_F32P_RM : InstrItinClass;
309def IIC_SSE_DIV_F64P_RR : InstrItinClass;
310def IIC_SSE_DIV_F64P_RM : InstrItinClass;
311
312def IIC_SSE_COMIS_RR : InstrItinClass;
313def IIC_SSE_COMIS_RM : InstrItinClass;
314
315def IIC_SSE_HADDSUB_RR : InstrItinClass;
316def IIC_SSE_HADDSUB_RM : InstrItinClass;
317
318def IIC_SSE_BIT_P_RR : InstrItinClass;
319def IIC_SSE_BIT_P_RM : InstrItinClass;
320
321def IIC_SSE_INTALU_P_RR : InstrItinClass;
322def IIC_SSE_INTALU_P_RM : InstrItinClass;
323def IIC_SSE_INTALUQ_P_RR : InstrItinClass;
324def IIC_SSE_INTALUQ_P_RM : InstrItinClass;
325
326def IIC_SSE_INTMUL_P_RR : InstrItinClass;
327def IIC_SSE_INTMUL_P_RM : InstrItinClass;
328
329def IIC_SSE_INTSH_P_RR : InstrItinClass;
330def IIC_SSE_INTSH_P_RM : InstrItinClass;
331def IIC_SSE_INTSH_P_RI : InstrItinClass;
332
333def IIC_SSE_INTSHDQ_P_RI : InstrItinClass;
334
335def IIC_SSE_SHUFP : InstrItinClass;
336def IIC_SSE_PSHUF_RI : InstrItinClass;
337def IIC_SSE_PSHUF_MI : InstrItinClass;
338
Simon Pilgrim3f24ff62017-08-01 16:47:48 +0000339def IIC_SSE_PACK : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000340def IIC_SSE_UNPCK : InstrItinClass;
341
342def IIC_SSE_MOVMSK : InstrItinClass;
343def IIC_SSE_MASKMOV : InstrItinClass;
344
345def IIC_SSE_PEXTRW : InstrItinClass;
346def IIC_SSE_PINSRW : InstrItinClass;
347
348def IIC_SSE_PABS_RR : InstrItinClass;
349def IIC_SSE_PABS_RM : InstrItinClass;
350
351def IIC_SSE_SQRTPS_RR : InstrItinClass;
352def IIC_SSE_SQRTPS_RM : InstrItinClass;
353def IIC_SSE_SQRTSS_RR : InstrItinClass;
354def IIC_SSE_SQRTSS_RM : InstrItinClass;
355def IIC_SSE_SQRTPD_RR : InstrItinClass;
356def IIC_SSE_SQRTPD_RM : InstrItinClass;
357def IIC_SSE_SQRTSD_RR : InstrItinClass;
358def IIC_SSE_SQRTSD_RM : InstrItinClass;
359
360def IIC_SSE_RSQRTPS_RR : InstrItinClass;
361def IIC_SSE_RSQRTPS_RM : InstrItinClass;
362def IIC_SSE_RSQRTSS_RR : InstrItinClass;
363def IIC_SSE_RSQRTSS_RM : InstrItinClass;
364
365def IIC_SSE_RCPP_RR : InstrItinClass;
366def IIC_SSE_RCPP_RM : InstrItinClass;
367def IIC_SSE_RCPS_RR : InstrItinClass;
368def IIC_SSE_RCPS_RM : InstrItinClass;
369
370def IIC_SSE_MOV_S_RR : InstrItinClass;
371def IIC_SSE_MOV_S_RM : InstrItinClass;
372def IIC_SSE_MOV_S_MR : InstrItinClass;
373
374def IIC_SSE_MOVA_P_RR : InstrItinClass;
375def IIC_SSE_MOVA_P_RM : InstrItinClass;
376def IIC_SSE_MOVA_P_MR : InstrItinClass;
377
378def IIC_SSE_MOVU_P_RR : InstrItinClass;
379def IIC_SSE_MOVU_P_RM : InstrItinClass;
380def IIC_SSE_MOVU_P_MR : InstrItinClass;
381
382def IIC_SSE_MOVDQ : InstrItinClass;
383def IIC_SSE_MOVD_ToGP : InstrItinClass;
384def IIC_SSE_MOVQ_RR : InstrItinClass;
385
386def IIC_SSE_MOV_LH : InstrItinClass;
387
388def IIC_SSE_LDDQU : InstrItinClass;
389
390def IIC_SSE_MOVNT : InstrItinClass;
391
392def IIC_SSE_PHADDSUBD_RR : InstrItinClass;
393def IIC_SSE_PHADDSUBD_RM : InstrItinClass;
394def IIC_SSE_PHADDSUBSW_RR : InstrItinClass;
395def IIC_SSE_PHADDSUBSW_RM : InstrItinClass;
396def IIC_SSE_PHADDSUBW_RR : InstrItinClass;
397def IIC_SSE_PHADDSUBW_RM : InstrItinClass;
398def IIC_SSE_PSHUFB_RR : InstrItinClass;
399def IIC_SSE_PSHUFB_RM : InstrItinClass;
400def IIC_SSE_PSIGN_RR : InstrItinClass;
401def IIC_SSE_PSIGN_RM : InstrItinClass;
402
403def IIC_SSE_PMADD : InstrItinClass;
404def IIC_SSE_PMULHRSW : InstrItinClass;
405def IIC_SSE_PALIGNRR : InstrItinClass;
406def IIC_SSE_PALIGNRM : InstrItinClass;
407def IIC_SSE_MWAIT : InstrItinClass;
408def IIC_SSE_MONITOR : InstrItinClass;
409def IIC_SSE_MWAITX : InstrItinClass;
410def IIC_SSE_MONITORX : InstrItinClass;
411def IIC_SSE_CLZERO : InstrItinClass;
412
413def IIC_SSE_PREFETCH : InstrItinClass;
414def IIC_SSE_PAUSE : InstrItinClass;
415def IIC_SSE_LFENCE : InstrItinClass;
416def IIC_SSE_MFENCE : InstrItinClass;
417def IIC_SSE_SFENCE : InstrItinClass;
418def IIC_SSE_LDMXCSR : InstrItinClass;
419def IIC_SSE_STMXCSR : InstrItinClass;
420
421def IIC_SSE_CVT_PD_RR : InstrItinClass;
422def IIC_SSE_CVT_PD_RM : InstrItinClass;
423def IIC_SSE_CVT_PS_RR : InstrItinClass;
424def IIC_SSE_CVT_PS_RM : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000425def IIC_SSE_CVT_Scalar_RR : InstrItinClass;
426def IIC_SSE_CVT_Scalar_RM : InstrItinClass;
427def IIC_SSE_CVT_SS2SI32_RM : InstrItinClass;
428def IIC_SSE_CVT_SS2SI32_RR : InstrItinClass;
429def IIC_SSE_CVT_SS2SI64_RM : InstrItinClass;
430def IIC_SSE_CVT_SS2SI64_RR : InstrItinClass;
431def IIC_SSE_CVT_SD2SI_RM : InstrItinClass;
432def IIC_SSE_CVT_SD2SI_RR : InstrItinClass;
433
Simon Pilgrim91c159d2017-12-10 12:26:35 +0000434def IIC_AVX_ZERO : InstrItinClass;
435
Simon Pilgrima271c542017-05-03 15:42:29 +0000436// MMX
437def IIC_MMX_MOV_MM_RM : InstrItinClass;
438def IIC_MMX_MOV_REG_MM : InstrItinClass;
439def IIC_MMX_MOVQ_RM : InstrItinClass;
440def IIC_MMX_MOVQ_RR : InstrItinClass;
441
442def IIC_MMX_ALU_RM : InstrItinClass;
443def IIC_MMX_ALU_RR : InstrItinClass;
444def IIC_MMX_ALUQ_RM : InstrItinClass;
445def IIC_MMX_ALUQ_RR : InstrItinClass;
446def IIC_MMX_PHADDSUBW_RM : InstrItinClass;
447def IIC_MMX_PHADDSUBW_RR : InstrItinClass;
448def IIC_MMX_PHADDSUBD_RM : InstrItinClass;
449def IIC_MMX_PHADDSUBD_RR : InstrItinClass;
450def IIC_MMX_PMUL : InstrItinClass;
451def IIC_MMX_MISC_FUNC_MEM : InstrItinClass;
452def IIC_MMX_MISC_FUNC_REG : InstrItinClass;
453def IIC_MMX_PSADBW : InstrItinClass;
454def IIC_MMX_SHIFT_RI : InstrItinClass;
455def IIC_MMX_SHIFT_RM : InstrItinClass;
456def IIC_MMX_SHIFT_RR : InstrItinClass;
457def IIC_MMX_UNPCK_H_RM : InstrItinClass;
458def IIC_MMX_UNPCK_H_RR : InstrItinClass;
459def IIC_MMX_UNPCK_L : InstrItinClass;
460def IIC_MMX_PCK_RM : InstrItinClass;
461def IIC_MMX_PCK_RR : InstrItinClass;
462def IIC_MMX_PSHUF : InstrItinClass;
463def IIC_MMX_PEXTR : InstrItinClass;
464def IIC_MMX_PINSRW : InstrItinClass;
465def IIC_MMX_MASKMOV : InstrItinClass;
Simon Pilgrimf545bb6c2017-11-26 17:56:07 +0000466def IIC_MMX_MOVMSK : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000467def IIC_MMX_CVT_PD_RR : InstrItinClass;
468def IIC_MMX_CVT_PD_RM : InstrItinClass;
469def IIC_MMX_CVT_PS_RR : InstrItinClass;
470def IIC_MMX_CVT_PS_RM : InstrItinClass;
471
Simon Pilgrimfe6e92d2017-11-26 20:50:29 +0000472def IIC_3DNOW_FALU_RM : InstrItinClass;
473def IIC_3DNOW_FALU_RR : InstrItinClass;
474def IIC_3DNOW_FCVT_F2I_RM : InstrItinClass;
475def IIC_3DNOW_FCVT_F2I_RR : InstrItinClass;
476def IIC_3DNOW_FCVT_I2F_RM : InstrItinClass;
477def IIC_3DNOW_FCVT_I2F_RR : InstrItinClass;
478def IIC_3DNOW_MISC_FUNC_REG : InstrItinClass;
479def IIC_3DNOW_MISC_FUNC_MEM : InstrItinClass;
480
Simon Pilgrima271c542017-05-03 15:42:29 +0000481def IIC_CMPX_LOCK : InstrItinClass;
482def IIC_CMPX_LOCK_8 : InstrItinClass;
483def IIC_CMPX_LOCK_8B : InstrItinClass;
484def IIC_CMPX_LOCK_16B : InstrItinClass;
485
486def IIC_XADD_LOCK_MEM : InstrItinClass;
487def IIC_XADD_LOCK_MEM8 : InstrItinClass;
488
Simon Pilgrim65f805f2017-12-05 18:01:26 +0000489def IIC_FCMOV : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000490def IIC_FILD : InstrItinClass;
491def IIC_FLD : InstrItinClass;
492def IIC_FLD80 : InstrItinClass;
493def IIC_FST : InstrItinClass;
494def IIC_FST80 : InstrItinClass;
495def IIC_FIST : InstrItinClass;
496def IIC_FLDZ : InstrItinClass;
497def IIC_FUCOM : InstrItinClass;
498def IIC_FUCOMI : InstrItinClass;
499def IIC_FCOMI : InstrItinClass;
500def IIC_FNSTSW : InstrItinClass;
501def IIC_FNSTCW : InstrItinClass;
502def IIC_FLDCW : InstrItinClass;
503def IIC_FNINIT : InstrItinClass;
504def IIC_FFREE : InstrItinClass;
505def IIC_FNCLEX : InstrItinClass;
506def IIC_WAIT : InstrItinClass;
507def IIC_FXAM : InstrItinClass;
508def IIC_FNOP : InstrItinClass;
509def IIC_FLDL : InstrItinClass;
510def IIC_F2XM1 : InstrItinClass;
511def IIC_FYL2X : InstrItinClass;
512def IIC_FPTAN : InstrItinClass;
513def IIC_FPATAN : InstrItinClass;
514def IIC_FXTRACT : InstrItinClass;
515def IIC_FPREM1 : InstrItinClass;
516def IIC_FPSTP : InstrItinClass;
517def IIC_FPREM : InstrItinClass;
Simon Pilgrim0747a7e2017-11-28 15:03:42 +0000518def IIC_FSIGN : InstrItinClass;
519def IIC_FSQRT : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000520def IIC_FYL2XP1 : InstrItinClass;
521def IIC_FSINCOS : InstrItinClass;
522def IIC_FRNDINT : InstrItinClass;
523def IIC_FSCALE : InstrItinClass;
524def IIC_FCOMPP : InstrItinClass;
525def IIC_FXSAVE : InstrItinClass;
526def IIC_FXRSTOR : InstrItinClass;
527
528def IIC_FXCH : InstrItinClass;
529
530// System instructions
531def IIC_CPUID : InstrItinClass;
532def IIC_INT : InstrItinClass;
533def IIC_INT3 : InstrItinClass;
534def IIC_INVD : InstrItinClass;
535def IIC_INVLPG : InstrItinClass;
Simon Pilgrim1ddcae62017-12-08 15:48:37 +0000536def IIC_INVPCID : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000537def IIC_IRET : InstrItinClass;
538def IIC_HLT : InstrItinClass;
539def IIC_LXS : InstrItinClass;
540def IIC_LTR : InstrItinClass;
Simon Pilgrim42fcda92017-12-08 19:03:42 +0000541def IIC_MPX : InstrItinClass;
Simon Pilgrim1ddcae62017-12-08 15:48:37 +0000542def IIC_PKU : InstrItinClass;
543def IIC_PTWRITE : InstrItinClass;
544def IIC_RDPID : InstrItinClass;
Simon Pilgrim60411d92017-12-07 14:18:48 +0000545def IIC_RDRAND : InstrItinClass;
546def IIC_RDSEED : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000547def IIC_RDTSC : InstrItinClass;
Simon Pilgrimf00ea1b2017-12-13 14:22:04 +0000548def IIC_RDTSCP : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000549def IIC_RSM : InstrItinClass;
550def IIC_SIDT : InstrItinClass;
551def IIC_SGDT : InstrItinClass;
552def IIC_SLDT : InstrItinClass;
Simon Pilgrim1ddcae62017-12-08 15:48:37 +0000553def IIC_SMAP : InstrItinClass;
554def IIC_SMX : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000555def IIC_STR : InstrItinClass;
Simon Pilgrim6b7cd862017-12-07 14:35:17 +0000556def IIC_SKINIT : InstrItinClass;
557def IIC_SVM : InstrItinClass;
Simon Pilgrima13271b2017-12-07 15:57:32 +0000558def IIC_VMX : InstrItinClass;
Simon Pilgrim6b7cd862017-12-07 14:35:17 +0000559def IIC_CLGI : InstrItinClass;
560def IIC_STGI : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000561def IIC_SWAPGS : InstrItinClass;
562def IIC_SYSCALL : InstrItinClass;
563def IIC_SYS_ENTER_EXIT : InstrItinClass;
564def IIC_IN_RR : InstrItinClass;
565def IIC_IN_RI : InstrItinClass;
566def IIC_OUT_RR : InstrItinClass;
567def IIC_OUT_IR : InstrItinClass;
568def IIC_INS : InstrItinClass;
Simon Pilgrim99b925b2017-05-03 15:51:39 +0000569def IIC_LWP : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000570def IIC_MOV_REG_DR : InstrItinClass;
571def IIC_MOV_DR_REG : InstrItinClass;
572def IIC_MOV_REG_CR : InstrItinClass;
573def IIC_MOV_CR_REG : InstrItinClass;
574def IIC_MOV_REG_SR : InstrItinClass;
575def IIC_MOV_MEM_SR : InstrItinClass;
576def IIC_MOV_SR_REG : InstrItinClass;
577def IIC_MOV_SR_MEM : InstrItinClass;
578def IIC_LAR_RM : InstrItinClass;
579def IIC_LAR_RR : InstrItinClass;
580def IIC_LSL_RM : InstrItinClass;
581def IIC_LSL_RR : InstrItinClass;
582def IIC_LGDT : InstrItinClass;
583def IIC_LIDT : InstrItinClass;
584def IIC_LLDT_REG : InstrItinClass;
585def IIC_LLDT_MEM : InstrItinClass;
586def IIC_PUSH_CS : InstrItinClass;
587def IIC_PUSH_SR : InstrItinClass;
588def IIC_POP_SR : InstrItinClass;
589def IIC_POP_SR_SS : InstrItinClass;
Simon Pilgrim7e636cc2017-12-09 20:42:27 +0000590def IIC_SEGMENT_BASE_R : InstrItinClass;
591def IIC_SEGMENT_BASE_W : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000592def IIC_VERR : InstrItinClass;
593def IIC_VERW_REG : InstrItinClass;
594def IIC_VERW_MEM : InstrItinClass;
595def IIC_WRMSR : InstrItinClass;
596def IIC_RDMSR : InstrItinClass;
597def IIC_RDPMC : InstrItinClass;
598def IIC_SMSW : InstrItinClass;
599def IIC_LMSW_REG : InstrItinClass;
600def IIC_LMSW_MEM : InstrItinClass;
601def IIC_ENTER : InstrItinClass;
602def IIC_LEAVE : InstrItinClass;
603def IIC_POP_MEM : InstrItinClass;
604def IIC_POP_REG16 : InstrItinClass;
605def IIC_POP_REG : InstrItinClass;
606def IIC_POP_F : InstrItinClass;
607def IIC_POP_FD : InstrItinClass;
608def IIC_POP_A : InstrItinClass;
609def IIC_PUSH_IMM : InstrItinClass;
610def IIC_PUSH_MEM : InstrItinClass;
611def IIC_PUSH_REG : InstrItinClass;
612def IIC_PUSH_F : InstrItinClass;
613def IIC_PUSH_A : InstrItinClass;
614def IIC_BSWAP : InstrItinClass;
615def IIC_BIT_SCAN_MEM : InstrItinClass;
616def IIC_BIT_SCAN_REG : InstrItinClass;
Simon Pilgrimf1d599a2017-12-07 15:24:14 +0000617def IIC_LZCNT_RR : InstrItinClass;
618def IIC_LZCNT_RM : InstrItinClass;
619def IIC_TZCNT_RR : InstrItinClass;
620def IIC_TZCNT_RM : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000621def IIC_MOVS : InstrItinClass;
622def IIC_STOS : InstrItinClass;
623def IIC_SCAS : InstrItinClass;
624def IIC_CMPS : InstrItinClass;
625def IIC_MOV : InstrItinClass;
626def IIC_MOV_MEM : InstrItinClass;
627def IIC_AHF : InstrItinClass;
628def IIC_BT_MI : InstrItinClass;
629def IIC_BT_MR : InstrItinClass;
630def IIC_BT_RI : InstrItinClass;
631def IIC_BT_RR : InstrItinClass;
632def IIC_BTX_MI : InstrItinClass;
633def IIC_BTX_MR : InstrItinClass;
634def IIC_BTX_RI : InstrItinClass;
635def IIC_BTX_RR : InstrItinClass;
636def IIC_XCHG_REG : InstrItinClass;
637def IIC_XCHG_MEM : InstrItinClass;
638def IIC_XADD_REG : InstrItinClass;
639def IIC_XADD_MEM : InstrItinClass;
640def IIC_CMPXCHG_MEM : InstrItinClass;
641def IIC_CMPXCHG_REG : InstrItinClass;
642def IIC_CMPXCHG_MEM8 : InstrItinClass;
643def IIC_CMPXCHG_REG8 : InstrItinClass;
644def IIC_CMPXCHG_8B : InstrItinClass;
645def IIC_CMPXCHG_16B : InstrItinClass;
646def IIC_LODS : InstrItinClass;
647def IIC_OUTS : InstrItinClass;
Craig Topper22d25a02018-04-06 16:16:43 +0000648def IIC_CLC_CMC_STC : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000649def IIC_CLD : InstrItinClass;
650def IIC_CLI : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000651def IIC_CLTS : InstrItinClass;
Simon Pilgrima271c542017-05-03 15:42:29 +0000652def IIC_STI : InstrItinClass;
653def IIC_STD : InstrItinClass;
654def IIC_XLAT : InstrItinClass;
655def IIC_AAA : InstrItinClass;
656def IIC_AAD : InstrItinClass;
657def IIC_AAM : InstrItinClass;
658def IIC_AAS : InstrItinClass;
659def IIC_DAA : InstrItinClass;
660def IIC_DAS : InstrItinClass;
661def IIC_BOUND : InstrItinClass;
662def IIC_ARPL_REG : InstrItinClass;
663def IIC_ARPL_MEM : InstrItinClass;
664def IIC_MOVBE : InstrItinClass;
665def IIC_AES : InstrItinClass;
666def IIC_BLEND_MEM : InstrItinClass;
667def IIC_BLEND_NOMEM : InstrItinClass;
668def IIC_CBW : InstrItinClass;
669def IIC_CRC32_REG : InstrItinClass;
670def IIC_CRC32_MEM : InstrItinClass;
671def IIC_SSE_DPPD_RR : InstrItinClass;
672def IIC_SSE_DPPD_RM : InstrItinClass;
673def IIC_SSE_DPPS_RR : InstrItinClass;
674def IIC_SSE_DPPS_RM : InstrItinClass;
675def IIC_MMX_EMMS : InstrItinClass;
676def IIC_SSE_EXTRACTPS_RR : InstrItinClass;
677def IIC_SSE_EXTRACTPS_RM : InstrItinClass;
678def IIC_SSE_INSERTPS_RR : InstrItinClass;
679def IIC_SSE_INSERTPS_RM : InstrItinClass;
680def IIC_SSE_MPSADBW_RR : InstrItinClass;
681def IIC_SSE_MPSADBW_RM : InstrItinClass;
682def IIC_SSE_PMULLD_RR : InstrItinClass;
683def IIC_SSE_PMULLD_RM : InstrItinClass;
684def IIC_SSE_ROUNDPS_REG : InstrItinClass;
685def IIC_SSE_ROUNDPS_MEM : InstrItinClass;
686def IIC_SSE_ROUNDPD_REG : InstrItinClass;
687def IIC_SSE_ROUNDPD_MEM : InstrItinClass;
688def IIC_SSE_POPCNT_RR : InstrItinClass;
689def IIC_SSE_POPCNT_RM : InstrItinClass;
690def IIC_SSE_PCLMULQDQ_RR : InstrItinClass;
691def IIC_SSE_PCLMULQDQ_RM : InstrItinClass;
692
693def IIC_NOP : InstrItinClass;
694
695//===----------------------------------------------------------------------===//
696// Processor instruction itineraries.
697
698// IssueWidth is analogous to the number of decode units. Core and its
699// descendents, including Nehalem and SandyBridge have 4 decoders.
700// Resources beyond the decoder operate on micro-ops and are bufferred
701// so adjacent micro-ops don't directly compete.
702//
703// MicroOpBufferSize > 1 indicates that RAW dependencies can be
704// decoded in the same cycle. The value 32 is a reasonably arbitrary
705// number of in-flight instructions.
706//
707// HighLatency=10 is optimistic. X86InstrInfo::isHighLatencyDef
708// indicates high latency opcodes. Alternatively, InstrItinData
709// entries may be included here to define specific operand
710// latencies. Since these latencies are not used for pipeline hazards,
711// they do not need to be exact.
712//
713// The GenericX86Model contains no instruction itineraries
714// and disables PostRAScheduler.
715class GenericX86Model : SchedMachineModel {
716 let IssueWidth = 4;
717 let MicroOpBufferSize = 32;
718 let LoadLatency = 4;
719 let HighLatency = 10;
720 let PostRAScheduler = 0;
721 let CompleteModel = 0;
722}
723
724def GenericModel : GenericX86Model;
725
726// Define a model with the PostRAScheduler enabled.
727def GenericPostRAModel : GenericX86Model {
728 let PostRAScheduler = 1;
729}
730