1 //===-- AMDIL.td - AMDIL Tablegen files --*- 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 include "llvm/Target/Target.td"
12 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
18 def FeatureDumpCode : SubtargetFeature <"DumpCode",
21 "Dump MachineInstrs in the CodeEmitter">;
23 def FeatureIRStructurizer : SubtargetFeature <"disable-irstructurizer",
24 "EnableIRStructurizer",
26 "Disable IR Structurizer">;
28 def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca",
29 "EnablePromoteAlloca",
31 "Enable promote alloca pass">;
35 def FeatureIfCvt : SubtargetFeature <"disable-ifcvt",
38 "Disable the if conversion pass">;
40 def FeatureFP64 : SubtargetFeature<"fp64",
43 "Enable double precision operations">;
45 def FeatureFP64Denormals : SubtargetFeature<"fp64-denormals",
48 "Enable double precision denormal handling",
51 def FeatureFastFMAF32 : SubtargetFeature<"fast-fmaf",
54 "Assuming f32 fma is at least as fast as mul + add",
57 // Some instructions do not support denormals despite this flag. Using
58 // fp32 denormals also causes instructions to run at the double
59 // precision rate for the device.
60 def FeatureFP32Denormals : SubtargetFeature<"fp32-denormals",
63 "Enable single precision denormal handling">;
65 def Feature64BitPtr : SubtargetFeature<"64BitPtr",
68 "Specify if 64-bit addressing should be used">;
70 def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst",
73 "Older version of ALU instructions encoding">;
75 def FeatureVertexCache : SubtargetFeature<"HasVertexCache",
78 "Specify use of dedicated vertex cache">;
80 def FeatureCaymanISA : SubtargetFeature<"caymanISA",
85 def FeatureCFALUBug : SubtargetFeature<"cfalubug",
88 "GPU has CF_ALU bug">;
90 // XXX - This should probably be removed once enabled by default
91 def FeatureEnableLoadStoreOpt : SubtargetFeature <"load-store-opt",
94 "Enable SI load/store optimizer pass">;
96 def FeatureFlatAddressSpace : SubtargetFeature<"flat-address-space",
99 "Support flat address space">;
101 def FeatureVGPRSpilling : SubtargetFeature<"vgpr-spilling",
102 "EnableVGPRSpilling",
104 "Enable spilling of VGPRs to scratch memory">;
106 class SubtargetFeatureFetchLimit <string Value> :
107 SubtargetFeature <"fetch"#Value,
110 "Limit the maximum number of fetches in a clause to "#Value>;
112 def FeatureFetchLimit8 : SubtargetFeatureFetchLimit <"8">;
113 def FeatureFetchLimit16 : SubtargetFeatureFetchLimit <"16">;
115 class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature<
116 "wavefrontsize"#Value,
118 !cast<string>(Value),
119 "The number of threads per wavefront">;
121 def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>;
122 def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>;
123 def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>;
125 class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature<
126 "localmemorysize"#Value,
128 !cast<string>(Value),
129 "The size of local memory in bytes">;
131 class SubtargetFeatureGeneration <string Value,
132 list<SubtargetFeature> Implies> :
133 SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value,
134 Value#" GPU generation", Implies>;
136 def FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>;
137 def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
138 def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
140 def FeatureR600 : SubtargetFeatureGeneration<"R600",
141 [FeatureR600ALUInst, FeatureFetchLimit8, FeatureLocalMemorySize0]>;
143 def FeatureR700 : SubtargetFeatureGeneration<"R700",
144 [FeatureFetchLimit16, FeatureLocalMemorySize0]>;
146 def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN",
147 [FeatureFetchLimit16, FeatureLocalMemorySize32768]>;
149 def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS",
150 [FeatureFetchLimit16, FeatureWavefrontSize64,
151 FeatureLocalMemorySize32768]
154 def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
155 [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize32768,
156 FeatureWavefrontSize64]>;
158 def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS",
159 [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize65536,
160 FeatureWavefrontSize64, FeatureFlatAddressSpace]>;
162 def FeatureVolcanicIslands : SubtargetFeatureGeneration<"VOLCANIC_ISLANDS",
163 [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize65536,
164 FeatureWavefrontSize64, FeatureFlatAddressSpace]>;
166 //===----------------------------------------------------------------------===//
168 def AMDGPUInstrInfo : InstrInfo {
169 let guessInstructionProperties = 1;
170 let noNamedPositionallyEncodedOperands = 1;
173 def AMDGPUAsmParser : AsmParser {
174 // Some of the R600 registers have the same name, so this crashes.
175 // For example T0_XYZW and T0_XY both have the asm name T0.
176 let ShouldEmitMatchRegisterName = 0;
179 def AMDGPU : Target {
180 // Pull in Instruction Info:
181 let InstructionSet = AMDGPUInstrInfo;
182 let AssemblyParsers = [AMDGPUAsmParser];
185 // Dummy Instruction itineraries for pseudo instructions
186 def ALU_NULL : FuncUnit;
187 def NullALU : InstrItinClass;
189 //===----------------------------------------------------------------------===//
190 // Predicate helper class
191 //===----------------------------------------------------------------------===//
193 class PredicateControl {
194 Predicate SubtargetPredicate;
195 list<Predicate> OtherPredicates = [];
196 list<Predicate> Predicates = !listconcat([SubtargetPredicate],
200 // Include AMDGPU TD files
201 include "R600Schedule.td"
202 include "SISchedule.td"
203 include "Processors.td"
204 include "AMDGPUInstrInfo.td"
205 include "AMDGPUIntrinsics.td"
206 include "AMDGPURegisterInfo.td"
207 include "AMDGPUInstructions.td"
208 include "AMDGPUCallingConv.td"