xref: /aosp_15_r20/external/llvm/lib/Target/X86/X86.td (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker//===-- X86.td - Target definition file for the Intel X86 --*- tablegen -*-===//
2*9880d681SAndroid Build Coastguard Worker//
3*9880d681SAndroid Build Coastguard Worker//                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker//
5*9880d681SAndroid Build Coastguard Worker// This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker// License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker//
8*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker//
10*9880d681SAndroid Build Coastguard Worker// This is a target description file for the Intel i386 architecture, referred
11*9880d681SAndroid Build Coastguard Worker// to here as the "X86" architecture.
12*9880d681SAndroid Build Coastguard Worker//
13*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker// Get the target-independent interfaces which we are implementing...
16*9880d681SAndroid Build Coastguard Worker//
17*9880d681SAndroid Build Coastguard Workerinclude "llvm/Target/Target.td"
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
20*9880d681SAndroid Build Coastguard Worker// X86 Subtarget state
21*9880d681SAndroid Build Coastguard Worker//
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workerdef Mode64Bit : SubtargetFeature<"64bit-mode", "In64BitMode", "true",
24*9880d681SAndroid Build Coastguard Worker                                  "64-bit mode (x86_64)">;
25*9880d681SAndroid Build Coastguard Workerdef Mode32Bit : SubtargetFeature<"32bit-mode", "In32BitMode", "true",
26*9880d681SAndroid Build Coastguard Worker                                  "32-bit mode (80386)">;
27*9880d681SAndroid Build Coastguard Workerdef Mode16Bit : SubtargetFeature<"16bit-mode", "In16BitMode", "true",
28*9880d681SAndroid Build Coastguard Worker                                  "16-bit mode (i8086)">;
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
31*9880d681SAndroid Build Coastguard Worker// X86 Subtarget features
32*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Workerdef FeatureX87     : SubtargetFeature<"x87","HasX87", "true",
35*9880d681SAndroid Build Coastguard Worker                                      "Enable X87 float instructions">;
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Workerdef FeatureCMOV    : SubtargetFeature<"cmov","HasCMov", "true",
38*9880d681SAndroid Build Coastguard Worker                                      "Enable conditional move instructions">;
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard Workerdef FeaturePOPCNT   : SubtargetFeature<"popcnt", "HasPOPCNT", "true",
41*9880d681SAndroid Build Coastguard Worker                                       "Support POPCNT instruction">;
42*9880d681SAndroid Build Coastguard Worker
43*9880d681SAndroid Build Coastguard Workerdef FeatureFXSR    : SubtargetFeature<"fxsr", "HasFXSR", "true",
44*9880d681SAndroid Build Coastguard Worker                                      "Support fxsave/fxrestore instructions">;
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Workerdef FeatureXSAVE   : SubtargetFeature<"xsave", "HasXSAVE", "true",
47*9880d681SAndroid Build Coastguard Worker                                       "Support xsave instructions">;
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Workerdef FeatureXSAVEOPT: SubtargetFeature<"xsaveopt", "HasXSAVEOPT", "true",
50*9880d681SAndroid Build Coastguard Worker                                       "Support xsaveopt instructions">;
51*9880d681SAndroid Build Coastguard Worker
52*9880d681SAndroid Build Coastguard Workerdef FeatureXSAVEC  : SubtargetFeature<"xsavec", "HasXSAVEC", "true",
53*9880d681SAndroid Build Coastguard Worker                                       "Support xsavec instructions">;
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Workerdef FeatureXSAVES  : SubtargetFeature<"xsaves", "HasXSAVES", "true",
56*9880d681SAndroid Build Coastguard Worker                                       "Support xsaves instructions">;
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard Workerdef FeatureSSE1    : SubtargetFeature<"sse", "X86SSELevel", "SSE1",
59*9880d681SAndroid Build Coastguard Worker                                      "Enable SSE instructions",
60*9880d681SAndroid Build Coastguard Worker                                      // SSE codegen depends on cmovs, and all
61*9880d681SAndroid Build Coastguard Worker                                      // SSE1+ processors support them.
62*9880d681SAndroid Build Coastguard Worker                                      [FeatureCMOV]>;
63*9880d681SAndroid Build Coastguard Workerdef FeatureSSE2    : SubtargetFeature<"sse2", "X86SSELevel", "SSE2",
64*9880d681SAndroid Build Coastguard Worker                                      "Enable SSE2 instructions",
65*9880d681SAndroid Build Coastguard Worker                                      [FeatureSSE1]>;
66*9880d681SAndroid Build Coastguard Workerdef FeatureSSE3    : SubtargetFeature<"sse3", "X86SSELevel", "SSE3",
67*9880d681SAndroid Build Coastguard Worker                                      "Enable SSE3 instructions",
68*9880d681SAndroid Build Coastguard Worker                                      [FeatureSSE2]>;
69*9880d681SAndroid Build Coastguard Workerdef FeatureSSSE3   : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3",
70*9880d681SAndroid Build Coastguard Worker                                      "Enable SSSE3 instructions",
71*9880d681SAndroid Build Coastguard Worker                                      [FeatureSSE3]>;
72*9880d681SAndroid Build Coastguard Workerdef FeatureSSE41   : SubtargetFeature<"sse4.1", "X86SSELevel", "SSE41",
73*9880d681SAndroid Build Coastguard Worker                                      "Enable SSE 4.1 instructions",
74*9880d681SAndroid Build Coastguard Worker                                      [FeatureSSSE3]>;
75*9880d681SAndroid Build Coastguard Workerdef FeatureSSE42   : SubtargetFeature<"sse4.2", "X86SSELevel", "SSE42",
76*9880d681SAndroid Build Coastguard Worker                                      "Enable SSE 4.2 instructions",
77*9880d681SAndroid Build Coastguard Worker                                      [FeatureSSE41]>;
78*9880d681SAndroid Build Coastguard Worker// The MMX subtarget feature is separate from the rest of the SSE features
79*9880d681SAndroid Build Coastguard Worker// because it's important (for odd compatibility reasons) to be able to
80*9880d681SAndroid Build Coastguard Worker// turn it off explicitly while allowing SSE+ to be on.
81*9880d681SAndroid Build Coastguard Workerdef FeatureMMX     : SubtargetFeature<"mmx","X863DNowLevel", "MMX",
82*9880d681SAndroid Build Coastguard Worker                                      "Enable MMX instructions">;
83*9880d681SAndroid Build Coastguard Workerdef Feature3DNow   : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow",
84*9880d681SAndroid Build Coastguard Worker                                      "Enable 3DNow! instructions",
85*9880d681SAndroid Build Coastguard Worker                                      [FeatureMMX]>;
86*9880d681SAndroid Build Coastguard Workerdef Feature3DNowA  : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA",
87*9880d681SAndroid Build Coastguard Worker                                      "Enable 3DNow! Athlon instructions",
88*9880d681SAndroid Build Coastguard Worker                                      [Feature3DNow]>;
89*9880d681SAndroid Build Coastguard Worker// All x86-64 hardware has SSE2, but we don't mark SSE2 as an implied
90*9880d681SAndroid Build Coastguard Worker// feature, because SSE2 can be disabled (e.g. for compiling OS kernels)
91*9880d681SAndroid Build Coastguard Worker// without disabling 64-bit mode.
92*9880d681SAndroid Build Coastguard Workerdef Feature64Bit   : SubtargetFeature<"64bit", "HasX86_64", "true",
93*9880d681SAndroid Build Coastguard Worker                                      "Support 64-bit instructions",
94*9880d681SAndroid Build Coastguard Worker                                      [FeatureCMOV]>;
95*9880d681SAndroid Build Coastguard Workerdef FeatureCMPXCHG16B : SubtargetFeature<"cx16", "HasCmpxchg16b", "true",
96*9880d681SAndroid Build Coastguard Worker                                      "64-bit with cmpxchg16b",
97*9880d681SAndroid Build Coastguard Worker                                      [Feature64Bit]>;
98*9880d681SAndroid Build Coastguard Workerdef FeatureSlowBTMem : SubtargetFeature<"slow-bt-mem", "IsBTMemSlow", "true",
99*9880d681SAndroid Build Coastguard Worker                                       "Bit testing of memory is slow">;
100*9880d681SAndroid Build Coastguard Workerdef FeatureSlowSHLD : SubtargetFeature<"slow-shld", "IsSHLDSlow", "true",
101*9880d681SAndroid Build Coastguard Worker                                       "SHLD instruction is slow">;
102*9880d681SAndroid Build Coastguard Worker// FIXME: This should not apply to CPUs that do not have SSE.
103*9880d681SAndroid Build Coastguard Workerdef FeatureSlowUAMem16 : SubtargetFeature<"slow-unaligned-mem-16",
104*9880d681SAndroid Build Coastguard Worker                                "IsUAMem16Slow", "true",
105*9880d681SAndroid Build Coastguard Worker                                "Slow unaligned 16-byte memory access">;
106*9880d681SAndroid Build Coastguard Workerdef FeatureSlowUAMem32 : SubtargetFeature<"slow-unaligned-mem-32",
107*9880d681SAndroid Build Coastguard Worker                                "IsUAMem32Slow", "true",
108*9880d681SAndroid Build Coastguard Worker                                "Slow unaligned 32-byte memory access">;
109*9880d681SAndroid Build Coastguard Workerdef FeatureSSE4A   : SubtargetFeature<"sse4a", "HasSSE4A", "true",
110*9880d681SAndroid Build Coastguard Worker                                      "Support SSE 4a instructions",
111*9880d681SAndroid Build Coastguard Worker                                      [FeatureSSE3]>;
112*9880d681SAndroid Build Coastguard Worker
113*9880d681SAndroid Build Coastguard Workerdef FeatureAVX     : SubtargetFeature<"avx", "X86SSELevel", "AVX",
114*9880d681SAndroid Build Coastguard Worker                                      "Enable AVX instructions",
115*9880d681SAndroid Build Coastguard Worker                                      [FeatureSSE42]>;
116*9880d681SAndroid Build Coastguard Workerdef FeatureAVX2    : SubtargetFeature<"avx2", "X86SSELevel", "AVX2",
117*9880d681SAndroid Build Coastguard Worker                                      "Enable AVX2 instructions",
118*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX]>;
119*9880d681SAndroid Build Coastguard Workerdef FeatureAVX512   : SubtargetFeature<"avx512f", "X86SSELevel", "AVX512F",
120*9880d681SAndroid Build Coastguard Worker                                      "Enable AVX-512 instructions",
121*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX2]>;
122*9880d681SAndroid Build Coastguard Workerdef FeatureERI      : SubtargetFeature<"avx512er", "HasERI", "true",
123*9880d681SAndroid Build Coastguard Worker                      "Enable AVX-512 Exponential and Reciprocal Instructions",
124*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX512]>;
125*9880d681SAndroid Build Coastguard Workerdef FeatureCDI      : SubtargetFeature<"avx512cd", "HasCDI", "true",
126*9880d681SAndroid Build Coastguard Worker                      "Enable AVX-512 Conflict Detection Instructions",
127*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX512]>;
128*9880d681SAndroid Build Coastguard Workerdef FeaturePFI      : SubtargetFeature<"avx512pf", "HasPFI", "true",
129*9880d681SAndroid Build Coastguard Worker                      "Enable AVX-512 PreFetch Instructions",
130*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX512]>;
131*9880d681SAndroid Build Coastguard Workerdef FeaturePREFETCHWT1  : SubtargetFeature<"prefetchwt1", "HasPFPREFETCHWT1",
132*9880d681SAndroid Build Coastguard Worker                                   "true",
133*9880d681SAndroid Build Coastguard Worker                                   "Prefetch with Intent to Write and T1 Hint">;
134*9880d681SAndroid Build Coastguard Workerdef FeatureDQI     : SubtargetFeature<"avx512dq", "HasDQI", "true",
135*9880d681SAndroid Build Coastguard Worker                      "Enable AVX-512 Doubleword and Quadword Instructions",
136*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX512]>;
137*9880d681SAndroid Build Coastguard Workerdef FeatureBWI     : SubtargetFeature<"avx512bw", "HasBWI", "true",
138*9880d681SAndroid Build Coastguard Worker                      "Enable AVX-512 Byte and Word Instructions",
139*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX512]>;
140*9880d681SAndroid Build Coastguard Workerdef FeatureVLX     : SubtargetFeature<"avx512vl", "HasVLX", "true",
141*9880d681SAndroid Build Coastguard Worker                      "Enable AVX-512 Vector Length eXtensions",
142*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX512]>;
143*9880d681SAndroid Build Coastguard Workerdef FeatureVBMI     : SubtargetFeature<"avx512vbmi", "HasVBMI", "true",
144*9880d681SAndroid Build Coastguard Worker                      "Enable AVX-512 Vector Bit Manipulation Instructions",
145*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX512]>;
146*9880d681SAndroid Build Coastguard Workerdef FeatureIFMA     : SubtargetFeature<"avx512ifma", "HasIFMA", "true",
147*9880d681SAndroid Build Coastguard Worker                      "Enable AVX-512 Integer Fused Multiple-Add",
148*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX512]>;
149*9880d681SAndroid Build Coastguard Workerdef FeaturePKU   : SubtargetFeature<"pku", "HasPKU", "true",
150*9880d681SAndroid Build Coastguard Worker                      "Enable protection keys">;
151*9880d681SAndroid Build Coastguard Workerdef FeaturePCLMUL  : SubtargetFeature<"pclmul", "HasPCLMUL", "true",
152*9880d681SAndroid Build Coastguard Worker                         "Enable packed carry-less multiplication instructions",
153*9880d681SAndroid Build Coastguard Worker                               [FeatureSSE2]>;
154*9880d681SAndroid Build Coastguard Workerdef FeatureFMA     : SubtargetFeature<"fma", "HasFMA", "true",
155*9880d681SAndroid Build Coastguard Worker                                      "Enable three-operand fused multiple-add",
156*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX]>;
157*9880d681SAndroid Build Coastguard Workerdef FeatureFMA4    : SubtargetFeature<"fma4", "HasFMA4", "true",
158*9880d681SAndroid Build Coastguard Worker                                      "Enable four-operand fused multiple-add",
159*9880d681SAndroid Build Coastguard Worker                                      [FeatureAVX, FeatureSSE4A]>;
160*9880d681SAndroid Build Coastguard Workerdef FeatureXOP     : SubtargetFeature<"xop", "HasXOP", "true",
161*9880d681SAndroid Build Coastguard Worker                                      "Enable XOP instructions",
162*9880d681SAndroid Build Coastguard Worker                                      [FeatureFMA4]>;
163*9880d681SAndroid Build Coastguard Workerdef FeatureSSEUnalignedMem : SubtargetFeature<"sse-unaligned-mem",
164*9880d681SAndroid Build Coastguard Worker                                          "HasSSEUnalignedMem", "true",
165*9880d681SAndroid Build Coastguard Worker                      "Allow unaligned memory operands with SSE instructions">;
166*9880d681SAndroid Build Coastguard Workerdef FeatureAES     : SubtargetFeature<"aes", "HasAES", "true",
167*9880d681SAndroid Build Coastguard Worker                                      "Enable AES instructions",
168*9880d681SAndroid Build Coastguard Worker                                      [FeatureSSE2]>;
169*9880d681SAndroid Build Coastguard Workerdef FeatureTBM     : SubtargetFeature<"tbm", "HasTBM", "true",
170*9880d681SAndroid Build Coastguard Worker                                      "Enable TBM instructions">;
171*9880d681SAndroid Build Coastguard Workerdef FeatureMOVBE   : SubtargetFeature<"movbe", "HasMOVBE", "true",
172*9880d681SAndroid Build Coastguard Worker                                      "Support MOVBE instruction">;
173*9880d681SAndroid Build Coastguard Workerdef FeatureRDRAND  : SubtargetFeature<"rdrnd", "HasRDRAND", "true",
174*9880d681SAndroid Build Coastguard Worker                                      "Support RDRAND instruction">;
175*9880d681SAndroid Build Coastguard Workerdef FeatureF16C    : SubtargetFeature<"f16c", "HasF16C", "true",
176*9880d681SAndroid Build Coastguard Worker                       "Support 16-bit floating point conversion instructions",
177*9880d681SAndroid Build Coastguard Worker                       [FeatureAVX]>;
178*9880d681SAndroid Build Coastguard Workerdef FeatureFSGSBase : SubtargetFeature<"fsgsbase", "HasFSGSBase", "true",
179*9880d681SAndroid Build Coastguard Worker                                       "Support FS/GS Base instructions">;
180*9880d681SAndroid Build Coastguard Workerdef FeatureLZCNT   : SubtargetFeature<"lzcnt", "HasLZCNT", "true",
181*9880d681SAndroid Build Coastguard Worker                                      "Support LZCNT instruction">;
182*9880d681SAndroid Build Coastguard Workerdef FeatureBMI     : SubtargetFeature<"bmi", "HasBMI", "true",
183*9880d681SAndroid Build Coastguard Worker                                      "Support BMI instructions">;
184*9880d681SAndroid Build Coastguard Workerdef FeatureBMI2    : SubtargetFeature<"bmi2", "HasBMI2", "true",
185*9880d681SAndroid Build Coastguard Worker                                      "Support BMI2 instructions">;
186*9880d681SAndroid Build Coastguard Workerdef FeatureRTM     : SubtargetFeature<"rtm", "HasRTM", "true",
187*9880d681SAndroid Build Coastguard Worker                                      "Support RTM instructions">;
188*9880d681SAndroid Build Coastguard Workerdef FeatureHLE     : SubtargetFeature<"hle", "HasHLE", "true",
189*9880d681SAndroid Build Coastguard Worker                                      "Support HLE">;
190*9880d681SAndroid Build Coastguard Workerdef FeatureADX     : SubtargetFeature<"adx", "HasADX", "true",
191*9880d681SAndroid Build Coastguard Worker                                      "Support ADX instructions">;
192*9880d681SAndroid Build Coastguard Workerdef FeatureSHA     : SubtargetFeature<"sha", "HasSHA", "true",
193*9880d681SAndroid Build Coastguard Worker                                      "Enable SHA instructions",
194*9880d681SAndroid Build Coastguard Worker                                      [FeatureSSE2]>;
195*9880d681SAndroid Build Coastguard Workerdef FeaturePRFCHW  : SubtargetFeature<"prfchw", "HasPRFCHW", "true",
196*9880d681SAndroid Build Coastguard Worker                                      "Support PRFCHW instructions">;
197*9880d681SAndroid Build Coastguard Workerdef FeatureRDSEED  : SubtargetFeature<"rdseed", "HasRDSEED", "true",
198*9880d681SAndroid Build Coastguard Worker                                      "Support RDSEED instruction">;
199*9880d681SAndroid Build Coastguard Workerdef FeatureLAHFSAHF : SubtargetFeature<"sahf", "HasLAHFSAHF", "true",
200*9880d681SAndroid Build Coastguard Worker                                       "Support LAHF and SAHF instructions">;
201*9880d681SAndroid Build Coastguard Workerdef FeatureMWAITX  : SubtargetFeature<"mwaitx", "HasMWAITX", "true",
202*9880d681SAndroid Build Coastguard Worker                                      "Enable MONITORX/MWAITX timer functionality">;
203*9880d681SAndroid Build Coastguard Workerdef FeatureMPX     : SubtargetFeature<"mpx", "HasMPX", "true",
204*9880d681SAndroid Build Coastguard Worker                                      "Support MPX instructions">;
205*9880d681SAndroid Build Coastguard Workerdef FeatureLEAForSP : SubtargetFeature<"lea-sp", "UseLeaForSP", "true",
206*9880d681SAndroid Build Coastguard Worker                                     "Use LEA for adjusting the stack pointer">;
207*9880d681SAndroid Build Coastguard Workerdef FeatureSlowDivide32 : SubtargetFeature<"idivl-to-divb",
208*9880d681SAndroid Build Coastguard Worker                                     "HasSlowDivide32", "true",
209*9880d681SAndroid Build Coastguard Worker                                     "Use 8-bit divide for positive values less than 256">;
210*9880d681SAndroid Build Coastguard Workerdef FeatureSlowDivide64 : SubtargetFeature<"idivq-to-divw",
211*9880d681SAndroid Build Coastguard Worker                                     "HasSlowDivide64", "true",
212*9880d681SAndroid Build Coastguard Worker                                     "Use 16-bit divide for positive values less than 65536">;
213*9880d681SAndroid Build Coastguard Workerdef FeaturePadShortFunctions : SubtargetFeature<"pad-short-functions",
214*9880d681SAndroid Build Coastguard Worker                                     "PadShortFunctions", "true",
215*9880d681SAndroid Build Coastguard Worker                                     "Pad short functions">;
216*9880d681SAndroid Build Coastguard Workerdef FeatureINVPCID : SubtargetFeature<"invpcid", "HasInvPCId", "true",
217*9880d681SAndroid Build Coastguard Worker                                      "Invalidate Process-Context Identifier">;
218*9880d681SAndroid Build Coastguard Workerdef FeatureVMFUNC  : SubtargetFeature<"vmfunc", "HasVMFUNC", "true",
219*9880d681SAndroid Build Coastguard Worker                                      "VM Functions">;
220*9880d681SAndroid Build Coastguard Workerdef FeatureSMAP    : SubtargetFeature<"smap", "HasSMAP", "true",
221*9880d681SAndroid Build Coastguard Worker                                      "Supervisor Mode Access Protection">;
222*9880d681SAndroid Build Coastguard Workerdef FeatureSGX     : SubtargetFeature<"sgx", "HasSGX", "true",
223*9880d681SAndroid Build Coastguard Worker                                      "Enable Software Guard Extensions">;
224*9880d681SAndroid Build Coastguard Workerdef FeatureCLFLUSHOPT : SubtargetFeature<"clflushopt", "HasCLFLUSHOPT", "true",
225*9880d681SAndroid Build Coastguard Worker                                      "Flush A Cache Line Optimized">;
226*9880d681SAndroid Build Coastguard Workerdef FeaturePCOMMIT : SubtargetFeature<"pcommit", "HasPCOMMIT", "true",
227*9880d681SAndroid Build Coastguard Worker                                      "Enable Persistent Commit">;
228*9880d681SAndroid Build Coastguard Workerdef FeatureCLWB    : SubtargetFeature<"clwb", "HasCLWB", "true",
229*9880d681SAndroid Build Coastguard Worker                                      "Cache Line Write Back">;
230*9880d681SAndroid Build Coastguard Worker// TODO: This feature ought to be renamed.
231*9880d681SAndroid Build Coastguard Worker// What it really refers to are CPUs for which certain instructions
232*9880d681SAndroid Build Coastguard Worker// (which ones besides the example below?) are microcoded.
233*9880d681SAndroid Build Coastguard Worker// The best examples of this are the memory forms of CALL and PUSH
234*9880d681SAndroid Build Coastguard Worker// instructions, which should be avoided in favor of a MOV + register CALL/PUSH.
235*9880d681SAndroid Build Coastguard Workerdef FeatureCallRegIndirect : SubtargetFeature<"call-reg-indirect",
236*9880d681SAndroid Build Coastguard Worker                                     "CallRegIndirect", "true",
237*9880d681SAndroid Build Coastguard Worker                                     "Call register indirect">;
238*9880d681SAndroid Build Coastguard Workerdef FeatureLEAUsesAG : SubtargetFeature<"lea-uses-ag", "LEAUsesAG", "true",
239*9880d681SAndroid Build Coastguard Worker                                   "LEA instruction needs inputs at AG stage">;
240*9880d681SAndroid Build Coastguard Workerdef FeatureSlowLEA : SubtargetFeature<"slow-lea", "SlowLEA", "true",
241*9880d681SAndroid Build Coastguard Worker                                   "LEA instruction with certain arguments is slow">;
242*9880d681SAndroid Build Coastguard Workerdef FeatureSlowIncDec : SubtargetFeature<"slow-incdec", "SlowIncDec", "true",
243*9880d681SAndroid Build Coastguard Worker                                   "INC and DEC instructions are slower than ADD and SUB">;
244*9880d681SAndroid Build Coastguard Workerdef FeatureSoftFloat
245*9880d681SAndroid Build Coastguard Worker    : SubtargetFeature<"soft-float", "UseSoftFloat", "true",
246*9880d681SAndroid Build Coastguard Worker                       "Use software floating point features.">;
247*9880d681SAndroid Build Coastguard Worker// On at least some AMD processors, there is no performance hazard to writing
248*9880d681SAndroid Build Coastguard Worker// only the lower parts of a YMM register without clearing the upper part.
249*9880d681SAndroid Build Coastguard Workerdef FeatureFastPartialYMMWrite
250*9880d681SAndroid Build Coastguard Worker    : SubtargetFeature<"fast-partial-ymm-write", "HasFastPartialYMMWrite",
251*9880d681SAndroid Build Coastguard Worker                       "true", "Partial writes to YMM registers are fast">;
252*9880d681SAndroid Build Coastguard Worker
253*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
254*9880d681SAndroid Build Coastguard Worker// X86 processors supported.
255*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
256*9880d681SAndroid Build Coastguard Worker
257*9880d681SAndroid Build Coastguard Workerinclude "X86Schedule.td"
258*9880d681SAndroid Build Coastguard Worker
259*9880d681SAndroid Build Coastguard Workerdef ProcIntelAtom : SubtargetFeature<"atom", "X86ProcFamily", "IntelAtom",
260*9880d681SAndroid Build Coastguard Worker                    "Intel Atom processors">;
261*9880d681SAndroid Build Coastguard Workerdef ProcIntelSLM  : SubtargetFeature<"slm", "X86ProcFamily", "IntelSLM",
262*9880d681SAndroid Build Coastguard Worker                    "Intel Silvermont processors">;
263*9880d681SAndroid Build Coastguard Worker
264*9880d681SAndroid Build Coastguard Workerclass Proc<string Name, list<SubtargetFeature> Features>
265*9880d681SAndroid Build Coastguard Worker : ProcessorModel<Name, GenericModel, Features>;
266*9880d681SAndroid Build Coastguard Worker
267*9880d681SAndroid Build Coastguard Workerdef : Proc<"generic",         [FeatureX87, FeatureSlowUAMem16]>;
268*9880d681SAndroid Build Coastguard Workerdef : Proc<"i386",            [FeatureX87, FeatureSlowUAMem16]>;
269*9880d681SAndroid Build Coastguard Workerdef : Proc<"i486",            [FeatureX87, FeatureSlowUAMem16]>;
270*9880d681SAndroid Build Coastguard Workerdef : Proc<"i586",            [FeatureX87, FeatureSlowUAMem16]>;
271*9880d681SAndroid Build Coastguard Workerdef : Proc<"pentium",         [FeatureX87, FeatureSlowUAMem16]>;
272*9880d681SAndroid Build Coastguard Workerdef : Proc<"pentium-mmx",     [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>;
273*9880d681SAndroid Build Coastguard Workerdef : Proc<"i686",            [FeatureX87, FeatureSlowUAMem16]>;
274*9880d681SAndroid Build Coastguard Workerdef : Proc<"pentiumpro",      [FeatureX87, FeatureSlowUAMem16, FeatureCMOV]>;
275*9880d681SAndroid Build Coastguard Workerdef : Proc<"pentium2",        [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
276*9880d681SAndroid Build Coastguard Worker                               FeatureCMOV, FeatureFXSR]>;
277*9880d681SAndroid Build Coastguard Workerdef : Proc<"pentium3",        [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
278*9880d681SAndroid Build Coastguard Worker                               FeatureSSE1, FeatureFXSR]>;
279*9880d681SAndroid Build Coastguard Workerdef : Proc<"pentium3m",       [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
280*9880d681SAndroid Build Coastguard Worker                               FeatureSSE1, FeatureFXSR, FeatureSlowBTMem]>;
281*9880d681SAndroid Build Coastguard Worker
282*9880d681SAndroid Build Coastguard Worker// Enable the PostRAScheduler for SSE2 and SSE3 class cpus.
283*9880d681SAndroid Build Coastguard Worker// The intent is to enable it for pentium4 which is the current default
284*9880d681SAndroid Build Coastguard Worker// processor in a vanilla 32-bit clang compilation when no specific
285*9880d681SAndroid Build Coastguard Worker// architecture is specified.  This generally gives a nice performance
286*9880d681SAndroid Build Coastguard Worker// increase on silvermont, with largely neutral behavior on other
287*9880d681SAndroid Build Coastguard Worker// contemporary large core processors.
288*9880d681SAndroid Build Coastguard Worker// pentium-m, pentium4m, prescott and nocona are included as a preventative
289*9880d681SAndroid Build Coastguard Worker// measure to avoid performance surprises, in case clang's default cpu
290*9880d681SAndroid Build Coastguard Worker// changes slightly.
291*9880d681SAndroid Build Coastguard Worker
292*9880d681SAndroid Build Coastguard Workerdef : ProcessorModel<"pentium-m", GenericPostRAModel,
293*9880d681SAndroid Build Coastguard Worker                     [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
294*9880d681SAndroid Build Coastguard Worker                      FeatureSSE2, FeatureFXSR, FeatureSlowBTMem]>;
295*9880d681SAndroid Build Coastguard Worker
296*9880d681SAndroid Build Coastguard Workerdef : ProcessorModel<"pentium4", GenericPostRAModel,
297*9880d681SAndroid Build Coastguard Worker                     [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
298*9880d681SAndroid Build Coastguard Worker                      FeatureSSE2, FeatureFXSR]>;
299*9880d681SAndroid Build Coastguard Worker
300*9880d681SAndroid Build Coastguard Workerdef : ProcessorModel<"pentium4m", GenericPostRAModel,
301*9880d681SAndroid Build Coastguard Worker                     [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
302*9880d681SAndroid Build Coastguard Worker                      FeatureSSE2, FeatureFXSR, FeatureSlowBTMem]>;
303*9880d681SAndroid Build Coastguard Worker
304*9880d681SAndroid Build Coastguard Worker// Intel Quark.
305*9880d681SAndroid Build Coastguard Workerdef : Proc<"lakemont",        []>;
306*9880d681SAndroid Build Coastguard Worker
307*9880d681SAndroid Build Coastguard Worker// Intel Core Duo.
308*9880d681SAndroid Build Coastguard Workerdef : ProcessorModel<"yonah", SandyBridgeModel,
309*9880d681SAndroid Build Coastguard Worker                     [FeatureX87, FeatureSlowUAMem16, FeatureMMX, FeatureSSE3,
310*9880d681SAndroid Build Coastguard Worker                      FeatureFXSR, FeatureSlowBTMem]>;
311*9880d681SAndroid Build Coastguard Worker
312*9880d681SAndroid Build Coastguard Worker// NetBurst.
313*9880d681SAndroid Build Coastguard Workerdef : ProcessorModel<"prescott", GenericPostRAModel,
314*9880d681SAndroid Build Coastguard Worker                     [FeatureX87, FeatureSlowUAMem16, FeatureMMX, FeatureSSE3,
315*9880d681SAndroid Build Coastguard Worker                      FeatureFXSR, FeatureSlowBTMem]>;
316*9880d681SAndroid Build Coastguard Workerdef : ProcessorModel<"nocona", GenericPostRAModel, [
317*9880d681SAndroid Build Coastguard Worker  FeatureX87,
318*9880d681SAndroid Build Coastguard Worker  FeatureSlowUAMem16,
319*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
320*9880d681SAndroid Build Coastguard Worker  FeatureSSE3,
321*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
322*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
323*9880d681SAndroid Build Coastguard Worker  FeatureSlowBTMem
324*9880d681SAndroid Build Coastguard Worker]>;
325*9880d681SAndroid Build Coastguard Worker
326*9880d681SAndroid Build Coastguard Worker// Intel Core 2 Solo/Duo.
327*9880d681SAndroid Build Coastguard Workerdef : ProcessorModel<"core2", SandyBridgeModel, [
328*9880d681SAndroid Build Coastguard Worker  FeatureX87,
329*9880d681SAndroid Build Coastguard Worker  FeatureSlowUAMem16,
330*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
331*9880d681SAndroid Build Coastguard Worker  FeatureSSSE3,
332*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
333*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
334*9880d681SAndroid Build Coastguard Worker  FeatureSlowBTMem,
335*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF
336*9880d681SAndroid Build Coastguard Worker]>;
337*9880d681SAndroid Build Coastguard Workerdef : ProcessorModel<"penryn", SandyBridgeModel, [
338*9880d681SAndroid Build Coastguard Worker  FeatureX87,
339*9880d681SAndroid Build Coastguard Worker  FeatureSlowUAMem16,
340*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
341*9880d681SAndroid Build Coastguard Worker  FeatureSSE41,
342*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
343*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
344*9880d681SAndroid Build Coastguard Worker  FeatureSlowBTMem,
345*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF
346*9880d681SAndroid Build Coastguard Worker]>;
347*9880d681SAndroid Build Coastguard Worker
348*9880d681SAndroid Build Coastguard Worker// Atom CPUs.
349*9880d681SAndroid Build Coastguard Workerclass BonnellProc<string Name> : ProcessorModel<Name, AtomModel, [
350*9880d681SAndroid Build Coastguard Worker  ProcIntelAtom,
351*9880d681SAndroid Build Coastguard Worker  FeatureX87,
352*9880d681SAndroid Build Coastguard Worker  FeatureSlowUAMem16,
353*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
354*9880d681SAndroid Build Coastguard Worker  FeatureSSSE3,
355*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
356*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
357*9880d681SAndroid Build Coastguard Worker  FeatureMOVBE,
358*9880d681SAndroid Build Coastguard Worker  FeatureSlowBTMem,
359*9880d681SAndroid Build Coastguard Worker  FeatureLEAForSP,
360*9880d681SAndroid Build Coastguard Worker  FeatureSlowDivide32,
361*9880d681SAndroid Build Coastguard Worker  FeatureSlowDivide64,
362*9880d681SAndroid Build Coastguard Worker  FeatureCallRegIndirect,
363*9880d681SAndroid Build Coastguard Worker  FeatureLEAUsesAG,
364*9880d681SAndroid Build Coastguard Worker  FeaturePadShortFunctions,
365*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF
366*9880d681SAndroid Build Coastguard Worker]>;
367*9880d681SAndroid Build Coastguard Workerdef : BonnellProc<"bonnell">;
368*9880d681SAndroid Build Coastguard Workerdef : BonnellProc<"atom">; // Pin the generic name to the baseline.
369*9880d681SAndroid Build Coastguard Worker
370*9880d681SAndroid Build Coastguard Workerclass SilvermontProc<string Name> : ProcessorModel<Name, SLMModel, [
371*9880d681SAndroid Build Coastguard Worker  ProcIntelSLM,
372*9880d681SAndroid Build Coastguard Worker  FeatureX87,
373*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
374*9880d681SAndroid Build Coastguard Worker  FeatureSSE42,
375*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
376*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
377*9880d681SAndroid Build Coastguard Worker  FeatureMOVBE,
378*9880d681SAndroid Build Coastguard Worker  FeaturePOPCNT,
379*9880d681SAndroid Build Coastguard Worker  FeaturePCLMUL,
380*9880d681SAndroid Build Coastguard Worker  FeatureAES,
381*9880d681SAndroid Build Coastguard Worker  FeatureSlowDivide64,
382*9880d681SAndroid Build Coastguard Worker  FeatureCallRegIndirect,
383*9880d681SAndroid Build Coastguard Worker  FeaturePRFCHW,
384*9880d681SAndroid Build Coastguard Worker  FeatureSlowLEA,
385*9880d681SAndroid Build Coastguard Worker  FeatureSlowIncDec,
386*9880d681SAndroid Build Coastguard Worker  FeatureSlowBTMem,
387*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF
388*9880d681SAndroid Build Coastguard Worker]>;
389*9880d681SAndroid Build Coastguard Workerdef : SilvermontProc<"silvermont">;
390*9880d681SAndroid Build Coastguard Workerdef : SilvermontProc<"slm">; // Legacy alias.
391*9880d681SAndroid Build Coastguard Worker
392*9880d681SAndroid Build Coastguard Worker// "Arrandale" along with corei3 and corei5
393*9880d681SAndroid Build Coastguard Workerclass NehalemProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [
394*9880d681SAndroid Build Coastguard Worker  FeatureX87,
395*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
396*9880d681SAndroid Build Coastguard Worker  FeatureSSE42,
397*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
398*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
399*9880d681SAndroid Build Coastguard Worker  FeatureSlowBTMem,
400*9880d681SAndroid Build Coastguard Worker  FeaturePOPCNT,
401*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF
402*9880d681SAndroid Build Coastguard Worker]>;
403*9880d681SAndroid Build Coastguard Workerdef : NehalemProc<"nehalem">;
404*9880d681SAndroid Build Coastguard Workerdef : NehalemProc<"corei7">;
405*9880d681SAndroid Build Coastguard Worker
406*9880d681SAndroid Build Coastguard Worker// Westmere is a similar machine to nehalem with some additional features.
407*9880d681SAndroid Build Coastguard Worker// Westmere is the corei3/i5/i7 path from nehalem to sandybridge
408*9880d681SAndroid Build Coastguard Workerclass WestmereProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [
409*9880d681SAndroid Build Coastguard Worker  FeatureX87,
410*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
411*9880d681SAndroid Build Coastguard Worker  FeatureSSE42,
412*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
413*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
414*9880d681SAndroid Build Coastguard Worker  FeatureSlowBTMem,
415*9880d681SAndroid Build Coastguard Worker  FeaturePOPCNT,
416*9880d681SAndroid Build Coastguard Worker  FeatureAES,
417*9880d681SAndroid Build Coastguard Worker  FeaturePCLMUL,
418*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF
419*9880d681SAndroid Build Coastguard Worker]>;
420*9880d681SAndroid Build Coastguard Workerdef : WestmereProc<"westmere">;
421*9880d681SAndroid Build Coastguard Worker
422*9880d681SAndroid Build Coastguard Workerclass ProcessorFeatures<list<SubtargetFeature> Inherited,
423*9880d681SAndroid Build Coastguard Worker                        list<SubtargetFeature> NewFeatures> {
424*9880d681SAndroid Build Coastguard Worker  list<SubtargetFeature> Value = !listconcat(Inherited, NewFeatures);
425*9880d681SAndroid Build Coastguard Worker}
426*9880d681SAndroid Build Coastguard Worker
427*9880d681SAndroid Build Coastguard Workerclass ProcModel<string Name, SchedMachineModel Model,
428*9880d681SAndroid Build Coastguard Worker                list<SubtargetFeature> ProcFeatures,
429*9880d681SAndroid Build Coastguard Worker                list<SubtargetFeature> OtherFeatures> :
430*9880d681SAndroid Build Coastguard Worker  ProcessorModel<Name, Model, !listconcat(ProcFeatures, OtherFeatures)>;
431*9880d681SAndroid Build Coastguard Worker
432*9880d681SAndroid Build Coastguard Worker// SSE is not listed here since llvm treats AVX as a reimplementation of SSE,
433*9880d681SAndroid Build Coastguard Worker// rather than a superset.
434*9880d681SAndroid Build Coastguard Workerdef SNBFeatures : ProcessorFeatures<[], [
435*9880d681SAndroid Build Coastguard Worker  FeatureX87,
436*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
437*9880d681SAndroid Build Coastguard Worker  FeatureAVX,
438*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
439*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
440*9880d681SAndroid Build Coastguard Worker  FeaturePOPCNT,
441*9880d681SAndroid Build Coastguard Worker  FeatureAES,
442*9880d681SAndroid Build Coastguard Worker  FeaturePCLMUL,
443*9880d681SAndroid Build Coastguard Worker  FeatureXSAVE,
444*9880d681SAndroid Build Coastguard Worker  FeatureXSAVEOPT,
445*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF
446*9880d681SAndroid Build Coastguard Worker]>;
447*9880d681SAndroid Build Coastguard Worker
448*9880d681SAndroid Build Coastguard Workerclass SandyBridgeProc<string Name> : ProcModel<Name, SandyBridgeModel,
449*9880d681SAndroid Build Coastguard Worker                                               SNBFeatures.Value, [
450*9880d681SAndroid Build Coastguard Worker  FeatureSlowBTMem,
451*9880d681SAndroid Build Coastguard Worker  FeatureSlowUAMem32
452*9880d681SAndroid Build Coastguard Worker]>;
453*9880d681SAndroid Build Coastguard Workerdef : SandyBridgeProc<"sandybridge">;
454*9880d681SAndroid Build Coastguard Workerdef : SandyBridgeProc<"corei7-avx">; // Legacy alias.
455*9880d681SAndroid Build Coastguard Worker
456*9880d681SAndroid Build Coastguard Workerdef IVBFeatures : ProcessorFeatures<SNBFeatures.Value, [
457*9880d681SAndroid Build Coastguard Worker  FeatureRDRAND,
458*9880d681SAndroid Build Coastguard Worker  FeatureF16C,
459*9880d681SAndroid Build Coastguard Worker  FeatureFSGSBase
460*9880d681SAndroid Build Coastguard Worker]>;
461*9880d681SAndroid Build Coastguard Worker
462*9880d681SAndroid Build Coastguard Workerclass IvyBridgeProc<string Name> : ProcModel<Name, SandyBridgeModel,
463*9880d681SAndroid Build Coastguard Worker                                             IVBFeatures.Value, [
464*9880d681SAndroid Build Coastguard Worker  FeatureSlowBTMem,
465*9880d681SAndroid Build Coastguard Worker  FeatureSlowUAMem32
466*9880d681SAndroid Build Coastguard Worker]>;
467*9880d681SAndroid Build Coastguard Workerdef : IvyBridgeProc<"ivybridge">;
468*9880d681SAndroid Build Coastguard Workerdef : IvyBridgeProc<"core-avx-i">; // Legacy alias.
469*9880d681SAndroid Build Coastguard Worker
470*9880d681SAndroid Build Coastguard Workerdef HSWFeatures : ProcessorFeatures<IVBFeatures.Value, [
471*9880d681SAndroid Build Coastguard Worker  FeatureAVX2,
472*9880d681SAndroid Build Coastguard Worker  FeatureBMI,
473*9880d681SAndroid Build Coastguard Worker  FeatureBMI2,
474*9880d681SAndroid Build Coastguard Worker  FeatureFMA,
475*9880d681SAndroid Build Coastguard Worker  FeatureLZCNT,
476*9880d681SAndroid Build Coastguard Worker  FeatureMOVBE,
477*9880d681SAndroid Build Coastguard Worker  FeatureINVPCID,
478*9880d681SAndroid Build Coastguard Worker  FeatureVMFUNC,
479*9880d681SAndroid Build Coastguard Worker  FeatureRTM,
480*9880d681SAndroid Build Coastguard Worker  FeatureHLE,
481*9880d681SAndroid Build Coastguard Worker  FeatureSlowIncDec
482*9880d681SAndroid Build Coastguard Worker]>;
483*9880d681SAndroid Build Coastguard Worker
484*9880d681SAndroid Build Coastguard Workerclass HaswellProc<string Name> : ProcModel<Name, HaswellModel,
485*9880d681SAndroid Build Coastguard Worker                                           HSWFeatures.Value, []>;
486*9880d681SAndroid Build Coastguard Workerdef : HaswellProc<"haswell">;
487*9880d681SAndroid Build Coastguard Workerdef : HaswellProc<"core-avx2">; // Legacy alias.
488*9880d681SAndroid Build Coastguard Worker
489*9880d681SAndroid Build Coastguard Workerdef BDWFeatures : ProcessorFeatures<HSWFeatures.Value, [
490*9880d681SAndroid Build Coastguard Worker  FeatureADX,
491*9880d681SAndroid Build Coastguard Worker  FeatureRDSEED,
492*9880d681SAndroid Build Coastguard Worker  FeatureSMAP
493*9880d681SAndroid Build Coastguard Worker]>;
494*9880d681SAndroid Build Coastguard Workerclass BroadwellProc<string Name> : ProcModel<Name, HaswellModel,
495*9880d681SAndroid Build Coastguard Worker                                             BDWFeatures.Value, []>;
496*9880d681SAndroid Build Coastguard Workerdef : BroadwellProc<"broadwell">;
497*9880d681SAndroid Build Coastguard Worker
498*9880d681SAndroid Build Coastguard Workerdef SKLFeatures : ProcessorFeatures<BDWFeatures.Value, [
499*9880d681SAndroid Build Coastguard Worker  FeatureMPX,
500*9880d681SAndroid Build Coastguard Worker  FeatureXSAVEC,
501*9880d681SAndroid Build Coastguard Worker  FeatureXSAVES,
502*9880d681SAndroid Build Coastguard Worker  FeatureSGX,
503*9880d681SAndroid Build Coastguard Worker  FeatureCLFLUSHOPT
504*9880d681SAndroid Build Coastguard Worker]>;
505*9880d681SAndroid Build Coastguard Worker
506*9880d681SAndroid Build Coastguard Worker// FIXME: define SKL model
507*9880d681SAndroid Build Coastguard Workerclass SkylakeClientProc<string Name> : ProcModel<Name, HaswellModel,
508*9880d681SAndroid Build Coastguard Worker                                                 SKLFeatures.Value, []>;
509*9880d681SAndroid Build Coastguard Workerdef : SkylakeClientProc<"skylake">;
510*9880d681SAndroid Build Coastguard Worker
511*9880d681SAndroid Build Coastguard Worker// FIXME: define KNL model
512*9880d681SAndroid Build Coastguard Workerclass KnightsLandingProc<string Name> : ProcModel<Name, HaswellModel,
513*9880d681SAndroid Build Coastguard Worker                                                  IVBFeatures.Value, [
514*9880d681SAndroid Build Coastguard Worker  FeatureAVX512,
515*9880d681SAndroid Build Coastguard Worker  FeatureERI,
516*9880d681SAndroid Build Coastguard Worker  FeatureCDI,
517*9880d681SAndroid Build Coastguard Worker  FeaturePFI,
518*9880d681SAndroid Build Coastguard Worker  FeaturePREFETCHWT1,
519*9880d681SAndroid Build Coastguard Worker  FeatureADX,
520*9880d681SAndroid Build Coastguard Worker  FeatureRDSEED,
521*9880d681SAndroid Build Coastguard Worker  FeatureMOVBE,
522*9880d681SAndroid Build Coastguard Worker  FeatureLZCNT,
523*9880d681SAndroid Build Coastguard Worker  FeatureBMI,
524*9880d681SAndroid Build Coastguard Worker  FeatureBMI2,
525*9880d681SAndroid Build Coastguard Worker  FeatureFMA
526*9880d681SAndroid Build Coastguard Worker]>;
527*9880d681SAndroid Build Coastguard Workerdef : KnightsLandingProc<"knl">;
528*9880d681SAndroid Build Coastguard Worker
529*9880d681SAndroid Build Coastguard Workerdef SKXFeatures : ProcessorFeatures<SKLFeatures.Value, [
530*9880d681SAndroid Build Coastguard Worker  FeatureAVX512,
531*9880d681SAndroid Build Coastguard Worker  FeatureCDI,
532*9880d681SAndroid Build Coastguard Worker  FeatureDQI,
533*9880d681SAndroid Build Coastguard Worker  FeatureBWI,
534*9880d681SAndroid Build Coastguard Worker  FeatureVLX,
535*9880d681SAndroid Build Coastguard Worker  FeaturePKU,
536*9880d681SAndroid Build Coastguard Worker  FeaturePCOMMIT,
537*9880d681SAndroid Build Coastguard Worker  FeatureCLWB
538*9880d681SAndroid Build Coastguard Worker]>;
539*9880d681SAndroid Build Coastguard Worker
540*9880d681SAndroid Build Coastguard Worker// FIXME: define SKX model
541*9880d681SAndroid Build Coastguard Workerclass SkylakeServerProc<string Name> : ProcModel<Name, HaswellModel,
542*9880d681SAndroid Build Coastguard Worker                                                 SKXFeatures.Value, []>;
543*9880d681SAndroid Build Coastguard Workerdef : SkylakeServerProc<"skylake-avx512">;
544*9880d681SAndroid Build Coastguard Workerdef : SkylakeServerProc<"skx">; // Legacy alias.
545*9880d681SAndroid Build Coastguard Worker
546*9880d681SAndroid Build Coastguard Workerdef CNLFeatures : ProcessorFeatures<SKXFeatures.Value, [
547*9880d681SAndroid Build Coastguard Worker  FeatureVBMI,
548*9880d681SAndroid Build Coastguard Worker  FeatureIFMA,
549*9880d681SAndroid Build Coastguard Worker  FeatureSHA
550*9880d681SAndroid Build Coastguard Worker]>;
551*9880d681SAndroid Build Coastguard Worker
552*9880d681SAndroid Build Coastguard Workerclass CannonlakeProc<string Name> : ProcModel<Name, HaswellModel,
553*9880d681SAndroid Build Coastguard Worker                                              CNLFeatures.Value, []>;
554*9880d681SAndroid Build Coastguard Workerdef : CannonlakeProc<"cannonlake">;
555*9880d681SAndroid Build Coastguard Worker
556*9880d681SAndroid Build Coastguard Worker// AMD CPUs.
557*9880d681SAndroid Build Coastguard Worker
558*9880d681SAndroid Build Coastguard Workerdef : Proc<"k6",              [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>;
559*9880d681SAndroid Build Coastguard Workerdef : Proc<"k6-2",            [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
560*9880d681SAndroid Build Coastguard Workerdef : Proc<"k6-3",            [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
561*9880d681SAndroid Build Coastguard Workerdef : Proc<"athlon",          [FeatureX87, FeatureSlowUAMem16, Feature3DNowA,
562*9880d681SAndroid Build Coastguard Worker                               FeatureSlowBTMem, FeatureSlowSHLD]>;
563*9880d681SAndroid Build Coastguard Workerdef : Proc<"athlon-tbird",    [FeatureX87, FeatureSlowUAMem16, Feature3DNowA,
564*9880d681SAndroid Build Coastguard Worker                               FeatureSlowBTMem, FeatureSlowSHLD]>;
565*9880d681SAndroid Build Coastguard Workerdef : Proc<"athlon-4",        [FeatureX87, FeatureSlowUAMem16, FeatureSSE1,
566*9880d681SAndroid Build Coastguard Worker                               Feature3DNowA, FeatureFXSR, FeatureSlowBTMem,
567*9880d681SAndroid Build Coastguard Worker                               FeatureSlowSHLD]>;
568*9880d681SAndroid Build Coastguard Workerdef : Proc<"athlon-xp",       [FeatureX87, FeatureSlowUAMem16, FeatureSSE1,
569*9880d681SAndroid Build Coastguard Worker                               Feature3DNowA, FeatureFXSR, FeatureSlowBTMem,
570*9880d681SAndroid Build Coastguard Worker                               FeatureSlowSHLD]>;
571*9880d681SAndroid Build Coastguard Workerdef : Proc<"athlon-mp",       [FeatureX87, FeatureSlowUAMem16, FeatureSSE1,
572*9880d681SAndroid Build Coastguard Worker                               Feature3DNowA, FeatureFXSR, FeatureSlowBTMem,
573*9880d681SAndroid Build Coastguard Worker                               FeatureSlowSHLD]>;
574*9880d681SAndroid Build Coastguard Workerdef : Proc<"k8",              [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
575*9880d681SAndroid Build Coastguard Worker                               Feature3DNowA, FeatureFXSR, Feature64Bit,
576*9880d681SAndroid Build Coastguard Worker                               FeatureSlowBTMem, FeatureSlowSHLD]>;
577*9880d681SAndroid Build Coastguard Workerdef : Proc<"opteron",         [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
578*9880d681SAndroid Build Coastguard Worker                               Feature3DNowA, FeatureFXSR, Feature64Bit,
579*9880d681SAndroid Build Coastguard Worker                               FeatureSlowBTMem, FeatureSlowSHLD]>;
580*9880d681SAndroid Build Coastguard Workerdef : Proc<"athlon64",        [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
581*9880d681SAndroid Build Coastguard Worker                               Feature3DNowA, FeatureFXSR, Feature64Bit,
582*9880d681SAndroid Build Coastguard Worker                               FeatureSlowBTMem, FeatureSlowSHLD]>;
583*9880d681SAndroid Build Coastguard Workerdef : Proc<"athlon-fx",       [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
584*9880d681SAndroid Build Coastguard Worker                               Feature3DNowA, FeatureFXSR, Feature64Bit,
585*9880d681SAndroid Build Coastguard Worker                               FeatureSlowBTMem, FeatureSlowSHLD]>;
586*9880d681SAndroid Build Coastguard Workerdef : Proc<"k8-sse3",         [FeatureX87, FeatureSlowUAMem16, FeatureSSE3,
587*9880d681SAndroid Build Coastguard Worker                               Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B,
588*9880d681SAndroid Build Coastguard Worker                               FeatureSlowBTMem, FeatureSlowSHLD]>;
589*9880d681SAndroid Build Coastguard Workerdef : Proc<"opteron-sse3",    [FeatureX87, FeatureSlowUAMem16, FeatureSSE3,
590*9880d681SAndroid Build Coastguard Worker                               Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B,
591*9880d681SAndroid Build Coastguard Worker                               FeatureSlowBTMem, FeatureSlowSHLD]>;
592*9880d681SAndroid Build Coastguard Workerdef : Proc<"athlon64-sse3",   [FeatureX87, FeatureSlowUAMem16, FeatureSSE3,
593*9880d681SAndroid Build Coastguard Worker                               Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B,
594*9880d681SAndroid Build Coastguard Worker                               FeatureSlowBTMem, FeatureSlowSHLD]>;
595*9880d681SAndroid Build Coastguard Workerdef : Proc<"amdfam10",        [FeatureX87, FeatureSSE4A, Feature3DNowA,
596*9880d681SAndroid Build Coastguard Worker                               FeatureFXSR, FeatureCMPXCHG16B, FeatureLZCNT,
597*9880d681SAndroid Build Coastguard Worker                               FeaturePOPCNT, FeatureSlowBTMem, FeatureSlowSHLD,
598*9880d681SAndroid Build Coastguard Worker                               FeatureLAHFSAHF]>;
599*9880d681SAndroid Build Coastguard Workerdef : Proc<"barcelona",       [FeatureX87, FeatureSSE4A, Feature3DNowA,
600*9880d681SAndroid Build Coastguard Worker                               FeatureFXSR, FeatureCMPXCHG16B, FeatureLZCNT,
601*9880d681SAndroid Build Coastguard Worker                               FeaturePOPCNT, FeatureSlowBTMem, FeatureSlowSHLD,
602*9880d681SAndroid Build Coastguard Worker                               FeatureLAHFSAHF]>;
603*9880d681SAndroid Build Coastguard Worker
604*9880d681SAndroid Build Coastguard Worker// Bobcat
605*9880d681SAndroid Build Coastguard Workerdef : Proc<"btver1", [
606*9880d681SAndroid Build Coastguard Worker  FeatureX87,
607*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
608*9880d681SAndroid Build Coastguard Worker  FeatureSSSE3,
609*9880d681SAndroid Build Coastguard Worker  FeatureSSE4A,
610*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
611*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
612*9880d681SAndroid Build Coastguard Worker  FeaturePRFCHW,
613*9880d681SAndroid Build Coastguard Worker  FeatureLZCNT,
614*9880d681SAndroid Build Coastguard Worker  FeaturePOPCNT,
615*9880d681SAndroid Build Coastguard Worker  FeatureSlowSHLD,
616*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF
617*9880d681SAndroid Build Coastguard Worker]>;
618*9880d681SAndroid Build Coastguard Worker
619*9880d681SAndroid Build Coastguard Worker// Jaguar
620*9880d681SAndroid Build Coastguard Workerdef : ProcessorModel<"btver2", BtVer2Model, [
621*9880d681SAndroid Build Coastguard Worker  FeatureX87,
622*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
623*9880d681SAndroid Build Coastguard Worker  FeatureAVX,
624*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
625*9880d681SAndroid Build Coastguard Worker  FeatureSSE4A,
626*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
627*9880d681SAndroid Build Coastguard Worker  FeaturePRFCHW,
628*9880d681SAndroid Build Coastguard Worker  FeatureAES,
629*9880d681SAndroid Build Coastguard Worker  FeaturePCLMUL,
630*9880d681SAndroid Build Coastguard Worker  FeatureBMI,
631*9880d681SAndroid Build Coastguard Worker  FeatureF16C,
632*9880d681SAndroid Build Coastguard Worker  FeatureMOVBE,
633*9880d681SAndroid Build Coastguard Worker  FeatureLZCNT,
634*9880d681SAndroid Build Coastguard Worker  FeaturePOPCNT,
635*9880d681SAndroid Build Coastguard Worker  FeatureXSAVE,
636*9880d681SAndroid Build Coastguard Worker  FeatureXSAVEOPT,
637*9880d681SAndroid Build Coastguard Worker  FeatureSlowSHLD,
638*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF,
639*9880d681SAndroid Build Coastguard Worker  FeatureFastPartialYMMWrite
640*9880d681SAndroid Build Coastguard Worker]>;
641*9880d681SAndroid Build Coastguard Worker
642*9880d681SAndroid Build Coastguard Worker// Bulldozer
643*9880d681SAndroid Build Coastguard Workerdef : Proc<"bdver1", [
644*9880d681SAndroid Build Coastguard Worker  FeatureX87,
645*9880d681SAndroid Build Coastguard Worker  FeatureXOP,
646*9880d681SAndroid Build Coastguard Worker  FeatureFMA4,
647*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
648*9880d681SAndroid Build Coastguard Worker  FeatureAES,
649*9880d681SAndroid Build Coastguard Worker  FeaturePRFCHW,
650*9880d681SAndroid Build Coastguard Worker  FeaturePCLMUL,
651*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
652*9880d681SAndroid Build Coastguard Worker  FeatureAVX,
653*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
654*9880d681SAndroid Build Coastguard Worker  FeatureSSE4A,
655*9880d681SAndroid Build Coastguard Worker  FeatureLZCNT,
656*9880d681SAndroid Build Coastguard Worker  FeaturePOPCNT,
657*9880d681SAndroid Build Coastguard Worker  FeatureXSAVE,
658*9880d681SAndroid Build Coastguard Worker  FeatureSlowSHLD,
659*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF
660*9880d681SAndroid Build Coastguard Worker]>;
661*9880d681SAndroid Build Coastguard Worker// Piledriver
662*9880d681SAndroid Build Coastguard Workerdef : Proc<"bdver2", [
663*9880d681SAndroid Build Coastguard Worker  FeatureX87,
664*9880d681SAndroid Build Coastguard Worker  FeatureXOP,
665*9880d681SAndroid Build Coastguard Worker  FeatureFMA4,
666*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
667*9880d681SAndroid Build Coastguard Worker  FeatureAES,
668*9880d681SAndroid Build Coastguard Worker  FeaturePRFCHW,
669*9880d681SAndroid Build Coastguard Worker  FeaturePCLMUL,
670*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
671*9880d681SAndroid Build Coastguard Worker  FeatureAVX,
672*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
673*9880d681SAndroid Build Coastguard Worker  FeatureSSE4A,
674*9880d681SAndroid Build Coastguard Worker  FeatureF16C,
675*9880d681SAndroid Build Coastguard Worker  FeatureLZCNT,
676*9880d681SAndroid Build Coastguard Worker  FeaturePOPCNT,
677*9880d681SAndroid Build Coastguard Worker  FeatureXSAVE,
678*9880d681SAndroid Build Coastguard Worker  FeatureBMI,
679*9880d681SAndroid Build Coastguard Worker  FeatureTBM,
680*9880d681SAndroid Build Coastguard Worker  FeatureFMA,
681*9880d681SAndroid Build Coastguard Worker  FeatureSlowSHLD,
682*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF
683*9880d681SAndroid Build Coastguard Worker]>;
684*9880d681SAndroid Build Coastguard Worker
685*9880d681SAndroid Build Coastguard Worker// Steamroller
686*9880d681SAndroid Build Coastguard Workerdef : Proc<"bdver3", [
687*9880d681SAndroid Build Coastguard Worker  FeatureX87,
688*9880d681SAndroid Build Coastguard Worker  FeatureXOP,
689*9880d681SAndroid Build Coastguard Worker  FeatureFMA4,
690*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
691*9880d681SAndroid Build Coastguard Worker  FeatureAES,
692*9880d681SAndroid Build Coastguard Worker  FeaturePRFCHW,
693*9880d681SAndroid Build Coastguard Worker  FeaturePCLMUL,
694*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
695*9880d681SAndroid Build Coastguard Worker  FeatureAVX,
696*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
697*9880d681SAndroid Build Coastguard Worker  FeatureSSE4A,
698*9880d681SAndroid Build Coastguard Worker  FeatureF16C,
699*9880d681SAndroid Build Coastguard Worker  FeatureLZCNT,
700*9880d681SAndroid Build Coastguard Worker  FeaturePOPCNT,
701*9880d681SAndroid Build Coastguard Worker  FeatureXSAVE,
702*9880d681SAndroid Build Coastguard Worker  FeatureBMI,
703*9880d681SAndroid Build Coastguard Worker  FeatureTBM,
704*9880d681SAndroid Build Coastguard Worker  FeatureFMA,
705*9880d681SAndroid Build Coastguard Worker  FeatureXSAVEOPT,
706*9880d681SAndroid Build Coastguard Worker  FeatureSlowSHLD,
707*9880d681SAndroid Build Coastguard Worker  FeatureFSGSBase,
708*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF
709*9880d681SAndroid Build Coastguard Worker]>;
710*9880d681SAndroid Build Coastguard Worker
711*9880d681SAndroid Build Coastguard Worker// Excavator
712*9880d681SAndroid Build Coastguard Workerdef : Proc<"bdver4", [
713*9880d681SAndroid Build Coastguard Worker  FeatureX87,
714*9880d681SAndroid Build Coastguard Worker  FeatureMMX,
715*9880d681SAndroid Build Coastguard Worker  FeatureAVX2,
716*9880d681SAndroid Build Coastguard Worker  FeatureFXSR,
717*9880d681SAndroid Build Coastguard Worker  FeatureXOP,
718*9880d681SAndroid Build Coastguard Worker  FeatureFMA4,
719*9880d681SAndroid Build Coastguard Worker  FeatureCMPXCHG16B,
720*9880d681SAndroid Build Coastguard Worker  FeatureAES,
721*9880d681SAndroid Build Coastguard Worker  FeaturePRFCHW,
722*9880d681SAndroid Build Coastguard Worker  FeaturePCLMUL,
723*9880d681SAndroid Build Coastguard Worker  FeatureF16C,
724*9880d681SAndroid Build Coastguard Worker  FeatureLZCNT,
725*9880d681SAndroid Build Coastguard Worker  FeaturePOPCNT,
726*9880d681SAndroid Build Coastguard Worker  FeatureXSAVE,
727*9880d681SAndroid Build Coastguard Worker  FeatureBMI,
728*9880d681SAndroid Build Coastguard Worker  FeatureBMI2,
729*9880d681SAndroid Build Coastguard Worker  FeatureTBM,
730*9880d681SAndroid Build Coastguard Worker  FeatureFMA,
731*9880d681SAndroid Build Coastguard Worker  FeatureXSAVEOPT,
732*9880d681SAndroid Build Coastguard Worker  FeatureFSGSBase,
733*9880d681SAndroid Build Coastguard Worker  FeatureLAHFSAHF,
734*9880d681SAndroid Build Coastguard Worker  FeatureMWAITX
735*9880d681SAndroid Build Coastguard Worker]>;
736*9880d681SAndroid Build Coastguard Worker
737*9880d681SAndroid Build Coastguard Workerdef : Proc<"geode",           [FeatureX87, FeatureSlowUAMem16, Feature3DNowA]>;
738*9880d681SAndroid Build Coastguard Worker
739*9880d681SAndroid Build Coastguard Workerdef : Proc<"winchip-c6",      [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>;
740*9880d681SAndroid Build Coastguard Workerdef : Proc<"winchip2",        [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
741*9880d681SAndroid Build Coastguard Workerdef : Proc<"c3",              [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
742*9880d681SAndroid Build Coastguard Workerdef : Proc<"c3-2",            [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
743*9880d681SAndroid Build Coastguard Worker                               FeatureSSE1, FeatureFXSR]>;
744*9880d681SAndroid Build Coastguard Worker
745*9880d681SAndroid Build Coastguard Worker// We also provide a generic 64-bit specific x86 processor model which tries to
746*9880d681SAndroid Build Coastguard Worker// be good for modern chips without enabling instruction set encodings past the
747*9880d681SAndroid Build Coastguard Worker// basic SSE2 and 64-bit ones. It disables slow things from any mainstream and
748*9880d681SAndroid Build Coastguard Worker// modern 64-bit x86 chip, and enables features that are generally beneficial.
749*9880d681SAndroid Build Coastguard Worker//
750*9880d681SAndroid Build Coastguard Worker// We currently use the Sandy Bridge model as the default scheduling model as
751*9880d681SAndroid Build Coastguard Worker// we use it across Nehalem, Westmere, Sandy Bridge, and Ivy Bridge which
752*9880d681SAndroid Build Coastguard Worker// covers a huge swath of x86 processors. If there are specific scheduling
753*9880d681SAndroid Build Coastguard Worker// knobs which need to be tuned differently for AMD chips, we might consider
754*9880d681SAndroid Build Coastguard Worker// forming a common base for them.
755*9880d681SAndroid Build Coastguard Workerdef : ProcessorModel<"x86-64", SandyBridgeModel,
756*9880d681SAndroid Build Coastguard Worker                     [FeatureX87, FeatureMMX, FeatureSSE2, FeatureFXSR,
757*9880d681SAndroid Build Coastguard Worker                      Feature64Bit, FeatureSlowBTMem ]>;
758*9880d681SAndroid Build Coastguard Worker
759*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
760*9880d681SAndroid Build Coastguard Worker// Register File Description
761*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
762*9880d681SAndroid Build Coastguard Worker
763*9880d681SAndroid Build Coastguard Workerinclude "X86RegisterInfo.td"
764*9880d681SAndroid Build Coastguard Worker
765*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
766*9880d681SAndroid Build Coastguard Worker// Instruction Descriptions
767*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
768*9880d681SAndroid Build Coastguard Worker
769*9880d681SAndroid Build Coastguard Workerinclude "X86InstrInfo.td"
770*9880d681SAndroid Build Coastguard Worker
771*9880d681SAndroid Build Coastguard Workerdef X86InstrInfo : InstrInfo;
772*9880d681SAndroid Build Coastguard Worker
773*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
774*9880d681SAndroid Build Coastguard Worker// Calling Conventions
775*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
776*9880d681SAndroid Build Coastguard Worker
777*9880d681SAndroid Build Coastguard Workerinclude "X86CallingConv.td"
778*9880d681SAndroid Build Coastguard Worker
779*9880d681SAndroid Build Coastguard Worker
780*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
781*9880d681SAndroid Build Coastguard Worker// Assembly Parser
782*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
783*9880d681SAndroid Build Coastguard Worker
784*9880d681SAndroid Build Coastguard Workerdef ATTAsmParserVariant : AsmParserVariant {
785*9880d681SAndroid Build Coastguard Worker  int Variant = 0;
786*9880d681SAndroid Build Coastguard Worker
787*9880d681SAndroid Build Coastguard Worker  // Variant name.
788*9880d681SAndroid Build Coastguard Worker  string Name = "att";
789*9880d681SAndroid Build Coastguard Worker
790*9880d681SAndroid Build Coastguard Worker  // Discard comments in assembly strings.
791*9880d681SAndroid Build Coastguard Worker  string CommentDelimiter = "#";
792*9880d681SAndroid Build Coastguard Worker
793*9880d681SAndroid Build Coastguard Worker  // Recognize hard coded registers.
794*9880d681SAndroid Build Coastguard Worker  string RegisterPrefix = "%";
795*9880d681SAndroid Build Coastguard Worker}
796*9880d681SAndroid Build Coastguard Worker
797*9880d681SAndroid Build Coastguard Workerdef IntelAsmParserVariant : AsmParserVariant {
798*9880d681SAndroid Build Coastguard Worker  int Variant = 1;
799*9880d681SAndroid Build Coastguard Worker
800*9880d681SAndroid Build Coastguard Worker  // Variant name.
801*9880d681SAndroid Build Coastguard Worker  string Name = "intel";
802*9880d681SAndroid Build Coastguard Worker
803*9880d681SAndroid Build Coastguard Worker  // Discard comments in assembly strings.
804*9880d681SAndroid Build Coastguard Worker  string CommentDelimiter = ";";
805*9880d681SAndroid Build Coastguard Worker
806*9880d681SAndroid Build Coastguard Worker  // Recognize hard coded registers.
807*9880d681SAndroid Build Coastguard Worker  string RegisterPrefix = "";
808*9880d681SAndroid Build Coastguard Worker}
809*9880d681SAndroid Build Coastguard Worker
810*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
811*9880d681SAndroid Build Coastguard Worker// Assembly Printers
812*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
813*9880d681SAndroid Build Coastguard Worker
814*9880d681SAndroid Build Coastguard Worker// The X86 target supports two different syntaxes for emitting machine code.
815*9880d681SAndroid Build Coastguard Worker// This is controlled by the -x86-asm-syntax={att|intel}
816*9880d681SAndroid Build Coastguard Workerdef ATTAsmWriter : AsmWriter {
817*9880d681SAndroid Build Coastguard Worker  string AsmWriterClassName  = "ATTInstPrinter";
818*9880d681SAndroid Build Coastguard Worker  int Variant = 0;
819*9880d681SAndroid Build Coastguard Worker}
820*9880d681SAndroid Build Coastguard Workerdef IntelAsmWriter : AsmWriter {
821*9880d681SAndroid Build Coastguard Worker  string AsmWriterClassName  = "IntelInstPrinter";
822*9880d681SAndroid Build Coastguard Worker  int Variant = 1;
823*9880d681SAndroid Build Coastguard Worker}
824*9880d681SAndroid Build Coastguard Worker
825*9880d681SAndroid Build Coastguard Workerdef X86 : Target {
826*9880d681SAndroid Build Coastguard Worker  // Information about the instructions...
827*9880d681SAndroid Build Coastguard Worker  let InstructionSet = X86InstrInfo;
828*9880d681SAndroid Build Coastguard Worker  let AssemblyParserVariants = [ATTAsmParserVariant, IntelAsmParserVariant];
829*9880d681SAndroid Build Coastguard Worker  let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter];
830*9880d681SAndroid Build Coastguard Worker}
831