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 double precision operations">;
40 def Feature64BitPtr : SubtargetFeature<"64BitPtr",
43 "Specify if 64-bit addressing should be used">;
45 def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst",
48 "Older version of ALU instructions encoding">;
50 def FeatureVertexCache : SubtargetFeature<"HasVertexCache",
53 "Specify use of dedicated vertex cache">;
55 def FeatureCaymanISA : SubtargetFeature<"caymanISA",
60 def FeatureCFALUBug : SubtargetFeature<"cfalubug",
63 "GPU has CF_ALU bug">;
65 class SubtargetFeatureFetchLimit <string Value> :
66 SubtargetFeature <"fetch"#Value,
69 "Limit the maximum number of fetches in a clause to "#Value>;
71 def FeatureFetchLimit8 : SubtargetFeatureFetchLimit <"8">;
72 def FeatureFetchLimit16 : SubtargetFeatureFetchLimit <"16">;
74 class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature<
75 "wavefrontsize"#Value,
78 "The number of threads per wavefront">;
80 def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>;
81 def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>;
82 def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>;
84 class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature<
85 "localmemorysize"#Value,
88 "The size of local memory in bytes">;
90 class SubtargetFeatureGeneration <string Value,
91 list<SubtargetFeature> Implies> :
92 SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value,
93 Value#" GPU generation", Implies>;
95 def FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>;
96 def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
97 def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
99 def FeatureR600 : SubtargetFeatureGeneration<"R600",
100 [FeatureR600ALUInst, FeatureFetchLimit8, FeatureLocalMemorySize0]>;
102 def FeatureR700 : SubtargetFeatureGeneration<"R700",
103 [FeatureFetchLimit16, FeatureLocalMemorySize0]>;
105 def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN",
106 [FeatureFetchLimit16, FeatureLocalMemorySize32768]>;
108 def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS",
109 [FeatureFetchLimit16, FeatureWavefrontSize64,
110 FeatureLocalMemorySize32768]
113 def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
114 [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize32768]>;
116 def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS",
117 [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize65536]>;
118 //===----------------------------------------------------------------------===//
120 def AMDGPUInstrInfo : InstrInfo {
121 let guessInstructionProperties = 1;
124 def AMDGPU : Target {
125 // Pull in Instruction Info:
126 let InstructionSet = AMDGPUInstrInfo;
129 // Dummy Instruction itineraries for pseudo instructions
130 def ALU_NULL : FuncUnit;
131 def NullALU : InstrItinClass;
133 //===----------------------------------------------------------------------===//
134 // Predicate helper class
135 //===----------------------------------------------------------------------===//
137 class PredicateControl {
138 Predicate SubtargetPredicate;
139 list<Predicate> OtherPredicates = [];
140 list<Predicate> Predicates = !listconcat([SubtargetPredicate],
144 // Include AMDGPU TD files
145 include "R600Schedule.td"
146 include "SISchedule.td"
147 include "Processors.td"
148 include "AMDGPUInstrInfo.td"
149 include "AMDGPUIntrinsics.td"
150 include "AMDGPURegisterInfo.td"
151 include "AMDGPUInstructions.td"
152 include "AMDGPUCallingConv.td"