blob: ca4948246fc5222b6fe5896db5c932f51cec0c23 [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- X86.td - Target definition file for the Intel X86 --*- tablegen -*-===//
Michael J. Spencerb88784c2011-04-14 14:33:36 +00002//
John Criswell29265fe2003-10-21 15:17:13 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Michael J. Spencerb88784c2011-04-14 14:33:36 +00007//
John Criswell29265fe2003-10-21 15:17:13 +00008//===----------------------------------------------------------------------===//
Chris Lattner5da8e802003-08-03 15:47:49 +00009//
Craig Topper271064e2011-10-11 06:44:02 +000010// This is a target description file for the Intel i386 architecture, referred
11// to here as the "X86" architecture.
Chris Lattner5da8e802003-08-03 15:47:49 +000012//
13//===----------------------------------------------------------------------===//
14
Chris Lattner25510802003-08-04 04:59:56 +000015// Get the target-independent interfaces which we are implementing...
Chris Lattner5da8e802003-08-03 15:47:49 +000016//
Evan Cheng977e7be2008-11-24 07:34:46 +000017include "llvm/Target/Target.td"
Chris Lattner5da8e802003-08-03 15:47:49 +000018
19//===----------------------------------------------------------------------===//
Anitha Boyapati426feb62012-08-16 03:50:04 +000020// X86 Subtarget state
Evan Cheng13bcc6c2011-07-07 21:06:52 +000021//
22
23def Mode64Bit : SubtargetFeature<"64bit-mode", "In64BitMode", "true",
24 "64-bit mode (x86_64)">;
25
26//===----------------------------------------------------------------------===//
Anitha Boyapati426feb62012-08-16 03:50:04 +000027// X86 Subtarget features
Bill Wendlinge6182262007-05-04 20:38:40 +000028//===----------------------------------------------------------------------===//
Chris Lattnercc8c5812009-09-02 05:53:04 +000029
30def FeatureCMOV : SubtargetFeature<"cmov","HasCMov", "true",
31 "Enable conditional move instructions">;
32
Benjamin Kramer2f489232010-12-04 20:32:23 +000033def FeaturePOPCNT : SubtargetFeature<"popcnt", "HasPOPCNT", "true",
34 "Support POPCNT instruction">;
35
David Greene206351a2010-01-11 16:29:42 +000036
Bill Wendlinge6182262007-05-04 20:38:40 +000037def FeatureMMX : SubtargetFeature<"mmx","X86SSELevel", "MMX",
38 "Enable MMX instructions">;
39def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1",
40 "Enable SSE instructions",
Chris Lattnercc8c5812009-09-02 05:53:04 +000041 // SSE codegen depends on cmovs, and all
Michael J. Spencerb88784c2011-04-14 14:33:36 +000042 // SSE1+ processors support them.
Chris Lattnercc8c5812009-09-02 05:53:04 +000043 [FeatureMMX, FeatureCMOV]>;
Bill Wendlinge6182262007-05-04 20:38:40 +000044def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", "SSE2",
45 "Enable SSE2 instructions",
46 [FeatureSSE1]>;
47def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3",
48 "Enable SSE3 instructions",
49 [FeatureSSE2]>;
50def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3",
51 "Enable SSSE3 instructions",
52 [FeatureSSE3]>;
Nate Begemane14fdfa2008-02-03 07:18:54 +000053def FeatureSSE41 : SubtargetFeature<"sse41", "X86SSELevel", "SSE41",
54 "Enable SSE 4.1 instructions",
55 [FeatureSSSE3]>;
56def FeatureSSE42 : SubtargetFeature<"sse42", "X86SSELevel", "SSE42",
57 "Enable SSE 4.2 instructions",
Craig Topper7bd33052011-12-29 15:51:45 +000058 [FeatureSSE41]>;
Bill Wendlinge6182262007-05-04 20:38:40 +000059def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow",
Michael J. Spencer30088ba2011-04-15 00:32:41 +000060 "Enable 3DNow! instructions",
61 [FeatureMMX]>;
Bill Wendlinge6182262007-05-04 20:38:40 +000062def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA",
Bill Wendlingf985c492007-05-06 07:56:19 +000063 "Enable 3DNow! Athlon instructions",
64 [Feature3DNow]>;
Dan Gohman74037512009-02-03 00:04:43 +000065// All x86-64 hardware has SSE2, but we don't mark SSE2 as an implied
66// feature, because SSE2 can be disabled (e.g. for compiling OS kernels)
67// without disabling 64-bit mode.
Bill Wendlingf985c492007-05-06 07:56:19 +000068def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true",
Chris Lattner77f7dba2010-03-14 22:24:34 +000069 "Support 64-bit instructions",
70 [FeatureCMOV]>;
Eli Friedman5e570422011-08-26 21:21:21 +000071def FeatureCMPXCHG16B : SubtargetFeature<"cmpxchg16b", "HasCmpxchg16b", "true",
72 "64-bit with cmpxchg16b",
73 [Feature64Bit]>;
Evan Cheng4c91aa32009-01-02 05:35:45 +000074def FeatureSlowBTMem : SubtargetFeature<"slow-bt-mem", "IsBTMemSlow", "true",
75 "Bit testing of memory is slow">;
Evan Cheng738b0f92010-04-01 05:58:17 +000076def FeatureFastUAMem : SubtargetFeature<"fast-unaligned-mem",
77 "IsUAMemFast", "true",
78 "Fast unaligned memory access">;
Stefanus Du Toit96180b52009-05-26 21:04:35 +000079def FeatureSSE4A : SubtargetFeature<"sse4a", "HasSSE4A", "true",
Craig Toppera5d1fc22011-12-30 07:16:00 +000080 "Support SSE 4a instructions",
81 [FeatureSSE3]>;
Evan Chengff1beda2006-10-06 09:17:41 +000082
Craig Topperf287a452012-01-09 09:02:13 +000083def FeatureAVX : SubtargetFeature<"avx", "X86SSELevel", "AVX",
84 "Enable AVX instructions",
85 [FeatureSSE42]>;
86def FeatureAVX2 : SubtargetFeature<"avx2", "X86SSELevel", "AVX2",
Craig Topper228d9132011-10-30 19:57:21 +000087 "Enable AVX2 instructions",
88 [FeatureAVX]>;
Craig Topper5c94bb82013-08-21 03:57:57 +000089def FeatureAVX512 : SubtargetFeature<"avx512f", "X86SSELevel", "AVX512F",
Elena Demikhovsky8cfb43f2013-07-24 11:02:47 +000090 "Enable AVX-512 instructions",
91 [FeatureAVX2]>;
Craig Topper5c94bb82013-08-21 03:57:57 +000092def FeatureERI : SubtargetFeature<"avx512er", "HasERI", "true",
Elena Demikhovsky003e7d72013-07-28 08:28:38 +000093 "Enable AVX-512 Exponential and Reciprocal Instructions",
94 [FeatureAVX512]>;
Craig Topper5c94bb82013-08-21 03:57:57 +000095def FeatureCDI : SubtargetFeature<"avx512cd", "HasCDI", "true",
Elena Demikhovsky003e7d72013-07-28 08:28:38 +000096 "Enable AVX-512 Conflict Detection Instructions",
97 [FeatureAVX512]>;
Craig Topper5c94bb82013-08-21 03:57:57 +000098def FeaturePFI : SubtargetFeature<"avx512pf", "HasPFI", "true",
Elena Demikhovsky003e7d72013-07-28 08:28:38 +000099 "Enable AVX-512 PreFetch Instructions",
100 [FeatureAVX512]>;
Elena Demikhovsky8cfb43f2013-07-24 11:02:47 +0000101
Benjamin Kramera0396e42012-05-31 14:34:17 +0000102def FeaturePCLMUL : SubtargetFeature<"pclmul", "HasPCLMUL", "true",
103 "Enable packed carry-less multiplication instructions",
Craig Topper29dd1482012-05-01 05:28:32 +0000104 [FeatureSSE2]>;
Craig Topper79dbb0c2012-06-03 18:58:46 +0000105def FeatureFMA : SubtargetFeature<"fma", "HasFMA", "true",
Craig Toppere1bd0512011-12-29 19:46:19 +0000106 "Enable three-operand fused multiple-add",
107 [FeatureAVX]>;
David Greene8f6f72c2009-06-26 22:46:54 +0000108def FeatureFMA4 : SubtargetFeature<"fma4", "HasFMA4", "true",
Craig Toppera5d1fc22011-12-30 07:16:00 +0000109 "Enable four-operand fused multiple-add",
Craig Topperbae0e9e2012-05-01 06:54:48 +0000110 [FeatureAVX, FeatureSSE4A]>;
Craig Toppera5d1fc22011-12-30 07:16:00 +0000111def FeatureXOP : SubtargetFeature<"xop", "HasXOP", "true",
Craig Topper43518cc2012-05-01 05:41:41 +0000112 "Enable XOP instructions",
Anitha Boyapatiaf3e9832012-08-16 04:04:02 +0000113 [FeatureFMA4]>;
David Greene206351a2010-01-11 16:29:42 +0000114def FeatureVectorUAMem : SubtargetFeature<"vector-unaligned-mem",
115 "HasVectorUAMem", "true",
116 "Allow unaligned memory operands on vector/SIMD instructions">;
Eric Christopher2ef63182010-04-02 21:54:27 +0000117def FeatureAES : SubtargetFeature<"aes", "HasAES", "true",
Craig Topper29dd1482012-05-01 05:28:32 +0000118 "Enable AES instructions",
119 [FeatureSSE2]>;
Craig Topper786bdb92011-10-03 17:28:23 +0000120def FeatureMOVBE : SubtargetFeature<"movbe", "HasMOVBE", "true",
121 "Support MOVBE instruction">;
122def FeatureRDRAND : SubtargetFeature<"rdrand", "HasRDRAND", "true",
123 "Support RDRAND instruction">;
Craig Topperfe9179f2011-10-09 07:31:39 +0000124def FeatureF16C : SubtargetFeature<"f16c", "HasF16C", "true",
125 "Support 16-bit floating point conversion instructions">;
Craig Topper228d9132011-10-30 19:57:21 +0000126def FeatureFSGSBase : SubtargetFeature<"fsgsbase", "HasFSGSBase", "true",
127 "Support FS/GS Base instructions">;
Craig Topper271064e2011-10-11 06:44:02 +0000128def FeatureLZCNT : SubtargetFeature<"lzcnt", "HasLZCNT", "true",
129 "Support LZCNT instruction">;
Craig Topper3657fe42011-10-14 03:21:46 +0000130def FeatureBMI : SubtargetFeature<"bmi", "HasBMI", "true",
131 "Support BMI instructions">;
Craig Topperaea148c2011-10-16 07:55:05 +0000132def FeatureBMI2 : SubtargetFeature<"bmi2", "HasBMI2", "true",
133 "Support BMI2 instructions">;
Michael Liao73cffdd2012-11-08 07:28:54 +0000134def FeatureRTM : SubtargetFeature<"rtm", "HasRTM", "true",
135 "Support RTM instructions">;
Michael Liaoe344ec92013-03-26 22:46:02 +0000136def FeatureHLE : SubtargetFeature<"hle", "HasHLE", "true",
137 "Support HLE">;
Kay Tiong Khoof809c642013-02-14 19:08:21 +0000138def FeatureADX : SubtargetFeature<"adx", "HasADX", "true",
139 "Support ADX instructions">;
Michael Liao5173ee02013-03-26 17:47:11 +0000140def FeaturePRFCHW : SubtargetFeature<"prfchw", "HasPRFCHW", "true",
141 "Support PRFCHW instructions">;
Michael Liaoa486a112013-03-28 23:41:26 +0000142def FeatureRDSEED : SubtargetFeature<"rdseed", "HasRDSEED", "true",
143 "Support RDSEED instruction">;
Evan Cheng1b81fdd2012-02-07 22:50:41 +0000144def FeatureLeaForSP : SubtargetFeature<"lea-sp", "UseLeaForSP", "true",
145 "Use LEA for adjusting the stack pointer">;
Preston Gurdcdf540d2012-09-04 18:22:17 +0000146def FeatureSlowDivide : SubtargetFeature<"idiv-to-divb",
Preston Gurda01daac2013-01-08 18:27:24 +0000147 "HasSlowDivide", "true",
148 "Use small divide for positive values less than 256">;
149def FeaturePadShortFunctions : SubtargetFeature<"pad-short-functions",
150 "PadShortFunctions", "true",
151 "Pad short functions">;
Preston Gurd663e6f92013-03-27 19:14:02 +0000152def FeatureCallRegIndirect : SubtargetFeature<"call-reg-indirect",
153 "CallRegIndirect", "true",
154 "Call register indirect">;
Preston Gurd8b7ab4b2013-04-25 20:29:37 +0000155def FeatureLEAUsesAG : SubtargetFeature<"lea-uses-ag", "LEAUsesAG", "true",
156 "LEA instruction needs inputs at AG stage">;
David Greene8f6f72c2009-06-26 22:46:54 +0000157
Evan Chengff1beda2006-10-06 09:17:41 +0000158//===----------------------------------------------------------------------===//
159// X86 processors supported.
160//===----------------------------------------------------------------------===//
161
Andrew Trick8523b162012-02-01 23:20:51 +0000162include "X86Schedule.td"
163
164def ProcIntelAtom : SubtargetFeature<"atom", "X86ProcFamily", "IntelAtom",
165 "Intel Atom processors">;
166
Evan Chengff1beda2006-10-06 09:17:41 +0000167class Proc<string Name, list<SubtargetFeature> Features>
Andrew Trick87255e32012-07-07 04:00:00 +0000168 : ProcessorModel<Name, GenericModel, Features>;
Andrew Trick8523b162012-02-01 23:20:51 +0000169
Evan Chengff1beda2006-10-06 09:17:41 +0000170def : Proc<"generic", []>;
171def : Proc<"i386", []>;
172def : Proc<"i486", []>;
Dale Johannesen28106752008-10-14 22:06:33 +0000173def : Proc<"i586", []>;
Evan Chengff1beda2006-10-06 09:17:41 +0000174def : Proc<"pentium", []>;
175def : Proc<"pentium-mmx", [FeatureMMX]>;
176def : Proc<"i686", []>;
Chris Lattnercc8c5812009-09-02 05:53:04 +0000177def : Proc<"pentiumpro", [FeatureCMOV]>;
178def : Proc<"pentium2", [FeatureMMX, FeatureCMOV]>;
Bill Wendling3fb7fdf2007-05-22 05:15:37 +0000179def : Proc<"pentium3", [FeatureSSE1]>;
Michael J. Spencer99737382011-05-03 03:42:50 +0000180def : Proc<"pentium3m", [FeatureSSE1, FeatureSlowBTMem]>;
Evan Cheng4c91aa32009-01-02 05:35:45 +0000181def : Proc<"pentium-m", [FeatureSSE2, FeatureSlowBTMem]>;
Bill Wendling3fb7fdf2007-05-22 05:15:37 +0000182def : Proc<"pentium4", [FeatureSSE2]>;
Michael J. Spencer99737382011-05-03 03:42:50 +0000183def : Proc<"pentium4m", [FeatureSSE2, FeatureSlowBTMem]>;
Chandler Carruth7a28f952012-12-15 09:01:13 +0000184def : Proc<"x86-64", [FeatureSSE2, Feature64Bit, FeatureSlowBTMem,
185 FeatureFastUAMem]>;
Jakob Stoklund Olesen1ac7e662013-03-26 22:19:12 +0000186// Intel Core Duo.
187def : ProcessorModel<"yonah", SandyBridgeModel,
188 [FeatureSSE3, FeatureSlowBTMem]>;
189
190// NetBurst.
191def : Proc<"prescott", [FeatureSSE3, FeatureSlowBTMem]>;
192def : Proc<"nocona", [FeatureSSE3, FeatureCMPXCHG16B, FeatureSlowBTMem]>;
193
194// Intel Core 2 Solo/Duo.
195def : ProcessorModel<"core2", SandyBridgeModel,
196 [FeatureSSSE3, FeatureCMPXCHG16B, FeatureSlowBTMem]>;
197def : ProcessorModel<"penryn", SandyBridgeModel,
198 [FeatureSSE41, FeatureCMPXCHG16B, FeatureSlowBTMem]>;
199
200// Atom.
201def : ProcessorModel<"atom", AtomModel,
202 [ProcIntelAtom, FeatureSSSE3, FeatureCMPXCHG16B,
203 FeatureMOVBE, FeatureSlowBTMem, FeatureLeaForSP,
Preston Gurd663e6f92013-03-27 19:14:02 +0000204 FeatureSlowDivide,
205 FeatureCallRegIndirect,
Preston Gurd8b7ab4b2013-04-25 20:29:37 +0000206 FeatureLEAUsesAG,
Preston Gurd663e6f92013-03-27 19:14:02 +0000207 FeaturePadShortFunctions]>;
Jakob Stoklund Olesen1ac7e662013-03-26 22:19:12 +0000208
Eric Christopher2ef63182010-04-02 21:54:27 +0000209// "Arrandale" along with corei3 and corei5
Jakob Stoklund Olesen1ac7e662013-03-26 22:19:12 +0000210def : ProcessorModel<"corei7", SandyBridgeModel,
211 [FeatureSSE42, FeatureCMPXCHG16B, FeatureSlowBTMem,
212 FeatureFastUAMem, FeaturePOPCNT, FeatureAES]>;
213
214def : ProcessorModel<"nehalem", SandyBridgeModel,
215 [FeatureSSE42, FeatureCMPXCHG16B, FeatureSlowBTMem,
216 FeatureFastUAMem, FeaturePOPCNT]>;
Eric Christopher2ef63182010-04-02 21:54:27 +0000217// Westmere is a similar machine to nehalem with some additional features.
218// Westmere is the corei3/i5/i7 path from nehalem to sandybridge
Jakob Stoklund Olesen1ac7e662013-03-26 22:19:12 +0000219def : ProcessorModel<"westmere", SandyBridgeModel,
220 [FeatureSSE42, FeatureCMPXCHG16B, FeatureSlowBTMem,
221 FeatureFastUAMem, FeaturePOPCNT, FeatureAES,
222 FeaturePCLMUL]>;
Benjamin Kramer874c5192011-10-10 19:35:07 +0000223// Sandy Bridge
Nate Begeman8b08f522010-12-10 00:26:57 +0000224// SSE is not listed here since llvm treats AVX as a reimplementation of SSE,
225// rather than a superset.
Jakob Stoklund Olesen1ac7e662013-03-26 22:19:12 +0000226def : ProcessorModel<"corei7-avx", SandyBridgeModel,
227 [FeatureAVX, FeatureCMPXCHG16B, FeatureFastUAMem,
228 FeaturePOPCNT, FeatureAES, FeaturePCLMUL]>;
Benjamin Kramer874c5192011-10-10 19:35:07 +0000229// Ivy Bridge
Jakob Stoklund Olesen1ac7e662013-03-26 22:19:12 +0000230def : ProcessorModel<"core-avx-i", SandyBridgeModel,
231 [FeatureAVX, FeatureCMPXCHG16B, FeatureFastUAMem,
232 FeaturePOPCNT, FeatureAES, FeaturePCLMUL, FeatureRDRAND,
233 FeatureF16C, FeatureFSGSBase]>;
Evan Chengff1beda2006-10-06 09:17:41 +0000234
Craig Topper3657fe42011-10-14 03:21:46 +0000235// Haswell
Nadav Roteme7b6a8a2013-03-28 22:34:46 +0000236def : ProcessorModel<"core-avx2", HaswellModel,
Jakob Stoklund Olesen1ac7e662013-03-26 22:19:12 +0000237 [FeatureAVX2, FeatureCMPXCHG16B, FeatureFastUAMem,
238 FeaturePOPCNT, FeatureAES, FeaturePCLMUL, FeatureRDRAND,
239 FeatureF16C, FeatureFSGSBase, FeatureMOVBE, FeatureLZCNT,
Michael Liaoe344ec92013-03-26 22:46:02 +0000240 FeatureBMI, FeatureBMI2, FeatureFMA, FeatureRTM,
241 FeatureHLE]>;
Craig Topper3657fe42011-10-14 03:21:46 +0000242
Elena Demikhovsky8cfb43f2013-07-24 11:02:47 +0000243// KNL
244// FIXME: define KNL model
245def : ProcessorModel<"knl", HaswellModel,
246 [FeatureAVX512, FeatureERI, FeatureCDI, FeaturePFI,
247 FeatureCMPXCHG16B, FeatureFastUAMem, FeaturePOPCNT,
248 FeatureAES, FeaturePCLMUL, FeatureRDRAND, FeatureF16C,
249 FeatureFSGSBase, FeatureMOVBE, FeatureLZCNT, FeatureBMI,
250 FeatureBMI2, FeatureFMA, FeatureRTM, FeatureHLE]>;
251
Evan Chengff1beda2006-10-06 09:17:41 +0000252def : Proc<"k6", [FeatureMMX]>;
Michael J. Spencer30088ba2011-04-15 00:32:41 +0000253def : Proc<"k6-2", [Feature3DNow]>;
254def : Proc<"k6-3", [Feature3DNow]>;
255def : Proc<"athlon", [Feature3DNowA, FeatureSlowBTMem]>;
256def : Proc<"athlon-tbird", [Feature3DNowA, FeatureSlowBTMem]>;
Evan Cheng4c91aa32009-01-02 05:35:45 +0000257def : Proc<"athlon-4", [FeatureSSE1, Feature3DNowA, FeatureSlowBTMem]>;
258def : Proc<"athlon-xp", [FeatureSSE1, Feature3DNowA, FeatureSlowBTMem]>;
259def : Proc<"athlon-mp", [FeatureSSE1, Feature3DNowA, FeatureSlowBTMem]>;
Dan Gohman74037512009-02-03 00:04:43 +0000260def : Proc<"k8", [FeatureSSE2, Feature3DNowA, Feature64Bit,
261 FeatureSlowBTMem]>;
262def : Proc<"opteron", [FeatureSSE2, Feature3DNowA, Feature64Bit,
263 FeatureSlowBTMem]>;
264def : Proc<"athlon64", [FeatureSSE2, Feature3DNowA, Feature64Bit,
265 FeatureSlowBTMem]>;
266def : Proc<"athlon-fx", [FeatureSSE2, Feature3DNowA, Feature64Bit,
267 FeatureSlowBTMem]>;
Eli Friedman5e570422011-08-26 21:21:21 +0000268def : Proc<"k8-sse3", [FeatureSSE3, Feature3DNowA, FeatureCMPXCHG16B,
Stefanus Du Toit96180b52009-05-26 21:04:35 +0000269 FeatureSlowBTMem]>;
Eli Friedman5e570422011-08-26 21:21:21 +0000270def : Proc<"opteron-sse3", [FeatureSSE3, Feature3DNowA, FeatureCMPXCHG16B,
Stefanus Du Toit96180b52009-05-26 21:04:35 +0000271 FeatureSlowBTMem]>;
Eli Friedman5e570422011-08-26 21:21:21 +0000272def : Proc<"athlon64-sse3", [FeatureSSE3, Feature3DNowA, FeatureCMPXCHG16B,
Stefanus Du Toit96180b52009-05-26 21:04:35 +0000273 FeatureSlowBTMem]>;
Craig Topperbae0e9e2012-05-01 06:54:48 +0000274def : Proc<"amdfam10", [FeatureSSE4A,
Benjamin Kramer5feb3da2011-11-30 15:48:16 +0000275 Feature3DNowA, FeatureCMPXCHG16B, FeatureLZCNT,
Craig Toppera060afb2011-12-29 18:47:31 +0000276 FeaturePOPCNT, FeatureSlowBTMem]>;
Benjamin Kramer077ae1d2012-01-10 11:50:02 +0000277// Bobcat
278def : Proc<"btver1", [FeatureSSSE3, FeatureSSE4A, FeatureCMPXCHG16B,
279 FeatureLZCNT, FeaturePOPCNT]>;
Benjamin Kramerb44c4272013-05-03 10:20:08 +0000280// Jaguar
281def : Proc<"btver2", [FeatureAVX, FeatureSSE4A, FeatureCMPXCHG16B,
282 FeatureAES, FeaturePCLMUL, FeatureBMI,
283 FeatureF16C, FeatureMOVBE, FeatureLZCNT,
284 FeaturePOPCNT]>;
Benjamin Kramer077ae1d2012-01-10 11:50:02 +0000285// Bulldozer
Craig Topperbae0e9e2012-05-01 06:54:48 +0000286def : Proc<"bdver1", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B,
Benjamin Kramera0396e42012-05-31 14:34:17 +0000287 FeatureAES, FeaturePCLMUL,
Craig Topperbae0e9e2012-05-01 06:54:48 +0000288 FeatureLZCNT, FeaturePOPCNT]>;
Benjamin Kramerb44c4272013-05-03 10:20:08 +0000289// Piledriver
Craig Topperbae0e9e2012-05-01 06:54:48 +0000290def : Proc<"bdver2", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B,
Benjamin Kramera0396e42012-05-31 14:34:17 +0000291 FeatureAES, FeaturePCLMUL,
Craig Topperbae0e9e2012-05-01 06:54:48 +0000292 FeatureF16C, FeatureLZCNT,
Anitha Boyapatiaf3e9832012-08-16 04:04:02 +0000293 FeaturePOPCNT, FeatureBMI, FeatureFMA]>;
Roman Divackyfd690092012-09-12 14:36:02 +0000294def : Proc<"geode", [Feature3DNowA]>;
Evan Chengff1beda2006-10-06 09:17:41 +0000295
296def : Proc<"winchip-c6", [FeatureMMX]>;
Michael J. Spencer30088ba2011-04-15 00:32:41 +0000297def : Proc<"winchip2", [Feature3DNow]>;
298def : Proc<"c3", [Feature3DNow]>;
Bill Wendling3fb7fdf2007-05-22 05:15:37 +0000299def : Proc<"c3-2", [FeatureSSE1]>;
Evan Chengff1beda2006-10-06 09:17:41 +0000300
301//===----------------------------------------------------------------------===//
Chris Lattner5da8e802003-08-03 15:47:49 +0000302// Register File Description
303//===----------------------------------------------------------------------===//
304
305include "X86RegisterInfo.td"
306
Chris Lattnera8c3cff2003-08-03 18:19:37 +0000307//===----------------------------------------------------------------------===//
308// Instruction Descriptions
309//===----------------------------------------------------------------------===//
310
Chris Lattner59a4a912003-08-03 21:54:21 +0000311include "X86InstrInfo.td"
312
Jakob Stoklund Olesenb93331f2010-04-05 03:10:20 +0000313def X86InstrInfo : InstrInfo;
Chris Lattnera8c3cff2003-08-03 18:19:37 +0000314
Chris Lattner5d00a0b2007-02-26 18:17:14 +0000315//===----------------------------------------------------------------------===//
316// Calling Conventions
317//===----------------------------------------------------------------------===//
318
319include "X86CallingConv.td"
320
321
322//===----------------------------------------------------------------------===//
Jim Grosbach4cf25f52010-10-30 13:48:28 +0000323// Assembly Parser
Chris Lattner5d00a0b2007-02-26 18:17:14 +0000324//===----------------------------------------------------------------------===//
325
Daniel Dunbar00331992009-07-29 00:02:19 +0000326def ATTAsmParser : AsmParser {
Devang Patel4a6e7782012-01-12 18:03:40 +0000327 string AsmParserClassName = "AsmParser";
Devang Patel85d684a2012-01-09 19:13:28 +0000328}
329
330def ATTAsmParserVariant : AsmParserVariant {
Daniel Dunbar00331992009-07-29 00:02:19 +0000331 int Variant = 0;
Daniel Dunbare4318712009-08-11 20:59:47 +0000332
Chad Rosier9f7a2212013-04-18 22:35:36 +0000333 // Variant name.
334 string Name = "att";
335
Daniel Dunbare4318712009-08-11 20:59:47 +0000336 // Discard comments in assembly strings.
337 string CommentDelimiter = "#";
338
339 // Recognize hard coded registers.
340 string RegisterPrefix = "%";
Daniel Dunbar00331992009-07-29 00:02:19 +0000341}
342
Devang Patel67bf992a2012-01-10 17:51:54 +0000343def IntelAsmParserVariant : AsmParserVariant {
344 int Variant = 1;
345
Chad Rosier9f7a2212013-04-18 22:35:36 +0000346 // Variant name.
347 string Name = "intel";
348
Devang Patel67bf992a2012-01-10 17:51:54 +0000349 // Discard comments in assembly strings.
350 string CommentDelimiter = ";";
351
352 // Recognize hard coded registers.
353 string RegisterPrefix = "";
354}
355
Jim Grosbach4cf25f52010-10-30 13:48:28 +0000356//===----------------------------------------------------------------------===//
357// Assembly Printers
358//===----------------------------------------------------------------------===//
359
Chris Lattner56832602004-10-03 20:36:57 +0000360// The X86 target supports two different syntaxes for emitting machine code.
361// This is controlled by the -x86-asm-syntax={att|intel}
362def ATTAsmWriter : AsmWriter {
Chris Lattner1cbd3de2009-09-13 19:30:11 +0000363 string AsmWriterClassName = "ATTInstPrinter";
Chris Lattner56832602004-10-03 20:36:57 +0000364 int Variant = 0;
Jim Grosbachc6e13f72010-09-30 23:40:25 +0000365 bit isMCAsmWriter = 1;
Chris Lattner56832602004-10-03 20:36:57 +0000366}
367def IntelAsmWriter : AsmWriter {
Chris Lattner13306a12009-09-20 07:47:59 +0000368 string AsmWriterClassName = "IntelInstPrinter";
Chris Lattner56832602004-10-03 20:36:57 +0000369 int Variant = 1;
Jim Grosbachc6e13f72010-09-30 23:40:25 +0000370 bit isMCAsmWriter = 1;
Chris Lattner56832602004-10-03 20:36:57 +0000371}
372
Chris Lattnera8c3cff2003-08-03 18:19:37 +0000373def X86 : Target {
Chris Lattnera8c3cff2003-08-03 18:19:37 +0000374 // Information about the instructions...
Chris Lattner25510802003-08-04 04:59:56 +0000375 let InstructionSet = X86InstrInfo;
Daniel Dunbar00331992009-07-29 00:02:19 +0000376 let AssemblyParsers = [ATTAsmParser];
Devang Patel67bf992a2012-01-10 17:51:54 +0000377 let AssemblyParserVariants = [ATTAsmParserVariant, IntelAsmParserVariant];
Chris Lattner56832602004-10-03 20:36:57 +0000378 let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter];
Chris Lattnera8c3cff2003-08-03 18:19:37 +0000379}