Reformat the allocation-order arrays to a more conventional style.
[oota-llvm.git] / lib / Target / X86 / X86.td
1 //===- X86.td - Target definition file for the Intel X86 ---*- tablegen -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This is a target description file for the Intel i386 architecture, refered to
11 // here as the "X86" architecture.
12 //
13 //===----------------------------------------------------------------------===//
14
15 // Get the target-independent interfaces which we are implementing...
16 //
17 include "llvm/Target/Target.td"
18
19 //===----------------------------------------------------------------------===//
20 // X86 Subtarget features.
21 //===----------------------------------------------------------------------===//
22  
23 def FeatureMMX     : SubtargetFeature<"mmx","X86SSELevel", "MMX",
24                                       "Enable MMX instructions">;
25 def FeatureSSE1    : SubtargetFeature<"sse", "X86SSELevel", "SSE1",
26                                       "Enable SSE instructions",
27                                       [FeatureMMX]>;
28 def FeatureSSE2    : SubtargetFeature<"sse2", "X86SSELevel", "SSE2",
29                                       "Enable SSE2 instructions",
30                                       [FeatureSSE1]>;
31 def FeatureSSE3    : SubtargetFeature<"sse3", "X86SSELevel", "SSE3",
32                                       "Enable SSE3 instructions",
33                                       [FeatureSSE2]>;
34 def FeatureSSSE3   : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3",
35                                       "Enable SSSE3 instructions",
36                                       [FeatureSSE3]>;
37 def FeatureSSE41   : SubtargetFeature<"sse41", "X86SSELevel", "SSE41",
38                                       "Enable SSE 4.1 instructions",
39                                       [FeatureSSSE3]>;
40 def FeatureSSE42   : SubtargetFeature<"sse42", "X86SSELevel", "SSE42",
41                                       "Enable SSE 4.2 instructions",
42                                       [FeatureSSE41]>;
43 def Feature3DNow   : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow",
44                                       "Enable 3DNow! instructions">;
45 def Feature3DNowA  : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA",
46                                       "Enable 3DNow! Athlon instructions",
47                                       [Feature3DNow]>;
48 def Feature64Bit   : SubtargetFeature<"64bit", "HasX86_64", "true",
49                                       "Support 64-bit instructions",
50                                       [FeatureSSE2]>;
51 def FeatureSlowBTMem : SubtargetFeature<"slow-bt-mem", "IsBTMemSlow", "true",
52                                        "Bit testing of memory is slow">;
53
54 //===----------------------------------------------------------------------===//
55 // X86 processors supported.
56 //===----------------------------------------------------------------------===//
57
58 class Proc<string Name, list<SubtargetFeature> Features>
59  : Processor<Name, NoItineraries, Features>;
60
61 def : Proc<"generic",         []>;
62 def : Proc<"i386",            []>;
63 def : Proc<"i486",            []>;
64 def : Proc<"i586",            []>;
65 def : Proc<"pentium",         []>;
66 def : Proc<"pentium-mmx",     [FeatureMMX]>;
67 def : Proc<"i686",            []>;
68 def : Proc<"pentiumpro",      []>;
69 def : Proc<"pentium2",        [FeatureMMX]>;
70 def : Proc<"pentium3",        [FeatureSSE1]>;
71 def : Proc<"pentium-m",       [FeatureSSE2, FeatureSlowBTMem]>;
72 def : Proc<"pentium4",        [FeatureSSE2]>;
73 def : Proc<"x86-64",          [Feature64Bit, FeatureSlowBTMem]>;
74 def : Proc<"yonah",           [FeatureSSE3, FeatureSlowBTMem]>;
75 def : Proc<"prescott",        [FeatureSSE3, FeatureSlowBTMem]>;
76 def : Proc<"nocona",          [FeatureSSE3,   Feature64Bit, FeatureSlowBTMem]>;
77 def : Proc<"core2",           [FeatureSSSE3,  Feature64Bit, FeatureSlowBTMem]>;
78 def : Proc<"penryn",          [FeatureSSE41,  Feature64Bit, FeatureSlowBTMem]>;
79 def : Proc<"atom",            [FeatureSSE3,   Feature64Bit, FeatureSlowBTMem]>;
80 def : Proc<"corei7",          [FeatureSSE42,  Feature64Bit, FeatureSlowBTMem]>;
81
82 def : Proc<"k6",              [FeatureMMX]>;
83 def : Proc<"k6-2",            [FeatureMMX,    Feature3DNow]>;
84 def : Proc<"k6-3",            [FeatureMMX,    Feature3DNow]>;
85 def : Proc<"athlon",          [FeatureMMX,    Feature3DNowA, FeatureSlowBTMem]>;
86 def : Proc<"athlon-tbird",    [FeatureMMX,    Feature3DNowA, FeatureSlowBTMem]>;
87 def : Proc<"athlon-4",        [FeatureSSE1,   Feature3DNowA, FeatureSlowBTMem]>;
88 def : Proc<"athlon-xp",       [FeatureSSE1,   Feature3DNowA, FeatureSlowBTMem]>;
89 def : Proc<"athlon-mp",       [FeatureSSE1,   Feature3DNowA, FeatureSlowBTMem]>;
90 def : Proc<"k8",              [Feature3DNowA, Feature64Bit,  FeatureSlowBTMem]>;
91 def : Proc<"opteron",         [Feature3DNowA, Feature64Bit,  FeatureSlowBTMem]>;
92 def : Proc<"athlon64",        [Feature3DNowA, Feature64Bit,  FeatureSlowBTMem]>;
93 def : Proc<"athlon-fx",       [Feature3DNowA, Feature64Bit,  FeatureSlowBTMem]>;
94
95 def : Proc<"winchip-c6",      [FeatureMMX]>;
96 def : Proc<"winchip2",        [FeatureMMX, Feature3DNow]>;
97 def : Proc<"c3",              [FeatureMMX, Feature3DNow]>;
98 def : Proc<"c3-2",            [FeatureSSE1]>;
99
100 //===----------------------------------------------------------------------===//
101 // Register File Description
102 //===----------------------------------------------------------------------===//
103
104 include "X86RegisterInfo.td"
105
106 //===----------------------------------------------------------------------===//
107 // Instruction Descriptions
108 //===----------------------------------------------------------------------===//
109
110 include "X86InstrInfo.td"
111
112 def X86InstrInfo : InstrInfo {
113
114   // Define how we want to layout our TargetSpecific information field... This
115   // should be kept up-to-date with the fields in the X86InstrInfo.h file.
116   let TSFlagsFields = ["FormBits",
117                        "hasOpSizePrefix",
118                        "hasAdSizePrefix",
119                        "Prefix",
120                        "hasREX_WPrefix",
121                        "ImmTypeBits",
122                        "FPFormBits",
123                        "hasLockPrefix",
124                        "SegOvrBits",
125                        "Opcode"];
126   let TSFlagsShifts = [0,
127                        6,
128                        7,
129                        8,
130                        12,
131                        13,
132                        16,
133                        19,
134                        20,
135                        24];
136 }
137
138 //===----------------------------------------------------------------------===//
139 // Calling Conventions
140 //===----------------------------------------------------------------------===//
141
142 include "X86CallingConv.td"
143
144
145 //===----------------------------------------------------------------------===//
146 // Assembly Printers
147 //===----------------------------------------------------------------------===//
148
149 // The X86 target supports two different syntaxes for emitting machine code.
150 // This is controlled by the -x86-asm-syntax={att|intel}
151 def ATTAsmWriter : AsmWriter {
152   string AsmWriterClassName  = "ATTAsmPrinter";
153   int Variant = 0;
154 }
155 def IntelAsmWriter : AsmWriter {
156   string AsmWriterClassName  = "IntelAsmPrinter";
157   int Variant = 1;
158 }
159
160
161 def X86 : Target {
162   // Information about the instructions...
163   let InstructionSet = X86InstrInfo;
164
165   let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter];
166 }