llvm.org GIT mirror llvm / 2d0aa2e
AMDGPU : Fix ISA Version Definitions. Differential Revision: http://reviews.llvm.org/D28531 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305137 91177308-0d34-0410-b5e6-96231b3b80d8 Wei Ding 2 years ago
6 changed file(s) with 127 addition(s) and 42 deletion(s). Raw diff Collapse all Expand all
446446 Implies
447447 >;
448448
449 def FeatureISAVersion6_0_0 : SubtargetFeatureISAVersion <6,0,0,
450 [FeatureSouthernIslands,
451 FeatureFastFMAF32,
452 HalfRate64Ops,
453 FeatureLDSBankCount32]>;
454
455 def FeatureISAVersion6_0_1 : SubtargetFeatureISAVersion <6,0,1,
456 [FeatureSouthernIslands,
457 FeatureLDSBankCount32]>;
458
449459 def FeatureISAVersion7_0_0 : SubtargetFeatureISAVersion <7,0,0,
450460 [FeatureSeaIslands,
451461 FeatureLDSBankCount32]>;
460470 [FeatureSeaIslands,
461471 FeatureLDSBankCount16]>;
462472
473 def FeatureISAVersion7_0_3 : SubtargetFeatureISAVersion <7,0,3,
474 [FeatureSeaIslands,
475 FeatureLDSBankCount16]>;
476
463477 def FeatureISAVersion8_0_0 : SubtargetFeatureISAVersion <8,0,0,
464478 [FeatureVolcanicIslands,
465479 FeatureLDSBankCount32,
488502 FeatureLDSBankCount16,
489503 FeatureXNACK]>;
490504
491 def FeatureISAVersion9_0_0 : SubtargetFeatureISAVersion <9,0,0,[]>;
492 def FeatureISAVersion9_0_1 : SubtargetFeatureISAVersion <9,0,1,[]>;
505 def FeatureISAVersion9_0_0 : SubtargetFeatureISAVersion <9,0,0,
506 [FeatureGFX9,
507 FeatureLDSBankCount32]>;
508
509 def FeatureISAVersion9_0_1 : SubtargetFeatureISAVersion <9,0,1,
510 [FeatureGFX9,
511 FeatureLDSBankCount32,
512 FeatureXNACK]>;
513
514 def FeatureISAVersion9_0_2 : SubtargetFeatureISAVersion <9,0,2,
515 [FeatureGFX9,
516 FeatureLDSBankCount32]>;
517
518 def FeatureISAVersion9_0_3 : SubtargetFeatureISAVersion <9,0,3,
519 [FeatureGFX9,
520 FeatureLDSBankCount32,
521 FeatureXNACK]>;
493522
494523 //===----------------------------------------------------------------------===//
495524 // Debugger related subtarget features.
5656
5757 enum {
5858 ISAVersion0_0_0,
59 ISAVersion6_0_0,
60 ISAVersion6_0_1,
5961 ISAVersion7_0_0,
6062 ISAVersion7_0_1,
6163 ISAVersion7_0_2,
64 ISAVersion7_0_3,
6265 ISAVersion8_0_0,
6366 ISAVersion8_0_1,
6467 ISAVersion8_0_2,
6669 ISAVersion8_0_4,
6770 ISAVersion8_1_0,
6871 ISAVersion9_0_0,
69 ISAVersion9_0_1
72 ISAVersion9_0_1,
73 ISAVersion9_0_2,
74 ISAVersion9_0_3
7075 };
7176
7277 enum TrapHandlerAbi {
7979 // Southern Islands
8080 //===----------------------------------------------------------------------===//
8181
82 def : ProcessorModel<"SI", SIFullSpeedModel,
83 [FeatureSouthernIslands, FeatureFastFMAF32, HalfRate64Ops]
84 >;
85
86 def : ProcessorModel<"tahiti", SIFullSpeedModel,
87 [FeatureSouthernIslands, FeatureFastFMAF32, HalfRate64Ops]
88 >;
89
90 def : ProcessorModel<"pitcairn", SIQuarterSpeedModel, [FeatureSouthernIslands]>;
91
92 def : ProcessorModel<"verde", SIQuarterSpeedModel, [FeatureSouthernIslands]>;
93
94 def : ProcessorModel<"oland", SIQuarterSpeedModel, [FeatureSouthernIslands]>;
95
96 def : ProcessorModel<"hainan", SIQuarterSpeedModel, [FeatureSouthernIslands]>;
82 def : ProcessorModel<"gfx600", SIFullSpeedModel,
83 [FeatureISAVersion6_0_0]>;
84
85 def : ProcessorModel<"SI", SIFullSpeedModel,
86 [FeatureISAVersion6_0_0]
87 >;
88
89 def : ProcessorModel<"tahiti", SIFullSpeedModel,
90 [FeatureISAVersion6_0_0]
91 >;
92
93 def : ProcessorModel<"gfx601", SIQuarterSpeedModel,
94 [FeatureISAVersion6_0_1]
95 >;
96
97 def : ProcessorModel<"pitcairn", SIQuarterSpeedModel,
98 [FeatureISAVersion6_0_1]>;
99
100 def : ProcessorModel<"verde", SIQuarterSpeedModel,
101 [FeatureISAVersion6_0_1]>;
102
103 def : ProcessorModel<"oland", SIQuarterSpeedModel,
104 [FeatureISAVersion6_0_1]>;
105
106 def : ProcessorModel<"hainan", SIQuarterSpeedModel, [FeatureISAVersion6_0_1]>;
97107
98108 //===----------------------------------------------------------------------===//
99109 // Sea Islands
100110 //===----------------------------------------------------------------------===//
111
112 def : ProcessorModel<"gfx700", SIQuarterSpeedModel,
113 [FeatureISAVersion7_0_0]
114 >;
101115
102116 def : ProcessorModel<"bonaire", SIQuarterSpeedModel,
103117 [FeatureISAVersion7_0_0]
104118 >;
105119
106 def : ProcessorModel<"kabini", SIQuarterSpeedModel,
107 [FeatureISAVersion7_0_2]
108 >;
109
110120 def : ProcessorModel<"kaveri", SIQuarterSpeedModel,
111121 [FeatureISAVersion7_0_0]
112122 >;
113123
124 def : ProcessorModel<"gfx701", SIFullSpeedModel,
125 [FeatureISAVersion7_0_1]
126 >;
127
114128 def : ProcessorModel<"hawaii", SIFullSpeedModel,
115129 [FeatureISAVersion7_0_1]
116130 >;
117131
118 def : ProcessorModel<"mullins", SIQuarterSpeedModel,
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
129132 def : ProcessorModel<"gfx702", SIQuarterSpeedModel,
130133 [FeatureISAVersion7_0_2]
131134 >;
132135
136 def : ProcessorModel<"gfx703", SIQuarterSpeedModel,
137 [FeatureISAVersion7_0_3]
138 >;
139
140 def : ProcessorModel<"kabini", SIQuarterSpeedModel,
141 [FeatureISAVersion7_0_3]
142 >;
143
144 def : ProcessorModel<"mullins", SIQuarterSpeedModel,
145 [FeatureISAVersion7_0_3]>;
146
133147 //===----------------------------------------------------------------------===//
134148 // Volcanic Islands
135149 //===----------------------------------------------------------------------===//
186200 [FeatureISAVersion8_1_0]
187201 >;
188202
189 def : ProcessorModel<"gfx900", SIQuarterSpeedModel,
190 [FeatureGFX9, FeatureISAVersion9_0_0, FeatureLDSBankCount32]
191 >;
192
193 def : ProcessorModel<"gfx901", SIQuarterSpeedModel,
194 [FeatureGFX9, FeatureXNACK, FeatureISAVersion9_0_1, FeatureLDSBankCount32]
195 >;
203 //===----------------------------------------------------------------------===//
204 // GFX9
205 //===----------------------------------------------------------------------===//
206
207 def : ProcessorModel<"gfx900", SIQuarterSpeedModel,
208 [FeatureISAVersion9_0_0]
209 >;
210
211 def : ProcessorModel<"gfx901", SIQuarterSpeedModel,
212 [FeatureISAVersion9_0_1]
213 >;
214
215 def : ProcessorModel<"gfx902", SIQuarterSpeedModel,
216 [FeatureISAVersion9_0_2]
217 >;
218
219 def : ProcessorModel<"gfx903", SIQuarterSpeedModel,
220 [FeatureISAVersion9_0_3]
221 >;
222
102102 namespace IsaInfo {
103103
104104 IsaVersion getIsaVersion(const FeatureBitset &Features) {
105 // SI.
106 if (Features.test(FeatureISAVersion6_0_0))
107 return {6, 0, 0};
108 if (Features.test(FeatureISAVersion6_0_1))
109 return {6, 0, 1};
105110 // CI.
106111 if (Features.test(FeatureISAVersion7_0_0))
107112 return {7, 0, 0};
109114 return {7, 0, 1};
110115 if (Features.test(FeatureISAVersion7_0_2))
111116 return {7, 0, 2};
117 if (Features.test(FeatureISAVersion7_0_3))
118 return {7, 0, 3};
112119
113120 // VI.
114121 if (Features.test(FeatureISAVersion8_0_0))
129136 return {9, 0, 0};
130137 if (Features.test(FeatureISAVersion9_0_1))
131138 return {9, 0, 1};
139 if (Features.test(FeatureISAVersion9_0_2))
140 return {9, 0, 2};
141 if (Features.test(FeatureISAVersion9_0_3))
142 return {9, 0, 3};
132143
133144 if (!Features.test(FeatureGCN) || Features.test(FeatureSouthernIslands))
134145 return {0, 0, 0};
0 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx600 | FileCheck --check-prefix=HSA --check-prefix=HSA-SI600 %s
1 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx601 | FileCheck --check-prefix=HSA --check-prefix=HSA-SI601 %s
2 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx700 | FileCheck --check-prefix=HSA --check-prefix=HSA-CI700 %s
13 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx701 | FileCheck --check-prefix=HSA --check-prefix=HSA-CI701 %s
24 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx702 | FileCheck --check-prefix=HSA --check-prefix=HSA-CI702 %s
5 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx703 | FileCheck --check-prefix=HSA --check-prefix=HSA-CI703 %s
6 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=mullins | FileCheck --check-prefix=HSA --check-prefix=HSA-CI703 %s
7 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=hawaii | FileCheck --check-prefix=HSA --check-prefix=HSA-CI701 %s
8 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kabini | FileCheck --check-prefix=HSA --check-prefix=HSA-CI703 %s
39 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=HSA --check-prefix=HSA-CI700 %s
410 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=carrizo -mattr=-flat-for-global | FileCheck --check-prefix=HSA --check-prefix=HSA-VI801 %s
511 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=tonga -mattr=-flat-for-global | FileCheck --check-prefix=HSA --check-prefix=HSA-VI802 %s
1420 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx810 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI810 %s
1521 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx900 | FileCheck --check-prefix=HSA --check-prefix=HSA-GFX900 %s
1622 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx901 | FileCheck --check-prefix=HSA --check-prefix=HSA-GFX901 %s
23 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx902 | FileCheck --check-prefix=HSA --check-prefix=HSA-GFX902 %s
24 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx903 | FileCheck --check-prefix=HSA --check-prefix=HSA-GFX903 %s
1725
1826 ; HSA: .hsa_code_object_version 2,1
27 ; HSA-SI600: .hsa_code_object_isa 6,0,0,"AMD","AMDGPU"
28 ; HSA-SI601: .hsa_code_object_isa 6,0,1,"AMD","AMDGPU"
1929 ; HSA-CI700: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
2030 ; HSA-CI701: .hsa_code_object_isa 7,0,1,"AMD","AMDGPU"
2131 ; HSA-CI702: .hsa_code_object_isa 7,0,2,"AMD","AMDGPU"
32 ; HSA-CI703: .hsa_code_object_isa 7,0,3,"AMD","AMDGPU"
2233 ; HSA-VI800: .hsa_code_object_isa 8,0,0,"AMD","AMDGPU"
2334 ; HSA-VI801: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU"
2435 ; HSA-VI802: .hsa_code_object_isa 8,0,2,"AMD","AMDGPU"
2738 ; HSA-VI810: .hsa_code_object_isa 8,1,0,"AMD","AMDGPU"
2839 ; HSA-GFX900: .hsa_code_object_isa 9,0,0,"AMD","AMDGPU"
2940 ; HSA-GFX901: .hsa_code_object_isa 9,0,1,"AMD","AMDGPU"
41 ; HSA-GFX902: .hsa_code_object_isa 9,0,2,"AMD","AMDGPU"
42 ; HSA-GFX903: .hsa_code_object_isa 9,0,3,"AMD","AMDGPU"
99 // RUN: llvm-mc -arch=amdgcn -mcpu=stoney %s | FileCheck %s --check-prefix=STONEY
1010
1111 .byte .option.machine_version_major
12 // SI: .byte 0
12 // SI: .byte 6
1313 // BONAIRE: .byte 7
1414 // HAWAII: .byte 7
1515 // KABINI: .byte 7
3636 // SI: .byte 0
3737 // BONAIRE: .byte 0
3838 // HAWAII: .byte 1
39 // KABINI: .byte 2
39 // KABINI: .byte 3
4040 // ICELAND: .byte 0
4141 // CARRIZO: .byte 1
4242 // TONGA: .byte 2