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">;
304 class Proc<string Name, list<SubtargetFeature> Features>
305 : ProcessorModel<Name, GenericModel, Features>;
307 def : Proc<"generic", [FeatureX87, FeatureSlowUAMem16]>;
308 def : Proc<"i386", [FeatureX87, FeatureSlowUAMem16]>;
309 def : Proc<"i486", [FeatureX87, FeatureSlowUAMem16]>;
310 def : Proc<"i586", [FeatureX87, FeatureSlowUAMem16]>;
311 def : Proc<"pentium", [FeatureX87, FeatureSlowUAMem16]>;
312 def : Proc<"pentium-mmx", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>;
313 def : Proc<"i686", [FeatureX87, FeatureSlowUAMem16]>;
314 def : Proc<"pentiumpro", [FeatureX87, FeatureSlowUAMem16, FeatureCMOV]>;
315 def : Proc<"pentium2", [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
316 FeatureCMOV, FeatureFXSR]>;
317 def : Proc<"pentium3", [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
318 FeatureSSE1, FeatureFXSR]>;
319 def : Proc<"pentium3m", [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
320 FeatureSSE1, FeatureFXSR, FeatureSlowBTMem]>;
322 // Enable the PostRAScheduler for SSE2 and SSE3 class cpus.
323 // The intent is to enable it for pentium4 which is the current default
324 // processor in a vanilla 32-bit clang compilation when no specific
325 // architecture is specified. This generally gives a nice performance
326 // increase on silvermont, with largely neutral behavior on other
327 // contemporary large core processors.
328 // pentium-m, pentium4m, prescott and nocona are included as a preventative
329 // measure to avoid performance surprises, in case clang's default cpu
332 def : ProcessorModel<"pentium-m", GenericPostRAModel,
333 [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
334 FeatureSSE2, FeatureFXSR, FeatureSlowBTMem]>;
336 def : ProcessorModel<"pentium4", GenericPostRAModel,
337 [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
338 FeatureSSE2, FeatureFXSR]>;
340 def : ProcessorModel<"pentium4m", GenericPostRAModel,
341 [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
342 FeatureSSE2, FeatureFXSR, FeatureSlowBTMem]>;
345 def : Proc<"lakemont", []>;
348 def : ProcessorModel<"yonah", SandyBridgeModel,
349 [FeatureX87, FeatureSlowUAMem16, FeatureMMX, FeatureSSE3,
350 FeatureFXSR, FeatureSlowBTMem]>;
353 def : ProcessorModel<"prescott", GenericPostRAModel,
354 [FeatureX87, FeatureSlowUAMem16, FeatureMMX, FeatureSSE3,
355 FeatureFXSR, FeatureSlowBTMem]>;
356 def : ProcessorModel<"nocona", GenericPostRAModel, [
366 // Intel Core 2 Solo/Duo.
367 def : ProcessorModel<"core2", SandyBridgeModel, [
377 def : ProcessorModel<"penryn", SandyBridgeModel, [
389 class BonnellProc<string Name> : ProcessorModel<Name, AtomModel, [
402 FeatureCallRegIndirect,
404 FeaturePadShortFunctions,
407 def : BonnellProc<"bonnell">;
408 def : BonnellProc<"atom">; // Pin the generic name to the baseline.
410 class SilvermontProc<string Name> : ProcessorModel<Name, SLMModel, [
422 FeatureCallRegIndirect,
430 def : SilvermontProc<"silvermont">;
431 def : SilvermontProc<"slm">; // Legacy alias.
433 // "Arrandale" along with corei3 and corei5
434 class NehalemProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [
444 def : NehalemProc<"nehalem">;
445 def : NehalemProc<"corei7">;
447 // Westmere is a similar machine to nehalem with some additional features.
448 // Westmere is the corei3/i5/i7 path from nehalem to sandybridge
449 class WestmereProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [
461 def : WestmereProc<"westmere">;
463 class ProcessorFeatures<list<SubtargetFeature> Inherited,
464 list<SubtargetFeature> NewFeatures> {
465 list<SubtargetFeature> Value = !listconcat(Inherited, NewFeatures);
468 class ProcModel<string Name, SchedMachineModel Model,
469 list<SubtargetFeature> ProcFeatures,
470 list<SubtargetFeature> OtherFeatures> :
471 ProcessorModel<Name, Model, !listconcat(ProcFeatures, OtherFeatures)>;
473 // SSE is not listed here since llvm treats AVX as a reimplementation of SSE,
474 // rather than a superset.
475 def SNBFeatures : ProcessorFeatures<[], [
489 FeatureFastScalarFSQRT,
490 FeatureFastSHLDRotate
493 class SandyBridgeProc<string Name> : ProcModel<Name, SandyBridgeModel,
498 def : SandyBridgeProc<"sandybridge">;
499 def : SandyBridgeProc<"corei7-avx">; // Legacy alias.
501 def IVBFeatures : ProcessorFeatures<SNBFeatures.Value, [
507 class IvyBridgeProc<string Name> : ProcModel<Name, SandyBridgeModel,
512 def : IvyBridgeProc<"ivybridge">;
513 def : IvyBridgeProc<"core-avx-i">; // Legacy alias.
515 def HSWFeatures : ProcessorFeatures<IVBFeatures.Value, [
526 class HaswellProc<string Name> : ProcModel<Name, HaswellModel,
527 HSWFeatures.Value, []>;
528 def : HaswellProc<"haswell">;
529 def : HaswellProc<"core-avx2">; // Legacy alias.
531 def BDWFeatures : ProcessorFeatures<HSWFeatures.Value, [
535 class BroadwellProc<string Name> : ProcModel<Name, HaswellModel,
536 BDWFeatures.Value, []>;
537 def : BroadwellProc<"broadwell">;
539 def SKLFeatures : ProcessorFeatures<BDWFeatures.Value, [
546 FeatureFastVectorFSQRT
549 // FIXME: define SKL model
550 class SkylakeClientProc<string Name> : ProcModel<Name, HaswellModel,
551 SKLFeatures.Value, []>;
552 def : SkylakeClientProc<"skylake">;
554 // FIXME: define KNL model
555 class KnightsLandingProc<string Name> : ProcModel<Name, HaswellModel,
569 FeatureFastPartialYMMorZMMWrite
571 def : KnightsLandingProc<"knl">;
573 def SKXFeatures : ProcessorFeatures<SKLFeatures.Value, [
583 // FIXME: define SKX model
584 class SkylakeServerProc<string Name> : ProcModel<Name, HaswellModel,
585 SKXFeatures.Value, []>;
586 def : SkylakeServerProc<"skylake-avx512">;
587 def : SkylakeServerProc<"skx">; // Legacy alias.
589 def CNLFeatures : ProcessorFeatures<SKXFeatures.Value, [
595 class CannonlakeProc<string Name> : ProcModel<Name, HaswellModel,
596 CNLFeatures.Value, []>;
597 def : CannonlakeProc<"cannonlake">;
601 def : Proc<"k6", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>;
602 def : Proc<"k6-2", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
603 def : Proc<"k6-3", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
604 def : Proc<"athlon", [FeatureX87, FeatureSlowUAMem16, Feature3DNowA,
605 FeatureSlowBTMem, FeatureSlowSHLD]>;
606 def : Proc<"athlon-tbird", [FeatureX87, FeatureSlowUAMem16, Feature3DNowA,
607 FeatureSlowBTMem, FeatureSlowSHLD]>;
608 def : Proc<"athlon-4", [FeatureX87, FeatureSlowUAMem16, FeatureSSE1,
609 Feature3DNowA, FeatureFXSR, FeatureSlowBTMem,
611 def : Proc<"athlon-xp", [FeatureX87, FeatureSlowUAMem16, FeatureSSE1,
612 Feature3DNowA, FeatureFXSR, FeatureSlowBTMem,
614 def : Proc<"athlon-mp", [FeatureX87, FeatureSlowUAMem16, FeatureSSE1,
615 Feature3DNowA, FeatureFXSR, FeatureSlowBTMem,
617 def : Proc<"k8", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
618 Feature3DNowA, FeatureFXSR, Feature64Bit,
619 FeatureSlowBTMem, FeatureSlowSHLD]>;
620 def : Proc<"opteron", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
621 Feature3DNowA, FeatureFXSR, Feature64Bit,
622 FeatureSlowBTMem, FeatureSlowSHLD]>;
623 def : Proc<"athlon64", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
624 Feature3DNowA, FeatureFXSR, Feature64Bit,
625 FeatureSlowBTMem, FeatureSlowSHLD]>;
626 def : Proc<"athlon-fx", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2,
627 Feature3DNowA, FeatureFXSR, Feature64Bit,
628 FeatureSlowBTMem, FeatureSlowSHLD]>;
629 def : Proc<"k8-sse3", [FeatureX87, FeatureSlowUAMem16, FeatureSSE3,
630 Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B,
631 FeatureSlowBTMem, FeatureSlowSHLD]>;
632 def : Proc<"opteron-sse3", [FeatureX87, FeatureSlowUAMem16, FeatureSSE3,
633 Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B,
634 FeatureSlowBTMem, FeatureSlowSHLD]>;
635 def : Proc<"athlon64-sse3", [FeatureX87, FeatureSlowUAMem16, FeatureSSE3,
636 Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B,
637 FeatureSlowBTMem, FeatureSlowSHLD]>;
638 def : Proc<"amdfam10", [FeatureX87, FeatureSSE4A, Feature3DNowA,
639 FeatureFXSR, FeatureCMPXCHG16B, FeatureLZCNT,
640 FeaturePOPCNT, FeatureSlowBTMem, FeatureSlowSHLD,
642 def : Proc<"barcelona", [FeatureX87, FeatureSSE4A, Feature3DNowA,
643 FeatureFXSR, FeatureCMPXCHG16B, FeatureLZCNT,
644 FeaturePOPCNT, FeatureSlowBTMem, FeatureSlowSHLD,
648 def : Proc<"btver1", [
663 def : ProcessorModel<"btver2", BtVer2Model, [
683 FeatureFastPartialYMMorZMMWrite
687 def : Proc<"bdver1", [
707 def : Proc<"bdver2", [
732 def : Proc<"bdver3", [
759 def : Proc<"bdver4", [
786 // TODO: The scheduler model falls to BTVER2 model.
787 // The znver1 model has to be put in place.
789 def: ProcessorModel<"znver1", BtVer2Model, [
822 def : Proc<"geode", [FeatureX87, FeatureSlowUAMem16, Feature3DNowA]>;
824 def : Proc<"winchip-c6", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>;
825 def : Proc<"winchip2", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
826 def : Proc<"c3", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
827 def : Proc<"c3-2", [FeatureX87, FeatureSlowUAMem16, FeatureMMX,
828 FeatureSSE1, FeatureFXSR]>;
830 // We also provide a generic 64-bit specific x86 processor model which tries to
831 // be good for modern chips without enabling instruction set encodings past the
832 // basic SSE2 and 64-bit ones. It disables slow things from any mainstream and
833 // modern 64-bit x86 chip, and enables features that are generally beneficial.
835 // We currently use the Sandy Bridge model as the default scheduling model as
836 // we use it across Nehalem, Westmere, Sandy Bridge, and Ivy Bridge which
837 // covers a huge swath of x86 processors. If there are specific scheduling
838 // knobs which need to be tuned differently for AMD chips, we might consider
839 // forming a common base for them.
840 def : ProcessorModel<"x86-64", SandyBridgeModel,
841 [FeatureX87, FeatureMMX, FeatureSSE2, FeatureFXSR,
842 Feature64Bit, FeatureSlowBTMem ]>;
844 //===----------------------------------------------------------------------===//
845 // Register File Description
846 //===----------------------------------------------------------------------===//
848 include "X86RegisterInfo.td"
849 include "X86RegisterBanks.td"
851 //===----------------------------------------------------------------------===//
852 // Instruction Descriptions
853 //===----------------------------------------------------------------------===//
855 include "X86InstrInfo.td"
857 def X86InstrInfo : InstrInfo;
859 //===----------------------------------------------------------------------===//
860 // Calling Conventions
861 //===----------------------------------------------------------------------===//
863 include "X86CallingConv.td"
866 //===----------------------------------------------------------------------===//
868 //===----------------------------------------------------------------------===//
870 def ATTAsmParserVariant : AsmParserVariant {
876 // Discard comments in assembly strings.
877 string CommentDelimiter = "#";
879 // Recognize hard coded registers.
880 string RegisterPrefix = "%";
883 def IntelAsmParserVariant : AsmParserVariant {
887 string Name = "intel";
889 // Discard comments in assembly strings.
890 string CommentDelimiter = ";";
892 // Recognize hard coded registers.
893 string RegisterPrefix = "";
896 //===----------------------------------------------------------------------===//
898 //===----------------------------------------------------------------------===//
900 // The X86 target supports two different syntaxes for emitting machine code.
901 // This is controlled by the -x86-asm-syntax={att|intel}
902 def ATTAsmWriter : AsmWriter {
903 string AsmWriterClassName = "ATTInstPrinter";
906 def IntelAsmWriter : AsmWriter {
907 string AsmWriterClassName = "IntelInstPrinter";
912 // Information about the instructions...
913 let InstructionSet = X86InstrInfo;
914 let AssemblyParserVariants = [ATTAsmParserVariant, IntelAsmParserVariant];
915 let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter];