llvm.org GIT mirror llvm / c93e472
AMDGPU: Refactor processor definition to use ISA version features Add missing ISA versions 7.0.2/8.0.4/8.1.0. to backend. Refactor processor definition to use ISA version features. Fixed ISA version for stoney. Based on Laurent Morichetti's patch. Differential Revision: https://reviews.llvm.org/D25919 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285210 91177308-0d34-0410-b5e6-96231b3b80d8 Yaxun Liu 3 years ago
5 changed file(s) with 134 addition(s) and 36 deletion(s). Raw diff Collapse all Expand all
115115 def FeatureLDSBankCount16 : SubtargetFeatureLDSBankCount<16>;
116116 def FeatureLDSBankCount32 : SubtargetFeatureLDSBankCount<32>;
117117
118 class SubtargetFeatureISAVersion
119 : SubtargetFeature <
120 "isaver"#Major#"."#Minor#"."#Stepping,
121 "IsaVersion",
122 "ISAVersion"#Major#"_"#Minor#"_"#Stepping,
123 "Instruction set version number"
124 >;
125
126 def FeatureISAVersion7_0_0 : SubtargetFeatureISAVersion <7,0,0>;
127 def FeatureISAVersion7_0_1 : SubtargetFeatureISAVersion <7,0,1>;
128 def FeatureISAVersion8_0_0 : SubtargetFeatureISAVersion <8,0,0>;
129 def FeatureISAVersion8_0_1 : SubtargetFeatureISAVersion <8,0,1>;
130 def FeatureISAVersion8_0_2 : SubtargetFeatureISAVersion <8,0,2>;
131 def FeatureISAVersion8_0_3 : SubtargetFeatureISAVersion <8,0,3>;
132
133118 class SubtargetFeatureLocalMemorySize : SubtargetFeature<
134119 "localmemorysize"#Value,
135120 "LocalMemorySize",
328313 FeatureSMemRealTime, FeatureVGPRIndexMode, FeatureMovrel
329314 ]
330315 >;
316
317 class SubtargetFeatureISAVersion
318 list Implies>
319 : SubtargetFeature <
320 "isaver"#Major#"."#Minor#"."#Stepping,
321 "IsaVersion",
322 "ISAVersion"#Major#"_"#Minor#"_"#Stepping,
323 "Instruction set version number",
324 Implies
325 >;
326
327 def FeatureISAVersion7_0_0 : SubtargetFeatureISAVersion <7,0,0,
328 [FeatureSeaIslands,
329 FeatureLDSBankCount32]>;
330
331 def FeatureISAVersion7_0_1 : SubtargetFeatureISAVersion <7,0,1,
332 [FeatureSeaIslands,
333 HalfRate64Ops,
334 FeatureLDSBankCount32,
335 FeatureFastFMAF32]>;
336
337 def FeatureISAVersion7_0_2 : SubtargetFeatureISAVersion <7,0,2,
338 [FeatureSeaIslands,
339 FeatureLDSBankCount16,
340 FeatureXNACK]>;
341
342 def FeatureISAVersion8_0_0 : SubtargetFeatureISAVersion <8,0,0,
343 [FeatureVolcanicIslands,
344 FeatureLDSBankCount32,
345 FeatureSGPRInitBug]>;
346
347 def FeatureISAVersion8_0_1 : SubtargetFeatureISAVersion <8,0,1,
348 [FeatureVolcanicIslands,
349 FeatureLDSBankCount32,
350 FeatureXNACK]>;
351
352 def FeatureISAVersion8_0_2 : SubtargetFeatureISAVersion <8,0,2,
353 [FeatureVolcanicIslands,
354 FeatureLDSBankCount32,
355 FeatureSGPRInitBug]>;
356
357 def FeatureISAVersion8_0_3 : SubtargetFeatureISAVersion <8,0,3,
358 [FeatureVolcanicIslands,
359 FeatureLDSBankCount32]>;
360
361 def FeatureISAVersion8_0_4 : SubtargetFeatureISAVersion <8,0,4,
362 [FeatureVolcanicIslands,
363 FeatureLDSBankCount32]>;
364
365 def FeatureISAVersion8_1_0 : SubtargetFeatureISAVersion <8,1,0,
366 [FeatureVolcanicIslands,
367 FeatureLDSBankCount16,
368 FeatureXNACK]>;
331369
332370 //===----------------------------------------------------------------------===//
333371 // Debugger related subtarget features.
5050 ISAVersion0_0_0,
5151 ISAVersion7_0_0,
5252 ISAVersion7_0_1,
53 ISAVersion7_0_2,
5354 ISAVersion8_0_0,
5455 ISAVersion8_0_1,
5556 ISAVersion8_0_2,
56 ISAVersion8_0_3
57 ISAVersion8_0_3,
58 ISAVersion8_0_4,
59 ISAVersion8_1_0,
5760 };
5861
5962 protected:
100100 //===----------------------------------------------------------------------===//
101101
102102 def : ProcessorModel<"bonaire", SIQuarterSpeedModel,
103 [FeatureSeaIslands, FeatureLDSBankCount32, FeatureISAVersion7_0_0]
103 [FeatureISAVersion7_0_0]
104104 >;
105105
106106 def : ProcessorModel<"kabini", SIQuarterSpeedModel,
107 [FeatureSeaIslands, FeatureLDSBankCount16]
107 [FeatureISAVersion7_0_2]
108108 >;
109109
110110 def : ProcessorModel<"kaveri", SIQuarterSpeedModel,
111 [FeatureSeaIslands, FeatureLDSBankCount32, FeatureISAVersion7_0_0]
111 [FeatureISAVersion7_0_0]
112112 >;
113113
114 def : ProcessorModel<"hawaii", SIFullSpeedModel,
115 [FeatureSeaIslands, FeatureFastFMAF32, HalfRate64Ops,
116 FeatureLDSBankCount32, FeatureISAVersion7_0_1]
114 def : ProcessorModel<"hawaii", SIFullSpeedModel,
115 [FeatureISAVersion7_0_1]
117116 >;
118117
119118 def : ProcessorModel<"mullins", SIQuarterSpeedModel,
120 [FeatureSeaIslands, FeatureLDSBankCount16]>;
119 [FeatureISAVersion7_0_2]>;
120
121 def : ProcessorModel<"gfx700", SIQuarterSpeedModel,
122 [FeatureISAVersion7_0_0]
123 >;
124
125 def : ProcessorModel<"gfx701", SIFullSpeedModel,
126 [FeatureISAVersion7_0_1]
127 >;
128
129 def : ProcessorModel<"gfx702", SIQuarterSpeedModel,
130 [FeatureISAVersion7_0_2]
131 >;
121132
122133 //===----------------------------------------------------------------------===//
123134 // Volcanic Islands
124135 //===----------------------------------------------------------------------===//
125136
126137 def : ProcessorModel<"tonga", SIQuarterSpeedModel,
127 [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_2,
128 FeatureLDSBankCount32]
138 [FeatureISAVersion8_0_2]
129139 >;
130140
131141 def : ProcessorModel<"iceland", SIQuarterSpeedModel,
132 [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_0,
133 FeatureLDSBankCount32]
142 [FeatureISAVersion8_0_0]
134143 >;
135144
136145 def : ProcessorModel<"carrizo", SIQuarterSpeedModel,
137 [FeatureVolcanicIslands, FeatureISAVersion8_0_1, FeatureLDSBankCount32, FeatureXNACK]
146 [FeatureISAVersion8_0_1]
138147 >;
139148
140 def : ProcessorModel<"fiji", SIQuarterSpeedModel,
141 [FeatureVolcanicIslands, FeatureISAVersion8_0_3, FeatureLDSBankCount32]
149 def : ProcessorModel<"fiji", SIQuarterSpeedModel,
150 [FeatureISAVersion8_0_3]
142151 >;
143152
144 def : ProcessorModel<"stoney", SIQuarterSpeedModel,
145 [FeatureVolcanicIslands, FeatureISAVersion8_0_1, FeatureLDSBankCount16, FeatureXNACK]
153 def : ProcessorModel<"stoney", SIQuarterSpeedModel,
154 [FeatureISAVersion8_1_0]
146155 >;
147156
148157 def : ProcessorModel<"polaris10", SIQuarterSpeedModel,
149 [FeatureVolcanicIslands, FeatureISAVersion8_0_3, FeatureLDSBankCount32]
158 [FeatureISAVersion8_0_3]
150159 >;
151160
152161 def : ProcessorModel<"polaris11", SIQuarterSpeedModel,
153 [FeatureVolcanicIslands, FeatureISAVersion8_0_3, FeatureLDSBankCount32]
162 [FeatureISAVersion8_0_3]
154163 >;
164
165 def : ProcessorModel<"gfx800", SIQuarterSpeedModel,
166 [FeatureISAVersion8_0_0]
167 >;
168
169 def : ProcessorModel<"gfx801", SIQuarterSpeedModel,
170 [FeatureISAVersion8_0_1]
171 >;
172
173 def : ProcessorModel<"gfx802", SIQuarterSpeedModel,
174 [FeatureISAVersion8_0_2]
175 >;
176
177 def : ProcessorModel<"gfx803", SIQuarterSpeedModel,
178 [FeatureISAVersion8_0_3]
179 >;
180
181 def : ProcessorModel<"gfx804", SIQuarterSpeedModel,
182 [FeatureISAVersion8_0_4]
183 >;
184
185 def : ProcessorModel<"gfx810", SIQuarterSpeedModel,
186 [FeatureISAVersion8_1_0]
187 >;
188
8686 if (Features.test(FeatureISAVersion7_0_1))
8787 return {7, 0, 1};
8888
89 if (Features.test(FeatureISAVersion7_0_2))
90 return {7, 0, 2};
91
8992 if (Features.test(FeatureISAVersion8_0_0))
9093 return {8, 0, 0};
9194
97100
98101 if (Features.test(FeatureISAVersion8_0_3))
99102 return {8, 0, 3};
103
104 if (Features.test(FeatureISAVersion8_0_4))
105 return {8, 0, 4};
106
107 if (Features.test(FeatureISAVersion8_1_0))
108 return {8, 1, 0};
100109
101110 return {0, 0, 0};
102111 }
None ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=HSA --check-prefix=HSA-CI %s
0 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx700 | FileCheck --check-prefix=HSA --check-prefix=HSA-CI700 %s
1 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx701 | FileCheck --check-prefix=HSA --check-prefix=HSA-CI701 %s
2 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx702 | FileCheck --check-prefix=HSA --check-prefix=HSA-CI702 %s
3 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=HSA --check-prefix=HSA-CI700 %s
14 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=carrizo | FileCheck --check-prefix=HSA --check-prefix=HSA-VI801 %s
25 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=tonga | FileCheck --check-prefix=HSA --check-prefix=HSA-VI802 %s
36 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=fiji | FileCheck --check-prefix=HSA --check-prefix=HSA-VI803 %s
47 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=polaris10 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI803 %s
58 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=polaris11 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI803 %s
9 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx800 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI800 %s
10 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx801 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI801 %s
11 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx802 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI802 %s
12 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx803 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI803 %s
13 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx804 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI804 %s
14 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx810 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI810 %s
615
716 ; HSA: .hsa_code_object_version 2,1
8 ; HSA-CI: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
17 ; HSA-CI700: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
18 ; HSA-CI701: .hsa_code_object_isa 7,0,1,"AMD","AMDGPU"
19 ; HSA-CI702: .hsa_code_object_isa 7,0,2,"AMD","AMDGPU"
20 ; HSA-VI800: .hsa_code_object_isa 8,0,0,"AMD","AMDGPU"
921 ; HSA-VI801: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU"
1022 ; HSA-VI802: .hsa_code_object_isa 8,0,2,"AMD","AMDGPU"
1123 ; HSA-VI803: .hsa_code_object_isa 8,0,3,"AMD","AMDGPU"
24 ; HSA-VI804: .hsa_code_object_isa 8,0,4,"AMD","AMDGPU"
25 ; HSA-VI810: .hsa_code_object_isa 8,1,0,"AMD","AMDGPU"