1 //===-- X86.td - Target definition file for the Intel X86 --*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This is a target description file for the Intel i386 architecture, referred
11 // to here as the "X86" architecture.
13 //===----------------------------------------------------------------------===//
15 // Get the target-independent interfaces which we are implementing...
17 include "llvm/Target/Target.td"
19 //===----------------------------------------------------------------------===//
20 // X86 Subtarget state
23 def Mode64Bit : SubtargetFeature<"64bit-mode", "In64BitMode", "true",
24 "64-bit mode (x86_64)">;
25 def Mode32Bit : SubtargetFeature<"32bit-mode", "In32BitMode", "true",
26 "32-bit mode (80386)">;
27 def Mode16Bit : SubtargetFeature<"16bit-mode", "In16BitMode", "true",
28 "16-bit mode (i8086)">;
30 //===----------------------------------------------------------------------===//
31 // X86 Subtarget features
32 //===----------------------------------------------------------------------===//
34 def FeatureX87 : SubtargetFeature<"x87","HasX87", "true",
35 "Enable X87 float instructions">;
37 def FeatureCMOV : SubtargetFeature<"cmov","HasCMov", "true",
38 "Enable conditional move instructions">;
40 def FeaturePOPCNT : SubtargetFeature<"popcnt", "HasPOPCNT", "true",
41 "Support POPCNT instruction">;
43 def FeatureFXSR : SubtargetFeature<"fxsr", "HasFXSR", "true",
44 "Support fxsave/fxrestore instructions">;
46 def FeatureXSAVE : SubtargetFeature<"xsave", "HasXSAVE", "true",
47 "Support xsave instructions">;
49 def FeatureXSAVEOPT: SubtargetFeature<"xsaveopt", "HasXSAVEOPT", "true",
50 "Support xsaveopt instructions">;
52 def FeatureXSAVEC : SubtargetFeature<"xsavec", "HasXSAVEC", "true",
53 "Support xsavec instructions">;
55 def FeatureXSAVES : SubtargetFeature<"xsaves", "HasXSAVES", "true",
56 "Support xsaves instructions">;
58 def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1",
59 "Enable SSE instructions",
60 // SSE codegen depends on cmovs, and all
61 // SSE1+ processors support them.
63 def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", "SSE2",
64 "Enable SSE2 instructions",
66 def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3",
67 "Enable SSE3 instructions",
69 def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3",
70 "Enable SSSE3 instructions",
72 def FeatureSSE41 : SubtargetFeature<"sse4.1", "X86SSELevel", "SSE41",
73 "Enable SSE 4.1 instructions",
75 def FeatureSSE42 : SubtargetFeature<"sse4.2", "X86SSELevel", "SSE42",
76 "Enable SSE 4.2 instructions",
78 // The MMX subtarget feature is separate from the rest of the SSE features
79 // because it's important (for odd compatibility reasons) to be able to
80 // turn it off explicitly while allowing SSE+ to be on.
81 def FeatureMMX : SubtargetFeature<"mmx","X863DNowLevel", "MMX",
82 "Enable MMX instructions">;
83 def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow",
84 "Enable 3DNow! instructions",
86 def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA",
87 "Enable 3DNow! Athlon instructions",
89 // All x86-64 hardware has SSE2, but we don't mark SSE2 as an implied
90 // feature, because SSE2 can be disabled (e.g. for compiling OS kernels)
91 // without disabling 64-bit mode.
92 def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true",
93 "Support 64-bit instructions",
95 def FeatureCMPXCHG16B : SubtargetFeature<"cx16", "HasCmpxchg16b", "true",
96 "64-bit with cmpxchg16b",
98 def FeatureSlowBTMem : SubtargetFeature<"slow-bt-mem", "IsBTMemSlow", "true",
99 "Bit testing of memory is slow">;
100 def FeatureSlowSHLD : SubtargetFeature<"slow-shld", "IsSHLDSlow", "true",
101 "SHLD instruction is slow">;
102 def FeatureSlowPMULLD : SubtargetFeature<"slow-pmulld", "IsPMULLDSlow", "true",
103 "PMULLD instruction is slow">;
104 // FIXME: This should not apply to CPUs that do not have SSE.
105 def FeatureSlowUAMem16 : SubtargetFeature<"slow-unaligned-mem-16",
106 "IsUAMem16Slow", "true",
107 "Slow unaligned 16-byte memory access">;
108 def FeatureSlowUAMem32 : SubtargetFeature<"slow-unaligned-mem-32",
109 "IsUAMem32Slow", "true",
110 "Slow unaligned 32-byte memory access">;
111 def FeatureSSE4A : SubtargetFeature<"sse4a", "HasSSE4A", "true",
112 "Support SSE 4a instructions",
115 def FeatureAVX : SubtargetFeature<"avx", "X86SSELevel", "AVX",
116 "Enable AVX instructions",
118 def FeatureAVX2 : SubtargetFeature<"avx2", "X86SSELevel", "AVX2",
119 "Enable AVX2 instructions",
121 def FeatureAVX512 : SubtargetFeature<"avx512f", "X86SSELevel", "AVX512F",
122 "Enable AVX-512 instructions",
124 def FeatureERI : SubtargetFeature<"avx512er", "HasERI", "true",
125 "Enable AVX-512 Exponential and Reciprocal Instructions",
127 def FeatureCDI : SubtargetFeature<"avx512cd", "HasCDI", "true",
128 "Enable AVX-512 Conflict Detection Instructions",
130 def FeatureVPOPCNTDQ : SubtargetFeature<"avx512vpopcntdq", "HasVPOPCNTDQ",
131 "true", "Enable AVX-512 Population Count Instructions",
133 def FeaturePFI : SubtargetFeature<"avx512pf", "HasPFI", "true",
134 "Enable AVX-512 PreFetch Instructions",
136 def FeaturePREFETCHWT1 : SubtargetFeature<"prefetchwt1", "HasPFPREFETCHWT1",
138 "Prefetch with Intent to Write and T1 Hint">;
139 def FeatureDQI : SubtargetFeature<"avx512dq", "HasDQI", "true",
140 "Enable AVX-512 Doubleword and Quadword Instructions",
142 def FeatureBWI : SubtargetFeature<"avx512bw", "HasBWI", "true",
143 "Enable AVX-512 Byte and Word Instructions",
145 def FeatureVLX : SubtargetFeature<"avx512vl", "HasVLX", "true",
146 "Enable AVX-512 Vector Length eXtensions",
148 def FeatureVBMI : SubtargetFeature<"avx512vbmi", "HasVBMI", "true",
149 "Enable AVX-512 Vector Byte Manipulation Instructions",
151 def FeatureIFMA : SubtargetFeature<"avx512ifma", "HasIFMA", "true",
152 "Enable AVX-512 Integer Fused Multiple-Add",
154 def FeaturePKU : SubtargetFeature<"pku", "HasPKU", "true",
155 "Enable protection keys">;
156 def FeaturePCLMUL : SubtargetFeature<"pclmul", "HasPCLMUL", "true",
157 "Enable packed carry-less multiplication instructions",
159 def FeatureFMA : SubtargetFeature<"fma", "HasFMA", "true",
160 "Enable three-operand fused multiple-add",
162 def FeatureFMA4 : SubtargetFeature<"fma4", "HasFMA4", "true",
163 "Enable four-operand fused multiple-add",
164 [FeatureAVX, FeatureSSE4A]>;
165 def FeatureXOP : SubtargetFeature<"xop", "HasXOP", "true",
166 "Enable XOP instructions",
168 def FeatureSSEUnalignedMem : SubtargetFeature<"sse-unaligned-mem",
169 "HasSSEUnalignedMem", "true",
170 "Allow unaligned memory operands with SSE instructions">;
171 def FeatureAES : SubtargetFeature<"aes", "HasAES", "true",
172 "Enable AES instructions",
174 def FeatureTBM : SubtargetFeature<"tbm", "HasTBM", "true",
175 "Enable TBM instructions">;
176 def FeatureLWP : SubtargetFeature<"lwp", "HasLWP", "true",
177 "Enable LWP instructions">;
178 def FeatureMOVBE : SubtargetFeature<"movbe", "HasMOVBE", "true",
179 "Support MOVBE instruction">;
180 def FeatureRDRAND : SubtargetFeature<"rdrnd", "HasRDRAND", "true",
181 "Support RDRAND instruction">;
182 def FeatureF16C : SubtargetFeature<"f16c", "HasF16C", "true",
183 "Support 16-bit floating point conversion instructions",
185 def FeatureFSGSBase : SubtargetFeature<"fsgsbase", "HasFSGSBase", "true",
186 "Support FS/GS Base instructions">;
187 def FeatureLZCNT : SubtargetFeature<"lzcnt", "HasLZCNT", "true",
188 "Support LZCNT instruction">;
189 def FeatureBMI : SubtargetFeature<"bmi", "HasBMI", "true",
190 "Support BMI instructions">;
191 def FeatureBMI2 : SubtargetFeature<"bmi2", "HasBMI2", "true",
192 "Support BMI2 instructions">;
193 def FeatureRTM : SubtargetFeature<"rtm", "HasRTM", "true",
194 "Support RTM instructions">;
195 def FeatureADX : SubtargetFeature<"adx", "HasADX", "true",
196 "Support ADX instructions">;
197 def FeatureSHA : SubtargetFeature<"sha", "HasSHA", "true",
198 "Enable SHA instructions",
200 def FeaturePRFCHW : SubtargetFeature<"prfchw", "HasPRFCHW", "true",
201 "Support PRFCHW instructions">;
202 def FeatureRDSEED : SubtargetFeature<"rdseed", "HasRDSEED", "true",
203 "Support RDSEED instruction">;
204 def FeatureLAHFSAHF : SubtargetFeature<"sahf", "HasLAHFSAHF", "true",
205 "Support LAHF and SAHF instructions">;
206 def FeatureMWAITX : SubtargetFeature<"mwaitx", "HasMWAITX", "true",
207 "Enable MONITORX/MWAITX timer functionality">;
208 def FeatureCLZERO : SubtargetFeature<"clzero", "HasCLZERO", "true",
209 "Enable Cache Line Zero">;
210 def FeatureMPX : SubtargetFeature<"mpx", "HasMPX", "true",
211 "Support MPX instructions">;
212 def FeatureLEAForSP : SubtargetFeature<"lea-sp", "UseLeaForSP", "true",
213 "Use LEA for adjusting the stack pointer">;
214 def FeatureSlowDivide32 : SubtargetFeature<"idivl-to-divb",
215 "HasSlowDivide32", "true",
216 "Use 8-bit divide for positive values less than 256">;
217 def FeatureSlowDivide64 : SubtargetFeature<"idivq-to-divl",
218 "HasSlowDivide64", "true",
219 "Use 32-bit divide for positive values less than 2^32">;
220 def FeaturePadShortFunctions : SubtargetFeature<"pad-short-functions",
221 "PadShortFunctions", "true",
222 "Pad short functions">;
223 def FeatureSGX : SubtargetFeature<"sgx", "HasSGX", "true",
224 "Enable Software Guard Extensions">;
225 def FeatureCLFLUSHOPT : SubtargetFeature<"clflushopt", "HasCLFLUSHOPT", "true",
226 "Flush A Cache Line Optimized">;
227 def FeatureCLWB : SubtargetFeature<"clwb", "HasCLWB", "true",
228 "Cache Line Write Back">;
229 // TODO: This feature ought to be renamed.
230 // What it really refers to are CPUs for which certain instructions
231 // (which ones besides the example below?) are microcoded.
232 // The best examples of this are the memory forms of CALL and PUSH
233 // instructions, which should be avoided in favor of a MOV + register CALL/PUSH.
234 def FeatureCallRegIndirect : SubtargetFeature<"call-reg-indirect",
235 "CallRegIndirect", "true",
236 "Call register indirect">;
237 def FeatureLEAUsesAG : SubtargetFeature<"lea-uses-ag", "LEAUsesAG", "true",
238 "LEA instruction needs inputs at AG stage">;
239 def FeatureSlowLEA : SubtargetFeature<"slow-lea", "SlowLEA", "true",
240 "LEA instruction with certain arguments is slow">;
241 def FeatureSlow3OpsLEA : SubtargetFeature<"slow-3ops-lea", "Slow3OpsLEA", "true",
242 "LEA instruction with 3 ops or certain registers is slow">;
243 def FeatureSlowIncDec : SubtargetFeature<"slow-incdec", "SlowIncDec", "true",
244 "INC and DEC instructions are slower than ADD and SUB">;
246 : SubtargetFeature<"soft-float", "UseSoftFloat", "true",
247 "Use software floating point features.">;
248 // On some X86 processors, there is no performance hazard to writing only the
249 // lower parts of a YMM or ZMM register without clearing the upper part.
250 def FeatureFastPartialYMMorZMMWrite
251 : SubtargetFeature<"fast-partial-ymm-or-zmm-write",
252 "HasFastPartialYMMorZMMWrite",
253 "true", "Partial writes to YMM/ZMM registers are fast">;
254 // FeatureFastScalarFSQRT should be enabled if scalar FSQRT has shorter latency
255 // than the corresponding NR code. FeatureFastVectorFSQRT should be enabled if
256 // vector FSQRT has higher throughput than the corresponding NR code.
257 // The idea is that throughput bound code is likely to be vectorized, so for
258 // vectorized code we should care about the throughput of SQRT operations.
259 // But if the code is scalar that probably means that the code has some kind of
260 // dependency and we should care more about reducing the latency.
261 def FeatureFastScalarFSQRT
262 : SubtargetFeature<"fast-scalar-fsqrt", "HasFastScalarFSQRT",
263 "true", "Scalar SQRT is fast (disable Newton-Raphson)">;
264 def FeatureFastVectorFSQRT
265 : SubtargetFeature<"fast-vector-fsqrt", "HasFastVectorFSQRT",
266 "true", "Vector SQRT is fast (disable Newton-Raphson)">;
267 // If lzcnt has equivalent latency/throughput to most simple integer ops, it can
268 // be used to replace test/set sequences.
271 "fast-lzcnt", "HasFastLZCNT", "true",
272 "LZCNT instructions are as fast as most simple integer ops">;
275 // Sandy Bridge and newer processors can use SHLD with the same source on both
276 // inputs to implement rotate to avoid the partial flag update of the normal
277 // rotate instructions.
278 def FeatureFastSHLDRotate
280 "fast-shld-rotate", "HasFastSHLDRotate", "true",
281 "SHLD can be used as a faster rotate">;
283 // Ivy Bridge and newer processors have enhanced REP MOVSB and STOSB (aka
284 // "string operations"). See "REP String Enhancement" in the Intel Software
285 // Development Manual. This feature essentially means that REP MOVSB will copy
286 // using the largest available size instead of copying bytes one by one, making
287 // it at least as fast as REPMOVS{W,D,Q}.
290 "ermsb", "HasERMSB", "true",
291 "REP MOVS/STOS are fast">;
293 //===----------------------------------------------------------------------===//
294 // X86 processors supported.
295 //===----------------------------------------------------------------------===//
297 include "X86Schedule.td"
299 def ProcIntelAtom : SubtargetFeature<"atom", "X86ProcFamily", "IntelAtom",
300 "Intel Atom processors">;
301 def ProcIntelSLM : SubtargetFeature<"slm", "X86ProcFamily", "IntelSLM",
302 "Intel Silvermont processors">;
303 def ProcIntelGLM : SubtargetFeature<"glm", "X86ProcFamily", "IntelGLM",
304 "Intel Goldmont processors">;
306 class Proc<string Name, list<SubtargetFeature> Features>
307 : ProcessorModel<Name, GenericModel, Features>;
309 def : Proc<"generic", [FeatureX87, FeatureSlowUAMem16]>;
310 def : Proc<"i386", [FeatureX87, FeatureSlowUAMem16]>;
311 def : Proc<"i486", [FeatureX87, FeatureSlowUAMem16]>;
312 def : Proc<"i586", [FeatureX87, FeatureSlowUAMem16]>;
313 def : Proc<"pentium", [FeatureX87, FeatureSlowUAMem16]>;
314 def : Proc<"pentium-mmx", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>;
315 def : Proc<"i686", [FeatureX87, FeatureSlowUAMem16]>;
316 def : Proc<"pentiumpro", [FeatureX87, FeatureSlowUAMem16, FeatureCMOV]>;
317 def : Proc<"pentium2", [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
318 FeatureCMOV, FeatureFXSR]>;
319 def : Proc<"pentium3", [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
320 FeatureSSE1, FeatureFXSR]>;
321 def : Proc<"pentium3m", [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
322 FeatureSSE1, FeatureFXSR, FeatureSlowBTMem]>;
324 // Enable the PostRAScheduler for SSE2 and SSE3 class cpus.
325 // The intent is to enable it for pentium4 which is the current default
326 // processor in a vanilla 32-bit clang compilation when no specific
327 // architecture is specified. This generally gives a nice performance
328 // increase on silvermont, with largely neutral behavior on other
329 // contemporary large core processors.
330 // pentium-m, pentium4m, prescott and nocona are included as a preventative
331 // measure to avoid performance surprises, in case clang's default cpu
334 def : ProcessorModel<"pentium-m", GenericPostRAModel,
335 [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
336 FeatureSSE2, FeatureFXSR, FeatureSlowBTMem]>;
338 def : ProcessorModel<"pentium4", GenericPostRAModel,
339 [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
340 FeatureSSE2, FeatureFXSR]>;
342 def : ProcessorModel<"pentium4m", GenericPostRAModel,
343 [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
344 FeatureSSE2, FeatureFXSR, FeatureSlowBTMem]>;
347 def : Proc<"lakemont", []>;
350 def : ProcessorModel<"yonah", SandyBridgeModel,
351 [FeatureX87, FeatureSlowUAMem16, FeatureMMX, FeatureSSE3,
352 FeatureFXSR, FeatureSlowBTMem]>;
355 def : ProcessorModel<"prescott", GenericPostRAModel,
356 [FeatureX87, FeatureSlowUAMem16, FeatureMMX, FeatureSSE3,
357 FeatureFXSR, FeatureSlowBTMem]>;
358 def : ProcessorModel<"nocona", GenericPostRAModel, [
368 // Intel Core 2 Solo/Duo.
369 def : ProcessorModel<"core2", SandyBridgeModel, [
379 def : ProcessorModel<"penryn", SandyBridgeModel, [
391 class BonnellProc<string Name> : ProcessorModel<Name, AtomModel, [
404 FeatureCallRegIndirect,
406 FeaturePadShortFunctions,
409 def : BonnellProc<"bonnell">;
410 def : BonnellProc<"atom">; // Pin the generic name to the baseline.
412 class SilvermontProc<string Name> : ProcessorModel<Name, SLMModel, [
424 FeatureCallRegIndirect,
432 def : SilvermontProc<"silvermont">;
433 def : SilvermontProc<"slm">; // Legacy alias.
435 class GoldmontProc<string Name> : ProcessorModel<Name, SLMModel, [
447 FeatureCallRegIndirect,
462 def : GoldmontProc<"goldmont">;
464 // "Arrandale" along with corei3 and corei5
465 class NehalemProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [
475 def : NehalemProc<"nehalem">;
476 def : NehalemProc<"corei7">;
478 // Westmere is a similar machine to nehalem with some additional features.
479 // Westmere is the corei3/i5/i7 path from nehalem to sandybridge
480 class WestmereProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [
492 def : WestmereProc<"westmere">;
494 class ProcessorFeatures<list<SubtargetFeature> Inherited,
495 list<SubtargetFeature> NewFeatures> {
496 list<SubtargetFeature> Value = !listconcat(Inherited, NewFeatures);
499 class ProcModel<string Name, SchedMachineModel Model,
500 list<SubtargetFeature> ProcFeatures,
501 list<SubtargetFeature> OtherFeatures> :
502 ProcessorModel<Name, Model, !listconcat(ProcFeatures, OtherFeatures)>;
504 // SSE is not listed here since llvm treats AVX as a reimplementation of SSE,
505 // rather than a superset.
506 def SNBFeatures : ProcessorFeatures<[], [
520 FeatureFastScalarFSQRT,
521 FeatureFastSHLDRotate
524 class SandyBridgeProc<string Name> : ProcModel<Name, SandyBridgeModel,
529 def : SandyBridgeProc<"sandybridge">;
530 def : SandyBridgeProc<"corei7-avx">; // Legacy alias.
532 def IVBFeatures : ProcessorFeatures<SNBFeatures.Value, [
538 class IvyBridgeProc<string Name> : ProcModel<Name, SandyBridgeModel,
543 def : IvyBridgeProc<"ivybridge">;
544 def : IvyBridgeProc<"core-avx-i">; // Legacy alias.
546 def HSWFeatures : ProcessorFeatures<IVBFeatures.Value, [
557 class HaswellProc<string Name> : ProcModel<Name, HaswellModel,
558 HSWFeatures.Value, []>;
559 def : HaswellProc<"haswell">;
560 def : HaswellProc<"core-avx2">; // Legacy alias.
562 def BDWFeatures : ProcessorFeatures<HSWFeatures.Value, [
566 class BroadwellProc<string Name> : ProcModel<Name, HaswellModel,
567 BDWFeatures.Value, []>;
568 def : BroadwellProc<"broadwell">;
570 def SKLFeatures : ProcessorFeatures<BDWFeatures.Value, [
577 FeatureFastVectorFSQRT
580 // FIXME: define SKL model
581 class SkylakeClientProc<string Name> : ProcModel<Name, HaswellModel,
582 SKLFeatures.Value, []>;
583 def : SkylakeClientProc<"skylake">;
585 // FIXME: define KNL model
586 class KnightsLandingProc<string Name> : ProcModel<Name, HaswellModel,
600 FeatureFastPartialYMMorZMMWrite
602 def : KnightsLandingProc<"knl">;
604 def SKXFeatures : ProcessorFeatures<SKLFeatures.Value, [
614 // FIXME: define SKX model
615 class SkylakeServerProc<string Name> : ProcModel<Name, HaswellModel,
616 SKXFeatures.Value, []>;
617 def : SkylakeServerProc<"skylake-avx512">;
618 def : SkylakeServerProc<"skx">; // Legacy alias.
620 def CNLFeatures : ProcessorFeatures<SKXFeatures.Value, [
626 class CannonlakeProc<string Name> : ProcModel<Name, HaswellModel,
627 CNLFeatures.Value, []>;
628 def : CannonlakeProc<"cannonlake">;
632 def : Proc<"k6", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>;
633 def : Proc<"k6-2", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
634 def : Proc<"k6-3", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
635 def : Proc<"athlon", [FeatureX87, FeatureSlowUAMem16, Feature3DNowA,
636 FeatureSlowBTMem, FeatureSlowSHLD]>;
637 def : Proc<"athlon-tbird", [FeatureX87, FeatureSlowUAMem16, Feature3DNowA,
638 FeatureSlowBTMem, FeatureSlowSHLD]>;
639 def : Proc<"athlon-4", [FeatureX87, FeatureSlowUAMem16, FeatureSSE1,
640 Feature3DNowA, FeatureFXSR, FeatureSlowBTMem,
642 def : Proc<"athlon-xp", [FeatureX87, FeatureSlowUAMem16, FeatureSSE1,
643 Feature3DNowA, FeatureFXSR, FeatureSlowBTMem,
645 def : Proc<"athlon-mp", [FeatureX87, FeatureSlowUAMem16, FeatureSSE1,
646 Feature3DNowA, FeatureFXSR, FeatureSlowBTMem,
648 def : Proc<"k8", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
649 Feature3DNowA, FeatureFXSR, Feature64Bit,
650 FeatureSlowBTMem, FeatureSlowSHLD]>;
651 def : Proc<"opteron", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
652 Feature3DNowA, FeatureFXSR, Feature64Bit,
653 FeatureSlowBTMem, FeatureSlowSHLD]>;
654 def : Proc<"athlon64", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
655 Feature3DNowA, FeatureFXSR, Feature64Bit,
656 FeatureSlowBTMem, FeatureSlowSHLD]>;
657 def : Proc<"athlon-fx", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
658 Feature3DNowA, FeatureFXSR, Feature64Bit,
659 FeatureSlowBTMem, FeatureSlowSHLD]>;
660 def : Proc<"k8-sse3", [FeatureX87, FeatureSlowUAMem16, FeatureSSE3,
661 Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B,
662 FeatureSlowBTMem, FeatureSlowSHLD]>;
663 def : Proc<"opteron-sse3", [FeatureX87, FeatureSlowUAMem16, FeatureSSE3,
664 Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B,
665 FeatureSlowBTMem, FeatureSlowSHLD]>;
666 def : Proc<"athlon64-sse3", [FeatureX87, FeatureSlowUAMem16, FeatureSSE3,
667 Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B,
668 FeatureSlowBTMem, FeatureSlowSHLD]>;
669 def : Proc<"amdfam10", [FeatureX87, FeatureSSE4A, Feature3DNowA,
670 FeatureFXSR, FeatureCMPXCHG16B, FeatureLZCNT,
671 FeaturePOPCNT, FeatureSlowBTMem, FeatureSlowSHLD,
673 def : Proc<"barcelona", [FeatureX87, FeatureSSE4A, Feature3DNowA,
674 FeatureFXSR, FeatureCMPXCHG16B, FeatureLZCNT,
675 FeaturePOPCNT, FeatureSlowBTMem, FeatureSlowSHLD,
679 def : Proc<"btver1", [
694 def : ProcessorModel<"btver2", BtVer2Model, [
714 FeatureFastPartialYMMorZMMWrite
718 def : Proc<"bdver1", [
738 def : Proc<"bdver2", [
763 def : Proc<"bdver3", [
790 def : Proc<"bdver4", [
818 def: ProcessorModel<"znver1", Znver1Model, [
851 def : Proc<"geode", [FeatureX87, FeatureSlowUAMem16, Feature3DNowA]>;
853 def : Proc<"winchip-c6", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>;
854 def : Proc<"winchip2", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
855 def : Proc<"c3", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
856 def : Proc<"c3-2", [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
857 FeatureSSE1, FeatureFXSR]>;
859 // We also provide a generic 64-bit specific x86 processor model which tries to
860 // be good for modern chips without enabling instruction set encodings past the
861 // basic SSE2 and 64-bit ones. It disables slow things from any mainstream and
862 // modern 64-bit x86 chip, and enables features that are generally beneficial.
864 // We currently use the Sandy Bridge model as the default scheduling model as
865 // we use it across Nehalem, Westmere, Sandy Bridge, and Ivy Bridge which
866 // covers a huge swath of x86 processors. If there are specific scheduling
867 // knobs which need to be tuned differently for AMD chips, we might consider
868 // forming a common base for them.
869 def : ProcessorModel<"x86-64", SandyBridgeModel,
870 [FeatureX87, FeatureMMX, FeatureSSE2, FeatureFXSR,
871 Feature64Bit, FeatureSlowBTMem ]>;
873 //===----------------------------------------------------------------------===//
874 // Register File Description
875 //===----------------------------------------------------------------------===//
877 include "X86RegisterInfo.td"
878 include "X86RegisterBanks.td"
880 //===----------------------------------------------------------------------===//
881 // Instruction Descriptions
882 //===----------------------------------------------------------------------===//
884 include "X86InstrInfo.td"
886 def X86InstrInfo : InstrInfo;
888 //===----------------------------------------------------------------------===//
889 // Calling Conventions
890 //===----------------------------------------------------------------------===//
892 include "X86CallingConv.td"
895 //===----------------------------------------------------------------------===//
897 //===----------------------------------------------------------------------===//
899 def ATTAsmParserVariant : AsmParserVariant {
905 // Discard comments in assembly strings.
906 string CommentDelimiter = "#";
908 // Recognize hard coded registers.
909 string RegisterPrefix = "%";
912 def IntelAsmParserVariant : AsmParserVariant {
916 string Name = "intel";
918 // Discard comments in assembly strings.
919 string CommentDelimiter = ";";
921 // Recognize hard coded registers.
922 string RegisterPrefix = "";
925 //===----------------------------------------------------------------------===//
927 //===----------------------------------------------------------------------===//
929 // The X86 target supports two different syntaxes for emitting machine code.
930 // This is controlled by the -x86-asm-syntax={att|intel}
931 def ATTAsmWriter : AsmWriter {
932 string AsmWriterClassName = "ATTInstPrinter";
935 def IntelAsmWriter : AsmWriter {
936 string AsmWriterClassName = "IntelInstPrinter";
941 // Information about the instructions...
942 let InstructionSet = X86InstrInfo;
943 let AssemblyParserVariants = [ATTAsmParserVariant, IntelAsmParserVariant];
944 let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter];