blob: 8ad0bc08ac57f9b53fc0b4a3032a4b65871341a9 [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]>;
Benjamin Kramera0396e42012-05-31 14:34:17 +000089def FeaturePCLMUL : SubtargetFeature<"pclmul", "HasPCLMUL", "true",
90 "Enable packed carry-less multiplication instructions",
Craig Topper29dd1482012-05-01 05:28:32 +000091 [FeatureSSE2]>;
Craig Topper79dbb0c2012-06-03 18:58:46 +000092def FeatureFMA : SubtargetFeature<"fma", "HasFMA", "true",
Craig Toppere1bd0512011-12-29 19:46:19 +000093 "Enable three-operand fused multiple-add",
94 [FeatureAVX]>;
David Greene8f6f72c2009-06-26 22:46:54 +000095def FeatureFMA4 : SubtargetFeature<"fma4", "HasFMA4", "true",
Craig Toppera5d1fc22011-12-30 07:16:00 +000096 "Enable four-operand fused multiple-add",
Craig Topperbae0e9e2012-05-01 06:54:48 +000097 [FeatureAVX, FeatureSSE4A]>;
Craig Toppera5d1fc22011-12-30 07:16:00 +000098def FeatureXOP : SubtargetFeature<"xop", "HasXOP", "true",
Craig Topper43518cc2012-05-01 05:41:41 +000099 "Enable XOP instructions",
Anitha Boyapatiaf3e9832012-08-16 04:04:02 +0000100 [FeatureFMA4]>;
David Greene206351a2010-01-11 16:29:42 +0000101def FeatureVectorUAMem : SubtargetFeature<"vector-unaligned-mem",
102 "HasVectorUAMem", "true",
103 "Allow unaligned memory operands on vector/SIMD instructions">;
Eric Christopher2ef63182010-04-02 21:54:27 +0000104def FeatureAES : SubtargetFeature<"aes", "HasAES", "true",
Craig Topper29dd1482012-05-01 05:28:32 +0000105 "Enable AES instructions",
106 [FeatureSSE2]>;
Craig Topper786bdb92011-10-03 17:28:23 +0000107def FeatureMOVBE : SubtargetFeature<"movbe", "HasMOVBE", "true",
108 "Support MOVBE instruction">;
109def FeatureRDRAND : SubtargetFeature<"rdrand", "HasRDRAND", "true",
110 "Support RDRAND instruction">;
Craig Topperfe9179f2011-10-09 07:31:39 +0000111def FeatureF16C : SubtargetFeature<"f16c", "HasF16C", "true",
112 "Support 16-bit floating point conversion instructions">;
Craig Topper228d9132011-10-30 19:57:21 +0000113def FeatureFSGSBase : SubtargetFeature<"fsgsbase", "HasFSGSBase", "true",
114 "Support FS/GS Base instructions">;
Craig Topper271064e2011-10-11 06:44:02 +0000115def FeatureLZCNT : SubtargetFeature<"lzcnt", "HasLZCNT", "true",
116 "Support LZCNT instruction">;
Craig Topper3657fe42011-10-14 03:21:46 +0000117def FeatureBMI : SubtargetFeature<"bmi", "HasBMI", "true",
118 "Support BMI instructions">;
Craig Topperaea148c2011-10-16 07:55:05 +0000119def FeatureBMI2 : SubtargetFeature<"bmi2", "HasBMI2", "true",
120 "Support BMI2 instructions">;
Michael Liao73cffdd2012-11-08 07:28:54 +0000121def FeatureRTM : SubtargetFeature<"rtm", "HasRTM", "true",
122 "Support RTM instructions">;
Evan Cheng1b81fdd2012-02-07 22:50:41 +0000123def FeatureLeaForSP : SubtargetFeature<"lea-sp", "UseLeaForSP", "true",
124 "Use LEA for adjusting the stack pointer">;
Preston Gurdcdf540d2012-09-04 18:22:17 +0000125def FeatureSlowDivide : SubtargetFeature<"idiv-to-divb",
Craig Topper30387812012-10-03 03:56:12 +0000126 "HasSlowDivide", "true",
127 "Use small divide for positive values less than 256">;
David Greene8f6f72c2009-06-26 22:46:54 +0000128
Evan Chengff1beda2006-10-06 09:17:41 +0000129//===----------------------------------------------------------------------===//
130// X86 processors supported.
131//===----------------------------------------------------------------------===//
132
Andrew Trick8523b162012-02-01 23:20:51 +0000133include "X86Schedule.td"
134
135def ProcIntelAtom : SubtargetFeature<"atom", "X86ProcFamily", "IntelAtom",
136 "Intel Atom processors">;
137
Evan Chengff1beda2006-10-06 09:17:41 +0000138class Proc<string Name, list<SubtargetFeature> Features>
Andrew Trick87255e32012-07-07 04:00:00 +0000139 : ProcessorModel<Name, GenericModel, Features>;
Andrew Trick8523b162012-02-01 23:20:51 +0000140
141class AtomProc<string Name, list<SubtargetFeature> Features>
Andrew Trick87255e32012-07-07 04:00:00 +0000142 : ProcessorModel<Name, AtomModel, Features>;
Evan Chengff1beda2006-10-06 09:17:41 +0000143
144def : Proc<"generic", []>;
145def : Proc<"i386", []>;
146def : Proc<"i486", []>;
Dale Johannesen28106752008-10-14 22:06:33 +0000147def : Proc<"i586", []>;
Evan Chengff1beda2006-10-06 09:17:41 +0000148def : Proc<"pentium", []>;
149def : Proc<"pentium-mmx", [FeatureMMX]>;
150def : Proc<"i686", []>;
Chris Lattnercc8c5812009-09-02 05:53:04 +0000151def : Proc<"pentiumpro", [FeatureCMOV]>;
152def : Proc<"pentium2", [FeatureMMX, FeatureCMOV]>;
Bill Wendling3fb7fdf2007-05-22 05:15:37 +0000153def : Proc<"pentium3", [FeatureSSE1]>;
Michael J. Spencer99737382011-05-03 03:42:50 +0000154def : Proc<"pentium3m", [FeatureSSE1, FeatureSlowBTMem]>;
Evan Cheng4c91aa32009-01-02 05:35:45 +0000155def : Proc<"pentium-m", [FeatureSSE2, FeatureSlowBTMem]>;
Bill Wendling3fb7fdf2007-05-22 05:15:37 +0000156def : Proc<"pentium4", [FeatureSSE2]>;
Michael J. Spencer99737382011-05-03 03:42:50 +0000157def : Proc<"pentium4m", [FeatureSSE2, FeatureSlowBTMem]>;
Eli Friedman5e570422011-08-26 21:21:21 +0000158def : Proc<"x86-64", [FeatureSSE2, Feature64Bit, FeatureSlowBTMem]>;
Evan Cheng71d7eaa2009-12-22 17:47:23 +0000159def : Proc<"yonah", [FeatureSSE3, FeatureSlowBTMem]>;
160def : Proc<"prescott", [FeatureSSE3, FeatureSlowBTMem]>;
Eli Friedman5e570422011-08-26 21:21:21 +0000161def : Proc<"nocona", [FeatureSSE3, FeatureCMPXCHG16B,
162 FeatureSlowBTMem]>;
163def : Proc<"core2", [FeatureSSSE3, FeatureCMPXCHG16B,
164 FeatureSlowBTMem]>;
165def : Proc<"penryn", [FeatureSSE41, FeatureCMPXCHG16B,
166 FeatureSlowBTMem]>;
Michael Liaoc6696b02012-10-25 07:06:48 +0000167def : AtomProc<"atom", [ProcIntelAtom, FeatureSSSE3, FeatureCMPXCHG16B,
Preston Gurdcdf540d2012-09-04 18:22:17 +0000168 FeatureMOVBE, FeatureSlowBTMem, FeatureLeaForSP,
169 FeatureSlowDivide]>;
Eric Christopher2ef63182010-04-02 21:54:27 +0000170// "Arrandale" along with corei3 and corei5
Eli Friedman5e570422011-08-26 21:21:21 +0000171def : Proc<"corei7", [FeatureSSE42, FeatureCMPXCHG16B,
Craig Toppera060afb2011-12-29 18:47:31 +0000172 FeatureSlowBTMem, FeatureFastUAMem,
173 FeaturePOPCNT, FeatureAES]>;
Eli Friedman5e570422011-08-26 21:21:21 +0000174def : Proc<"nehalem", [FeatureSSE42, FeatureCMPXCHG16B,
Craig Toppera060afb2011-12-29 18:47:31 +0000175 FeatureSlowBTMem, FeatureFastUAMem,
176 FeaturePOPCNT]>;
Eric Christopher2ef63182010-04-02 21:54:27 +0000177// Westmere is a similar machine to nehalem with some additional features.
178// Westmere is the corei3/i5/i7 path from nehalem to sandybridge
Eli Friedman5e570422011-08-26 21:21:21 +0000179def : Proc<"westmere", [FeatureSSE42, FeatureCMPXCHG16B,
Craig Toppera060afb2011-12-29 18:47:31 +0000180 FeatureSlowBTMem, FeatureFastUAMem,
Benjamin Kramera0396e42012-05-31 14:34:17 +0000181 FeaturePOPCNT, FeatureAES, FeaturePCLMUL]>;
Benjamin Kramer874c5192011-10-10 19:35:07 +0000182// Sandy Bridge
Nate Begeman8b08f522010-12-10 00:26:57 +0000183// SSE is not listed here since llvm treats AVX as a reimplementation of SSE,
184// rather than a superset.
Craig Topper08ccfbe2012-04-26 06:40:15 +0000185def : Proc<"corei7-avx", [FeatureAVX, FeatureCMPXCHG16B, FeaturePOPCNT,
Benjamin Kramera0396e42012-05-31 14:34:17 +0000186 FeatureAES, FeaturePCLMUL]>;
Benjamin Kramer874c5192011-10-10 19:35:07 +0000187// Ivy Bridge
Craig Topper08ccfbe2012-04-26 06:40:15 +0000188def : Proc<"core-avx-i", [FeatureAVX, FeatureCMPXCHG16B, FeaturePOPCNT,
Benjamin Kramera0396e42012-05-31 14:34:17 +0000189 FeatureAES, FeaturePCLMUL,
Craig Topper228d9132011-10-30 19:57:21 +0000190 FeatureRDRAND, FeatureF16C, FeatureFSGSBase]>;
Evan Chengff1beda2006-10-06 09:17:41 +0000191
Craig Topper3657fe42011-10-14 03:21:46 +0000192// Haswell
Craig Topper08ccfbe2012-04-26 06:40:15 +0000193def : Proc<"core-avx2", [FeatureAVX2, FeatureCMPXCHG16B, FeaturePOPCNT,
Benjamin Kramera0396e42012-05-31 14:34:17 +0000194 FeatureAES, FeaturePCLMUL, FeatureRDRAND,
Craig Toppere1bd0512011-12-29 19:46:19 +0000195 FeatureF16C, FeatureFSGSBase,
Craig Toppera060afb2011-12-29 18:47:31 +0000196 FeatureMOVBE, FeatureLZCNT, FeatureBMI,
Michael Liao73cffdd2012-11-08 07:28:54 +0000197 FeatureBMI2, FeatureFMA,
198 FeatureRTM]>;
Craig Topper3657fe42011-10-14 03:21:46 +0000199
Evan Chengff1beda2006-10-06 09:17:41 +0000200def : Proc<"k6", [FeatureMMX]>;
Michael J. Spencer30088ba2011-04-15 00:32:41 +0000201def : Proc<"k6-2", [Feature3DNow]>;
202def : Proc<"k6-3", [Feature3DNow]>;
203def : Proc<"athlon", [Feature3DNowA, FeatureSlowBTMem]>;
204def : Proc<"athlon-tbird", [Feature3DNowA, FeatureSlowBTMem]>;
Evan Cheng4c91aa32009-01-02 05:35:45 +0000205def : Proc<"athlon-4", [FeatureSSE1, Feature3DNowA, FeatureSlowBTMem]>;
206def : Proc<"athlon-xp", [FeatureSSE1, Feature3DNowA, FeatureSlowBTMem]>;
207def : Proc<"athlon-mp", [FeatureSSE1, Feature3DNowA, FeatureSlowBTMem]>;
Dan Gohman74037512009-02-03 00:04:43 +0000208def : Proc<"k8", [FeatureSSE2, Feature3DNowA, Feature64Bit,
209 FeatureSlowBTMem]>;
210def : Proc<"opteron", [FeatureSSE2, Feature3DNowA, Feature64Bit,
211 FeatureSlowBTMem]>;
212def : Proc<"athlon64", [FeatureSSE2, Feature3DNowA, Feature64Bit,
213 FeatureSlowBTMem]>;
214def : Proc<"athlon-fx", [FeatureSSE2, Feature3DNowA, Feature64Bit,
215 FeatureSlowBTMem]>;
Eli Friedman5e570422011-08-26 21:21:21 +0000216def : Proc<"k8-sse3", [FeatureSSE3, Feature3DNowA, FeatureCMPXCHG16B,
Stefanus Du Toit96180b52009-05-26 21:04:35 +0000217 FeatureSlowBTMem]>;
Eli Friedman5e570422011-08-26 21:21:21 +0000218def : Proc<"opteron-sse3", [FeatureSSE3, Feature3DNowA, FeatureCMPXCHG16B,
Stefanus Du Toit96180b52009-05-26 21:04:35 +0000219 FeatureSlowBTMem]>;
Eli Friedman5e570422011-08-26 21:21:21 +0000220def : Proc<"athlon64-sse3", [FeatureSSE3, Feature3DNowA, FeatureCMPXCHG16B,
Stefanus Du Toit96180b52009-05-26 21:04:35 +0000221 FeatureSlowBTMem]>;
Craig Topperbae0e9e2012-05-01 06:54:48 +0000222def : Proc<"amdfam10", [FeatureSSE4A,
Benjamin Kramer5feb3da2011-11-30 15:48:16 +0000223 Feature3DNowA, FeatureCMPXCHG16B, FeatureLZCNT,
Craig Toppera060afb2011-12-29 18:47:31 +0000224 FeaturePOPCNT, FeatureSlowBTMem]>;
Benjamin Kramer077ae1d2012-01-10 11:50:02 +0000225// Bobcat
226def : Proc<"btver1", [FeatureSSSE3, FeatureSSE4A, FeatureCMPXCHG16B,
227 FeatureLZCNT, FeaturePOPCNT]>;
Benjamin Kramer077ae1d2012-01-10 11:50:02 +0000228// Bulldozer
Craig Topperbae0e9e2012-05-01 06:54:48 +0000229def : Proc<"bdver1", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B,
Benjamin Kramera0396e42012-05-31 14:34:17 +0000230 FeatureAES, FeaturePCLMUL,
Craig Topperbae0e9e2012-05-01 06:54:48 +0000231 FeatureLZCNT, FeaturePOPCNT]>;
Benjamin Kramer077ae1d2012-01-10 11:50:02 +0000232// Enhanced Bulldozer
Craig Topperbae0e9e2012-05-01 06:54:48 +0000233def : Proc<"bdver2", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B,
Benjamin Kramera0396e42012-05-31 14:34:17 +0000234 FeatureAES, FeaturePCLMUL,
Craig Topperbae0e9e2012-05-01 06:54:48 +0000235 FeatureF16C, FeatureLZCNT,
Anitha Boyapatiaf3e9832012-08-16 04:04:02 +0000236 FeaturePOPCNT, FeatureBMI, FeatureFMA]>;
Roman Divackyfd690092012-09-12 14:36:02 +0000237def : Proc<"geode", [Feature3DNowA]>;
Evan Chengff1beda2006-10-06 09:17:41 +0000238
239def : Proc<"winchip-c6", [FeatureMMX]>;
Michael J. Spencer30088ba2011-04-15 00:32:41 +0000240def : Proc<"winchip2", [Feature3DNow]>;
241def : Proc<"c3", [Feature3DNow]>;
Bill Wendling3fb7fdf2007-05-22 05:15:37 +0000242def : Proc<"c3-2", [FeatureSSE1]>;
Evan Chengff1beda2006-10-06 09:17:41 +0000243
244//===----------------------------------------------------------------------===//
Chris Lattner5da8e802003-08-03 15:47:49 +0000245// Register File Description
246//===----------------------------------------------------------------------===//
247
248include "X86RegisterInfo.td"
249
Chris Lattnera8c3cff2003-08-03 18:19:37 +0000250//===----------------------------------------------------------------------===//
251// Instruction Descriptions
252//===----------------------------------------------------------------------===//
253
Chris Lattner59a4a912003-08-03 21:54:21 +0000254include "X86InstrInfo.td"
255
Jakob Stoklund Olesenb93331f2010-04-05 03:10:20 +0000256def X86InstrInfo : InstrInfo;
Chris Lattnera8c3cff2003-08-03 18:19:37 +0000257
Chris Lattner5d00a0b2007-02-26 18:17:14 +0000258//===----------------------------------------------------------------------===//
259// Calling Conventions
260//===----------------------------------------------------------------------===//
261
262include "X86CallingConv.td"
263
264
265//===----------------------------------------------------------------------===//
Jim Grosbach4cf25f52010-10-30 13:48:28 +0000266// Assembly Parser
Chris Lattner5d00a0b2007-02-26 18:17:14 +0000267//===----------------------------------------------------------------------===//
268
Daniel Dunbar00331992009-07-29 00:02:19 +0000269def ATTAsmParser : AsmParser {
Devang Patel4a6e7782012-01-12 18:03:40 +0000270 string AsmParserClassName = "AsmParser";
Devang Patel85d684a2012-01-09 19:13:28 +0000271}
272
273def ATTAsmParserVariant : AsmParserVariant {
Daniel Dunbar00331992009-07-29 00:02:19 +0000274 int Variant = 0;
Daniel Dunbare4318712009-08-11 20:59:47 +0000275
276 // Discard comments in assembly strings.
277 string CommentDelimiter = "#";
278
279 // Recognize hard coded registers.
280 string RegisterPrefix = "%";
Daniel Dunbar00331992009-07-29 00:02:19 +0000281}
282
Devang Patel67bf992a2012-01-10 17:51:54 +0000283def IntelAsmParserVariant : AsmParserVariant {
284 int Variant = 1;
285
286 // Discard comments in assembly strings.
287 string CommentDelimiter = ";";
288
289 // Recognize hard coded registers.
290 string RegisterPrefix = "";
291}
292
Jim Grosbach4cf25f52010-10-30 13:48:28 +0000293//===----------------------------------------------------------------------===//
294// Assembly Printers
295//===----------------------------------------------------------------------===//
296
Chris Lattner56832602004-10-03 20:36:57 +0000297// The X86 target supports two different syntaxes for emitting machine code.
298// This is controlled by the -x86-asm-syntax={att|intel}
299def ATTAsmWriter : AsmWriter {
Chris Lattner1cbd3de2009-09-13 19:30:11 +0000300 string AsmWriterClassName = "ATTInstPrinter";
Chris Lattner56832602004-10-03 20:36:57 +0000301 int Variant = 0;
Jim Grosbachc6e13f72010-09-30 23:40:25 +0000302 bit isMCAsmWriter = 1;
Chris Lattner56832602004-10-03 20:36:57 +0000303}
304def IntelAsmWriter : AsmWriter {
Chris Lattner13306a12009-09-20 07:47:59 +0000305 string AsmWriterClassName = "IntelInstPrinter";
Chris Lattner56832602004-10-03 20:36:57 +0000306 int Variant = 1;
Jim Grosbachc6e13f72010-09-30 23:40:25 +0000307 bit isMCAsmWriter = 1;
Chris Lattner56832602004-10-03 20:36:57 +0000308}
309
Chris Lattnera8c3cff2003-08-03 18:19:37 +0000310def X86 : Target {
Chris Lattnera8c3cff2003-08-03 18:19:37 +0000311 // Information about the instructions...
Chris Lattner25510802003-08-04 04:59:56 +0000312 let InstructionSet = X86InstrInfo;
Daniel Dunbar00331992009-07-29 00:02:19 +0000313 let AssemblyParsers = [ATTAsmParser];
Devang Patel67bf992a2012-01-10 17:51:54 +0000314 let AssemblyParserVariants = [ATTAsmParserVariant, IntelAsmParserVariant];
Chris Lattner56832602004-10-03 20:36:57 +0000315 let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter];
Chris Lattnera8c3cff2003-08-03 18:19:37 +0000316}