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">;
30 def FeatureIfCvt : SubtargetFeature <"disable-ifcvt",
33 "Disable the if conversion pass">;
35 def FeatureFP64 : SubtargetFeature<"fp64",
38 "Enable 64bit double precision operations">;
40 def Feature64BitPtr : SubtargetFeature<"64BitPtr",
43 "Specify if 64bit addressing should be used.">;
45 def Feature32on64BitPtr : SubtargetFeature<"64on32BitPtr",
48 "Specify if 64bit sized pointers with 32bit addressing should be used.">;
50 def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst",
53 "Older version of ALU instructions encoding.">;
55 def FeatureVertexCache : SubtargetFeature<"HasVertexCache",
58 "Specify use of dedicated vertex cache.">;
60 def FeatureCaymanISA : SubtargetFeature<"caymanISA",
65 def FeatureCFALUBug : SubtargetFeature<"cfalubug",
68 "GPU has CF_ALU bug">;
70 class SubtargetFeatureFetchLimit <string Value> :
71 SubtargetFeature <"fetch"#Value,
74 "Limit the maximum number of fetches in a clause to "#Value>;
76 def FeatureFetchLimit8 : SubtargetFeatureFetchLimit <"8">;
77 def FeatureFetchLimit16 : SubtargetFeatureFetchLimit <"16">;
79 class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature<
80 "wavefrontsize"#Value,
83 "The number of threads per wavefront">;
85 def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>;
86 def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>;
87 def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>;
89 class SubtargetFeatureGeneration <string Value,
90 list<SubtargetFeature> Implies> :
91 SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value,
92 Value#" GPU generation", Implies>;
94 def FeatureR600 : SubtargetFeatureGeneration<"R600",
95 [FeatureR600ALUInst, FeatureFetchLimit8]>;
97 def FeatureR700 : SubtargetFeatureGeneration<"R700",
98 [FeatureFetchLimit16]>;
100 def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN",
101 [FeatureFetchLimit16]>;
103 def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS",
104 [FeatureFetchLimit16, FeatureWavefrontSize64]>;
106 def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
107 [Feature64BitPtr, FeatureFP64]>;
109 def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS",
110 [Feature64BitPtr, FeatureFP64]>;
111 //===----------------------------------------------------------------------===//
113 def AMDGPUInstrInfo : InstrInfo {
114 let guessInstructionProperties = 1;
117 def AMDGPU : Target {
118 // Pull in Instruction Info:
119 let InstructionSet = AMDGPUInstrInfo;
122 // Dummy Instruction itineraries for pseudo instructions
123 def ALU_NULL : FuncUnit;
124 def NullALU : InstrItinClass;
126 //===----------------------------------------------------------------------===//
127 // Predicate helper class
128 //===----------------------------------------------------------------------===//
130 class PredicateControl {
131 Predicate SubtargetPredicate;
132 list<Predicate> OtherPredicates = [];
133 list<Predicate> Predicates = !listconcat([SubtargetPredicate],
137 // Include AMDGPU TD files
138 include "R600Schedule.td"
139 include "SISchedule.td"
140 include "Processors.td"
141 include "AMDGPUInstrInfo.td"
142 include "AMDGPUIntrinsics.td"
143 include "AMDGPURegisterInfo.td"
144 include "AMDGPUInstructions.td"
145 include "AMDGPUCallingConv.td"