1 //===- X86.td - Target definition file for the Intel X86 arch ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This is a target description file for the Intel i386 architecture, refered to
11 // here as the "X86" architecture.
13 //===----------------------------------------------------------------------===//
15 // Get the target-independent interfaces which we are implementing...
17 include "../Target.td"
19 //===----------------------------------------------------------------------===//
20 // X86 Subtarget features.
21 //===----------------------------------------------------------------------===//
23 def FeatureMMX : SubtargetFeature<"mmx","X86SSELevel", "MMX",
24 "Enable MMX instructions">;
25 def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1",
26 "Enable SSE instructions",
28 def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", "SSE2",
29 "Enable SSE2 instructions",
31 def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3",
32 "Enable SSE3 instructions",
34 def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3",
35 "Enable SSSE3 instructions",
37 def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow",
38 "Enable 3DNow! instructions">;
39 def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA",
40 "Enable 3DNow! Athlon instructions",
42 def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true",
43 "Support 64-bit instructions",
46 //===----------------------------------------------------------------------===//
47 // X86 processors supported.
48 //===----------------------------------------------------------------------===//
50 class Proc<string Name, list<SubtargetFeature> Features>
51 : Processor<Name, NoItineraries, Features>;
53 def : Proc<"generic", []>;
54 def : Proc<"i386", []>;
55 def : Proc<"i486", []>;
56 def : Proc<"pentium", []>;
57 def : Proc<"pentium-mmx", [FeatureMMX]>;
58 def : Proc<"i686", []>;
59 def : Proc<"pentiumpro", []>;
60 def : Proc<"pentium2", [FeatureMMX]>;
61 def : Proc<"pentium3", [FeatureSSE1]>;
62 def : Proc<"pentium-m", [FeatureSSE2]>;
63 def : Proc<"pentium4", [FeatureSSE2]>;
64 def : Proc<"x86-64", [Feature64Bit]>;
65 def : Proc<"yonah", [FeatureSSE3]>;
66 def : Proc<"prescott", [FeatureSSE3]>;
67 def : Proc<"nocona", [FeatureSSE3]>;
68 def : Proc<"core2", [FeatureSSSE3]>;
70 def : Proc<"k6", [FeatureMMX]>;
71 def : Proc<"k6-2", [FeatureMMX, Feature3DNow]>;
72 def : Proc<"k6-3", [FeatureMMX, Feature3DNow]>;
73 def : Proc<"athlon", [FeatureMMX, Feature3DNowA]>;
74 def : Proc<"athlon-tbird", [FeatureMMX, Feature3DNowA]>;
75 def : Proc<"athlon-4", [FeatureSSE1, Feature3DNowA]>;
76 def : Proc<"athlon-xp", [FeatureSSE1, Feature3DNowA]>;
77 def : Proc<"athlon-mp", [FeatureSSE1, Feature3DNowA]>;
78 def : Proc<"k8", [Feature3DNowA, Feature64Bit]>;
79 def : Proc<"opteron", [Feature3DNowA, Feature64Bit]>;
80 def : Proc<"athlon64", [Feature3DNowA, Feature64Bit]>;
81 def : Proc<"athlon-fx", [Feature3DNowA, Feature64Bit]>;
83 def : Proc<"winchip-c6", [FeatureMMX]>;
84 def : Proc<"winchip2", [FeatureMMX, Feature3DNow]>;
85 def : Proc<"c3", [FeatureMMX, Feature3DNow]>;
86 def : Proc<"c3-2", [FeatureSSE1]>;
88 //===----------------------------------------------------------------------===//
89 // Register File Description
90 //===----------------------------------------------------------------------===//
92 include "X86RegisterInfo.td"
94 //===----------------------------------------------------------------------===//
95 // Instruction Descriptions
96 //===----------------------------------------------------------------------===//
98 include "X86InstrInfo.td"
100 def X86InstrInfo : InstrInfo {
102 // Define how we want to layout our TargetSpecific information field... This
103 // should be kept up-to-date with the fields in the X86InstrInfo.h file.
104 let TSFlagsFields = ["FormBits",
112 let TSFlagsShifts = [0,
122 //===----------------------------------------------------------------------===//
123 // Calling Conventions
124 //===----------------------------------------------------------------------===//
126 include "X86CallingConv.td"
129 //===----------------------------------------------------------------------===//
131 //===----------------------------------------------------------------------===//
133 // The X86 target supports two different syntaxes for emitting machine code.
134 // This is controlled by the -x86-asm-syntax={att|intel}
135 def ATTAsmWriter : AsmWriter {
136 string AsmWriterClassName = "ATTAsmPrinter";
139 def IntelAsmWriter : AsmWriter {
140 string AsmWriterClassName = "IntelAsmPrinter";
146 // Information about the instructions...
147 let InstructionSet = X86InstrInfo;
149 let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter];