Coverage Report

Created: 2018-07-20 23:04

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/clang-build/lib/Target/AMDGPU/AMDGPUGenSubtargetInfo.inc
Line
Count
Source (jump to first uncovered line)
1
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2
|*                                                                            *|
3
|* Subtarget Enumeration Source Fragment                                      *|
4
|*                                                                            *|
5
|* Automatically generated file, do not edit!                                 *|
6
|*                                                                            *|
7
\*===----------------------------------------------------------------------===*/
8
9
10
#ifdef GET_SUBTARGETINFO_ENUM
11
#undef GET_SUBTARGETINFO_ENUM
12
13
namespace llvm {
14
namespace AMDGPU {
15
enum {
16
  Feature16BitInsts = 0,
17
  FeatureAddNoCarryInsts = 1,
18
  FeatureApertureRegs = 2,
19
  FeatureAutoWaitcntBeforeBarrier = 3,
20
  FeatureCIInsts = 4,
21
  FeatureCodeObjectV3 = 5,
22
  FeatureD16PreservesUnusedBits = 6,
23
  FeatureDLInsts = 7,
24
  FeatureDPP = 8,
25
  FeatureDX10Clamp = 9,
26
  FeatureDebuggerEmitPrologue = 10,
27
  FeatureDebuggerInsertNops = 11,
28
  FeatureDisable = 12,
29
  FeatureDumpCode = 13,
30
  FeatureDumpCodeLower = 14,
31
  FeatureEnableDS128 = 15,
32
  FeatureEnableHugePrivateBuffer = 16,
33
  FeatureEnableLoadStoreOpt = 17,
34
  FeatureEnableSIScheduler = 18,
35
  FeatureEnableUnsafeDSOffsetFolding = 19,
36
  FeatureFMA = 20,
37
  FeatureFP16Denormals = 21,
38
  FeatureFP32Denormals = 22,
39
  FeatureFP64 = 23,
40
  FeatureFP64Denormals = 24,
41
  FeatureFP64FP16Denormals = 25,
42
  FeatureFPExceptions = 26,
43
  FeatureFastFMAF32 = 27,
44
  FeatureFlatAddressSpace = 28,
45
  FeatureFlatForGlobal = 29,
46
  FeatureFlatGlobalInsts = 30,
47
  FeatureFlatInstOffsets = 31,
48
  FeatureFlatScratchInsts = 32,
49
  FeatureFmaMixInsts = 33,
50
  FeatureGCN = 34,
51
  FeatureGCN3Encoding = 35,
52
  FeatureGFX9 = 36,
53
  FeatureGFX9Insts = 37,
54
  FeatureISAVersion6_0_0 = 38,
55
  FeatureISAVersion6_0_1 = 39,
56
  FeatureISAVersion7_0_0 = 40,
57
  FeatureISAVersion7_0_1 = 41,
58
  FeatureISAVersion7_0_2 = 42,
59
  FeatureISAVersion7_0_3 = 43,
60
  FeatureISAVersion7_0_4 = 44,
61
  FeatureISAVersion8_0_1 = 45,
62
  FeatureISAVersion8_0_2 = 46,
63
  FeatureISAVersion8_0_3 = 47,
64
  FeatureISAVersion8_1_0 = 48,
65
  FeatureISAVersion9_0_0 = 49,
66
  FeatureISAVersion9_0_2 = 50,
67
  FeatureISAVersion9_0_4 = 51,
68
  FeatureISAVersion9_0_6 = 52,
69
  FeatureIntClamp = 53,
70
  FeatureInv2PiInlineImm = 54,
71
  FeatureLDSBankCount16 = 55,
72
  FeatureLDSBankCount32 = 56,
73
  FeatureLocalMemorySize0 = 57,
74
  FeatureLocalMemorySize32768 = 58,
75
  FeatureLocalMemorySize65536 = 59,
76
  FeatureMIMG_R128 = 60,
77
  FeatureMadMixInsts = 61,
78
  FeatureMaxPrivateElementSize4 = 62,
79
  FeatureMaxPrivateElementSize8 = 63,
80
  FeatureMaxPrivateElementSize16 = 64,
81
  FeatureMovrel = 65,
82
  FeaturePromoteAlloca = 66,
83
  FeatureSDWA = 67,
84
  FeatureSDWAMac = 68,
85
  FeatureSDWAOmod = 69,
86
  FeatureSDWAOutModsVOPC = 70,
87
  FeatureSDWAScalar = 71,
88
  FeatureSDWASdst = 72,
89
  FeatureSGPRInitBug = 73,
90
  FeatureSMemRealTime = 74,
91
  FeatureScalarAtomics = 75,
92
  FeatureScalarStores = 76,
93
  FeatureSeaIslands = 77,
94
  FeatureSouthernIslands = 78,
95
  FeatureTrapHandler = 79,
96
  FeatureUnalignedBufferAccess = 80,
97
  FeatureUnalignedScratchAccess = 81,
98
  FeatureUnpackedD16VMem = 82,
99
  FeatureVGPRIndexMode = 83,
100
  FeatureVGPRSpilling = 84,
101
  FeatureVOP3P = 85,
102
  FeatureVolcanicIslands = 86,
103
  FeatureWavefrontSize16 = 87,
104
  FeatureWavefrontSize32 = 88,
105
  FeatureWavefrontSize64 = 89,
106
  FeatureXNACK = 90,
107
  HalfRate64Ops = 91,
108
};
109
} // end namespace AMDGPU
110
} // end namespace llvm
111
112
#endif // GET_SUBTARGETINFO_ENUM
113
114
115
#ifdef GET_SUBTARGETINFO_MC_DESC
116
#undef GET_SUBTARGETINFO_MC_DESC
117
118
namespace llvm {
119
// Sorted (by key) array of values for CPU features.
120
extern const llvm::SubtargetFeatureKV AMDGPUFeatureKV[] = {
121
  { "16-bit-insts", "Has i16/f16 instructions", { AMDGPU::Feature16BitInsts }, { } },
122
  { "DumpCode", "Dump MachineInstrs in the CodeEmitter", { AMDGPU::FeatureDumpCode }, { } },
123
  { "GFX9", "GFX9 GPU generation", { AMDGPU::FeatureGFX9 }, { AMDGPU::FeatureFP64, AMDGPU::FeatureLocalMemorySize65536, AMDGPU::FeatureWavefrontSize64, AMDGPU::FeatureFlatAddressSpace, AMDGPU::FeatureGCN, AMDGPU::FeatureGCN3Encoding, AMDGPU::FeatureCIInsts, AMDGPU::Feature16BitInsts, AMDGPU::FeatureSMemRealTime, AMDGPU::FeatureScalarStores, AMDGPU::FeatureInv2PiInlineImm, AMDGPU::FeatureApertureRegs, AMDGPU::FeatureGFX9Insts, AMDGPU::FeatureVOP3P, AMDGPU::FeatureVGPRIndexMode, AMDGPU::FeatureFastFMAF32, AMDGPU::FeatureDPP, AMDGPU::FeatureIntClamp, AMDGPU::FeatureSDWA, AMDGPU::FeatureSDWAOmod, AMDGPU::FeatureSDWAScalar, AMDGPU::FeatureSDWASdst, AMDGPU::FeatureFlatInstOffsets, AMDGPU::FeatureFlatGlobalInsts, AMDGPU::FeatureFlatScratchInsts, AMDGPU::FeatureAddNoCarryInsts, AMDGPU::FeatureScalarAtomics } },
124
  { "SEA_ISLANDS", "SEA_ISLANDS GPU generation", { AMDGPU::FeatureSeaIslands }, { AMDGPU::FeatureFP64, AMDGPU::FeatureLocalMemorySize65536, AMDGPU::FeatureMIMG_R128, AMDGPU::FeatureWavefrontSize64, AMDGPU::FeatureGCN, AMDGPU::FeatureFlatAddressSpace, AMDGPU::FeatureCIInsts, AMDGPU::FeatureMovrel } },
125
  { "SOUTHERN_ISLANDS", "SOUTHERN_ISLANDS GPU generation", { AMDGPU::FeatureSouthernIslands }, { AMDGPU::FeatureFP64, AMDGPU::FeatureLocalMemorySize32768, AMDGPU::FeatureMIMG_R128, AMDGPU::FeatureWavefrontSize64, AMDGPU::FeatureGCN, AMDGPU::FeatureLDSBankCount32, AMDGPU::FeatureMovrel } },
126
  { "VOLCANIC_ISLANDS", "VOLCANIC_ISLANDS GPU generation", { AMDGPU::FeatureVolcanicIslands }, { AMDGPU::FeatureFP64, AMDGPU::FeatureLocalMemorySize65536, AMDGPU::FeatureMIMG_R128, AMDGPU::FeatureWavefrontSize64, AMDGPU::FeatureFlatAddressSpace, AMDGPU::FeatureGCN, AMDGPU::FeatureGCN3Encoding, AMDGPU::FeatureCIInsts, AMDGPU::Feature16BitInsts, AMDGPU::FeatureSMemRealTime, AMDGPU::FeatureVGPRIndexMode, AMDGPU::FeatureMovrel, AMDGPU::FeatureScalarStores, AMDGPU::FeatureInv2PiInlineImm, AMDGPU::FeatureSDWA, AMDGPU::FeatureSDWAOutModsVOPC, AMDGPU::FeatureSDWAMac, AMDGPU::FeatureDPP, AMDGPU::FeatureIntClamp } },
127
  { "add-no-carry-insts", "Have VALU add/sub instructions without carry out", { AMDGPU::FeatureAddNoCarryInsts }, { } },
128
  { "amdgpu-debugger-emit-prologue", "Emit debugger prologue", { AMDGPU::FeatureDebuggerEmitPrologue }, { } },
129
  { "amdgpu-debugger-insert-nops", "Insert one nop instruction for each high level source statement", { AMDGPU::FeatureDebuggerInsertNops }, { } },
130
  { "aperture-regs", "Has Memory Aperture Base and Size Registers", { AMDGPU::FeatureApertureRegs }, { } },
131
  { "auto-waitcnt-before-barrier", "Hardware automatically inserts waitcnt before barrier", { AMDGPU::FeatureAutoWaitcntBeforeBarrier }, { } },
132
  { "ci-insts", "Additional instructions for CI+", { AMDGPU::FeatureCIInsts }, { } },
133
  { "code-object-v3", "Generate code object version 3", { AMDGPU::FeatureCodeObjectV3 }, { } },
134
  { "d16-preserves-unused-bits", "If present, then instructions defined by HasD16LoadStore predicate preserve unused bits. Otherwise instructions defined by HasD16LoadStore predicate zero unused bits.", { AMDGPU::FeatureD16PreservesUnusedBits }, { } },
135
  { "dl-insts", "Has deep learning instructions", { AMDGPU::FeatureDLInsts }, { } },
136
  { "dpp", "Support DPP (Data Parallel Primitives) extension", { AMDGPU::FeatureDPP }, { } },
137
  { "dumpcode", "Dump MachineInstrs in the CodeEmitter", { AMDGPU::FeatureDumpCodeLower }, { } },
138
  { "dx10-clamp", "clamp modifier clamps NaNs to 0.0", { AMDGPU::FeatureDX10Clamp }, { } },
139
  { "enable-ds128", "Use ds_{read|write}_b128", { AMDGPU::FeatureEnableDS128 }, { } },
140
  { "fast-fmaf", "Assuming f32 fma is at least as fast as mul + add", { AMDGPU::FeatureFastFMAF32 }, { } },
141
  { "flat-address-space", "Support flat address space", { AMDGPU::FeatureFlatAddressSpace }, { } },
142
  { "flat-for-global", "Force to generate flat instruction for global", { AMDGPU::FeatureFlatForGlobal }, { } },
143
  { "flat-global-insts", "Have global_* flat memory instructions", { AMDGPU::FeatureFlatGlobalInsts }, { } },
144
  { "flat-inst-offsets", "Flat instructions have immediate offset addressing mode", { AMDGPU::FeatureFlatInstOffsets }, { } },
145
  { "flat-scratch-insts", "Have scratch_* flat memory instructions", { AMDGPU::FeatureFlatScratchInsts }, { } },
146
  { "fma-mix-insts", "Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions", { AMDGPU::FeatureFmaMixInsts }, { } },
147
  { "fmaf", "Enable single precision FMA (not as fast as mul+add, but fused)", { AMDGPU::FeatureFMA }, { } },
148
  { "fp-exceptions", "Enable floating point exceptions", { AMDGPU::FeatureFPExceptions }, { } },
149
  { "fp16-denormals", "Enable half precision denormal handling", { AMDGPU::FeatureFP16Denormals }, { AMDGPU::FeatureFP64FP16Denormals } },
150
  { "fp32-denormals", "Enable single precision denormal handling", { AMDGPU::FeatureFP32Denormals }, { } },
151
  { "fp64", "Enable double precision operations", { AMDGPU::FeatureFP64 }, { } },
152
  { "fp64-denormals", "Enable double and half precision denormal handling", { AMDGPU::FeatureFP64Denormals }, { AMDGPU::FeatureFP64, AMDGPU::FeatureFP64FP16Denormals } },
153
  { "fp64-fp16-denormals", "Enable double and half precision denormal handling", { AMDGPU::FeatureFP64FP16Denormals }, { AMDGPU::FeatureFP64 } },
154
  { "gcn", "GCN or newer GPU", { AMDGPU::FeatureGCN }, { } },
155
  { "gcn3-encoding", "Encoding format for VI", { AMDGPU::FeatureGCN3Encoding }, { } },
156
  { "gfx9-insts", "Additional instructions for GFX9+", { AMDGPU::FeatureGFX9Insts }, { } },
157
  { "half-rate-64-ops", "Most fp64 instructions are half rate instead of quarter", { AMDGPU::HalfRate64Ops }, { } },
158
  { "huge-private-buffer", "Enable private/scratch buffer sizes greater than 128 GB", { AMDGPU::FeatureEnableHugePrivateBuffer }, { } },
159
  { "int-clamp-insts", "Support clamp for integer destination", { AMDGPU::FeatureIntClamp }, { } },
160
  { "inv-2pi-inline-imm", "Has 1 / (2 * pi) as inline immediate", { AMDGPU::FeatureInv2PiInlineImm }, { } },
161
  { "isaver6.0.0", "Instruction set version number", { AMDGPU::FeatureISAVersion6_0_0 }, { AMDGPU::FeatureSouthernIslands, AMDGPU::FeatureFastFMAF32, AMDGPU::HalfRate64Ops, AMDGPU::FeatureLDSBankCount32 } },
162
  { "isaver6.0.1", "Instruction set version number", { AMDGPU::FeatureISAVersion6_0_1 }, { AMDGPU::FeatureSouthernIslands, AMDGPU::FeatureLDSBankCount32 } },
163
  { "isaver7.0.0", "Instruction set version number", { AMDGPU::FeatureISAVersion7_0_0 }, { AMDGPU::FeatureSeaIslands, AMDGPU::FeatureLDSBankCount32 } },
164
  { "isaver7.0.1", "Instruction set version number", { AMDGPU::FeatureISAVersion7_0_1 }, { AMDGPU::FeatureSeaIslands, AMDGPU::HalfRate64Ops, AMDGPU::FeatureLDSBankCount32, AMDGPU::FeatureFastFMAF32 } },
165
  { "isaver7.0.2", "Instruction set version number", { AMDGPU::FeatureISAVersion7_0_2 }, { AMDGPU::FeatureSeaIslands, AMDGPU::FeatureLDSBankCount16, AMDGPU::FeatureFastFMAF32 } },
166
  { "isaver7.0.3", "Instruction set version number", { AMDGPU::FeatureISAVersion7_0_3 }, { AMDGPU::FeatureSeaIslands, AMDGPU::FeatureLDSBankCount16 } },
167
  { "isaver7.0.4", "Instruction set version number", { AMDGPU::FeatureISAVersion7_0_4 }, { AMDGPU::FeatureSeaIslands, AMDGPU::FeatureLDSBankCount32 } },
168
  { "isaver8.0.1", "Instruction set version number", { AMDGPU::FeatureISAVersion8_0_1 }, { AMDGPU::FeatureVolcanicIslands, AMDGPU::FeatureFastFMAF32, AMDGPU::HalfRate64Ops, AMDGPU::FeatureLDSBankCount32, AMDGPU::FeatureXNACK, AMDGPU::FeatureUnpackedD16VMem } },
169
  { "isaver8.0.2", "Instruction set version number", { AMDGPU::FeatureISAVersion8_0_2 }, { AMDGPU::FeatureVolcanicIslands, AMDGPU::FeatureLDSBankCount32, AMDGPU::FeatureSGPRInitBug, AMDGPU::FeatureUnpackedD16VMem } },
170
  { "isaver8.0.3", "Instruction set version number", { AMDGPU::FeatureISAVersion8_0_3 }, { AMDGPU::FeatureVolcanicIslands, AMDGPU::FeatureLDSBankCount32, AMDGPU::FeatureUnpackedD16VMem } },
171
  { "isaver8.1.0", "Instruction set version number", { AMDGPU::FeatureISAVersion8_1_0 }, { AMDGPU::FeatureVolcanicIslands, AMDGPU::FeatureLDSBankCount16, AMDGPU::FeatureXNACK } },
172
  { "isaver9.0.0", "Instruction set version number", { AMDGPU::FeatureISAVersion9_0_0 }, { AMDGPU::FeatureGFX9, AMDGPU::FeatureMadMixInsts, AMDGPU::FeatureLDSBankCount32, AMDGPU::FeatureD16PreservesUnusedBits } },
173
  { "isaver9.0.2", "Instruction set version number", { AMDGPU::FeatureISAVersion9_0_2 }, { AMDGPU::FeatureGFX9, AMDGPU::FeatureMadMixInsts, AMDGPU::FeatureLDSBankCount32, AMDGPU::FeatureXNACK, AMDGPU::FeatureD16PreservesUnusedBits } },
174
  { "isaver9.0.4", "Instruction set version number", { AMDGPU::FeatureISAVersion9_0_4 }, { AMDGPU::FeatureGFX9, AMDGPU::FeatureLDSBankCount32, AMDGPU::FeatureFmaMixInsts, AMDGPU::FeatureD16PreservesUnusedBits } },
175
  { "isaver9.0.6", "Instruction set version number", { AMDGPU::FeatureISAVersion9_0_6 }, { AMDGPU::FeatureGFX9, AMDGPU::HalfRate64Ops, AMDGPU::FeatureFmaMixInsts, AMDGPU::FeatureLDSBankCount32, AMDGPU::FeatureDLInsts } },
176
  { "ldsbankcount16", "The number of LDS banks per compute unit.", { AMDGPU::FeatureLDSBankCount16 }, { } },
177
  { "ldsbankcount32", "The number of LDS banks per compute unit.", { AMDGPU::FeatureLDSBankCount32 }, { } },
178
  { "load-store-opt", "Enable SI load/store optimizer pass", { AMDGPU::FeatureEnableLoadStoreOpt }, { } },
179
  { "localmemorysize0", "The size of local memory in bytes", { AMDGPU::FeatureLocalMemorySize0 }, { } },
180
  { "localmemorysize32768", "The size of local memory in bytes", { AMDGPU::FeatureLocalMemorySize32768 }, { } },
181
  { "localmemorysize65536", "The size of local memory in bytes", { AMDGPU::FeatureLocalMemorySize65536 }, { } },
182
  { "mad-mix-insts", "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions", { AMDGPU::FeatureMadMixInsts }, { } },
183
  { "max-private-element-size-16", "Maximum private access size may be 16", { AMDGPU::FeatureMaxPrivateElementSize16 }, { } },
184
  { "max-private-element-size-4", "Maximum private access size may be 4", { AMDGPU::FeatureMaxPrivateElementSize4 }, { } },
185
  { "max-private-element-size-8", "Maximum private access size may be 8", { AMDGPU::FeatureMaxPrivateElementSize8 }, { } },
186
  { "mimg-r128", "Support 128-bit texture resources", { AMDGPU::FeatureMIMG_R128 }, { } },
187
  { "movrel", "Has v_movrel*_b32 instructions", { AMDGPU::FeatureMovrel }, { } },
188
  { "promote-alloca", "Enable promote alloca pass", { AMDGPU::FeaturePromoteAlloca }, { } },
189
  { "s-memrealtime", "Has s_memrealtime instruction", { AMDGPU::FeatureSMemRealTime }, { } },
190
  { "scalar-atomics", "Has atomic scalar memory instructions", { AMDGPU::FeatureScalarAtomics }, { } },
191
  { "scalar-stores", "Has store scalar memory instructions", { AMDGPU::FeatureScalarStores }, { } },
192
  { "sdwa", "Support SDWA (Sub-DWORD Addressing) extension", { AMDGPU::FeatureSDWA }, { } },
193
  { "sdwa-mav", "Support v_mac_f32/f16 with SDWA (Sub-DWORD Addressing) extension", { AMDGPU::FeatureSDWAMac }, { } },
194
  { "sdwa-omod", "Support OMod with SDWA (Sub-DWORD Addressing) extension", { AMDGPU::FeatureSDWAOmod }, { } },
195
  { "sdwa-out-mods-vopc", "Support clamp for VOPC with SDWA (Sub-DWORD Addressing) extension", { AMDGPU::FeatureSDWAOutModsVOPC }, { } },
196
  { "sdwa-scalar", "Support scalar register with SDWA (Sub-DWORD Addressing) extension", { AMDGPU::FeatureSDWAScalar }, { } },
197
  { "sdwa-sdst", "Support scalar dst for VOPC with SDWA (Sub-DWORD Addressing) extension", { AMDGPU::FeatureSDWASdst }, { } },
198
  { "sgpr-init-bug", "VI SGPR initialization bug requiring a fixed SGPR allocation size", { AMDGPU::FeatureSGPRInitBug }, { } },
199
  { "si-scheduler", "Enable SI Machine Scheduler", { AMDGPU::FeatureEnableSIScheduler }, { } },
200
  { "trap-handler", "Trap handler support", { AMDGPU::FeatureTrapHandler }, { } },
201
  { "unaligned-buffer-access", "Support unaligned global loads and stores", { AMDGPU::FeatureUnalignedBufferAccess }, { } },
202
  { "unaligned-scratch-access", "Support unaligned scratch loads and stores", { AMDGPU::FeatureUnalignedScratchAccess }, { } },
203
  { "unpacked-d16-vmem", "Has unpacked d16 vmem instructions", { AMDGPU::FeatureUnpackedD16VMem }, { } },
204
  { "unsafe-ds-offset-folding", "Force using DS instruction immediate offsets on SI", { AMDGPU::FeatureEnableUnsafeDSOffsetFolding }, { } },
205
  { "vgpr-index-mode", "Has VGPR mode register indexing", { AMDGPU::FeatureVGPRIndexMode }, { } },
206
  { "vgpr-spilling", "Enable spilling of VGPRs to scratch memory", { AMDGPU::FeatureVGPRSpilling }, { } },
207
  { "vop3p", "Has VOP3P packed instructions", { AMDGPU::FeatureVOP3P }, { } },
208
  { "wavefrontsize16", "The number of threads per wavefront", { AMDGPU::FeatureWavefrontSize16 }, { } },
209
  { "wavefrontsize32", "The number of threads per wavefront", { AMDGPU::FeatureWavefrontSize32 }, { } },
210
  { "wavefrontsize64", "The number of threads per wavefront", { AMDGPU::FeatureWavefrontSize64 }, { } },
211
  { "xnack", "Enable XNACK support", { AMDGPU::FeatureXNACK }, { } },
212
};
213
214
// Sorted (by key) array of values for CPU subtype.
215
extern const llvm::SubtargetFeatureKV AMDGPUSubTypeKV[] = {
216
  { "bonaire", "Select the bonaire processor", { AMDGPU::FeatureISAVersion7_0_4 }, { } },
217
  { "carrizo", "Select the carrizo processor", { AMDGPU::FeatureISAVersion8_0_1 }, { } },
218
  { "fiji", "Select the fiji processor", { AMDGPU::FeatureISAVersion8_0_3 }, { } },
219
  { "generic", "Select the generic processor", { AMDGPU::FeatureGCN, AMDGPU::FeatureWavefrontSize64 }, { } },
220
  { "gfx600", "Select the gfx600 processor", { AMDGPU::FeatureISAVersion6_0_0 }, { } },
221
  { "gfx601", "Select the gfx601 processor", { AMDGPU::FeatureISAVersion6_0_1 }, { } },
222
  { "gfx700", "Select the gfx700 processor", { AMDGPU::FeatureISAVersion7_0_0 }, { } },
223
  { "gfx701", "Select the gfx701 processor", { AMDGPU::FeatureISAVersion7_0_1 }, { } },
224
  { "gfx702", "Select the gfx702 processor", { AMDGPU::FeatureISAVersion7_0_2 }, { } },
225
  { "gfx703", "Select the gfx703 processor", { AMDGPU::FeatureISAVersion7_0_3 }, { } },
226
  { "gfx704", "Select the gfx704 processor", { AMDGPU::FeatureISAVersion7_0_4 }, { } },
227
  { "gfx801", "Select the gfx801 processor", { AMDGPU::FeatureISAVersion8_0_1 }, { } },
228
  { "gfx802", "Select the gfx802 processor", { AMDGPU::FeatureISAVersion8_0_2 }, { } },
229
  { "gfx803", "Select the gfx803 processor", { AMDGPU::FeatureISAVersion8_0_3 }, { } },
230
  { "gfx810", "Select the gfx810 processor", { AMDGPU::FeatureISAVersion8_1_0 }, { } },
231
  { "gfx900", "Select the gfx900 processor", { AMDGPU::FeatureISAVersion9_0_0 }, { } },
232
  { "gfx902", "Select the gfx902 processor", { AMDGPU::FeatureISAVersion9_0_2 }, { } },
233
  { "gfx904", "Select the gfx904 processor", { AMDGPU::FeatureISAVersion9_0_4 }, { } },
234
  { "gfx906", "Select the gfx906 processor", { AMDGPU::FeatureISAVersion9_0_6 }, { } },
235
  { "hainan", "Select the hainan processor", { AMDGPU::FeatureISAVersion6_0_1 }, { } },
236
  { "hawaii", "Select the hawaii processor", { AMDGPU::FeatureISAVersion7_0_1 }, { } },
237
  { "iceland", "Select the iceland processor", { AMDGPU::FeatureISAVersion8_0_2 }, { } },
238
  { "kabini", "Select the kabini processor", { AMDGPU::FeatureISAVersion7_0_3 }, { } },
239
  { "kaveri", "Select the kaveri processor", { AMDGPU::FeatureISAVersion7_0_0 }, { } },
240
  { "mullins", "Select the mullins processor", { AMDGPU::FeatureISAVersion7_0_3 }, { } },
241
  { "oland", "Select the oland processor", { AMDGPU::FeatureISAVersion6_0_1 }, { } },
242
  { "pitcairn", "Select the pitcairn processor", { AMDGPU::FeatureISAVersion6_0_1 }, { } },
243
  { "polaris10", "Select the polaris10 processor", { AMDGPU::FeatureISAVersion8_0_3 }, { } },
244
  { "polaris11", "Select the polaris11 processor", { AMDGPU::FeatureISAVersion8_0_3 }, { } },
245
  { "stoney", "Select the stoney processor", { AMDGPU::FeatureISAVersion8_1_0 }, { } },
246
  { "tahiti", "Select the tahiti processor", { AMDGPU::FeatureISAVersion6_0_0 }, { } },
247
  { "tonga", "Select the tonga processor", { AMDGPU::FeatureISAVersion8_0_2 }, { } },
248
  { "verde", "Select the verde processor", { AMDGPU::FeatureISAVersion6_0_1 }, { } },
249
};
250
251
#ifdef DBGFIELD
252
#error "<target>GenSubtargetInfo.inc requires a DBGFIELD macro"
253
#endif
254
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
255
#define DBGFIELD(x) x,
256
#else
257
#define DBGFIELD(x)
258
#endif
259
260
// ===============================================================
261
// Data tables for the new per-operand machine model.
262
263
// {ProcResourceIdx, Cycles}
264
extern const llvm::MCWriteProcResEntry AMDGPUWriteProcResTable[] = {
265
  { 0,  0}, // Invalid
266
  { 5,  1}, // #1
267
  { 6,  1}, // #2
268
  { 3,  1}, // #3
269
  { 2,  1}, // #4
270
  { 1,  1}, // #5
271
  { 4,  1}, // #6
272
  { 4,  1}, // #7
273
  { 5,  1}, // #8
274
  { 5,  2} // #9
275
}; // AMDGPUWriteProcResTable
276
277
// {Cycles, WriteResourceID}
278
extern const llvm::MCWriteLatencyEntry AMDGPUWriteLatencyTable[] = {
279
  { 0,  0}, // Invalid
280
  { 1,  0}, // #1 Write32Bit_WriteSALU_WriteFloatFMA
281
  {80,  0}, // #2 WriteVMEM
282
  { 5,  0}, // #3 WriteLDS_WriteSMEM
283
  { 4,  0}, // #4 WriteExport_WriteQuarterRate32_WriteDouble
284
  { 8,  0}, // #5 WriteBranch_WriteDoubleAdd
285
  { 1,  0}, // #6 Write32Bit_WriteFloatFMA
286
  { 1,  0}, // #7 WriteSALU
287
  { 2,  0}, // #8 Write64Bit_WriteDoubleAdd
288
  {16,  0}, // #9 WriteFloatFMA_WriteDouble
289
  {16,  0}, // #10 WriteFloatFMA_WriteDouble
290
  { 1,  0}, // #11 WriteSALU
291
  { 4,  0}, // #12 WriteQuarterRate32_WriteDouble
292
  { 1,  0}, // #13 WriteSALU
293
  { 2,  0}, // #14 Write64Bit
294
  { 2,  0}, // #15 Write64Bit
295
  {500,  0} // #16 WriteBarrier
296
}; // AMDGPUWriteLatencyTable
297
298
// {UseIdx, WriteResourceID, Cycles}
299
extern const llvm::MCReadAdvanceEntry AMDGPUReadAdvanceTable[] = {
300
  {0,  0,  0}, // Invalid
301
}; // AMDGPUReadAdvanceTable
302
303
// {Name, NumMicroOps, BeginGroup, EndGroup, WriteProcResIdx,#, WriteLatencyIdx,#, ReadAdvanceIdx,#}
304
static const llvm::MCSchedClassDesc SIQuarterSpeedModelSchedClasses[] = {
305
  {DBGFIELD("InvalidSchedClass")  16383, false, false,  0, 0,  0, 0,  0, 0},
306
  {DBGFIELD("NullALU_Write32Bit") 1, false, false,  1, 1,  1, 1,  0, 0}, // #1
307
  {DBGFIELD("NullALU_WriteVMEM")  1, false, false,  2, 1,  2, 1,  0, 0}, // #2
308
  {DBGFIELD("NullALU_WriteLDS")   1, false, false,  3, 1,  3, 1,  0, 0}, // #3
309
  {DBGFIELD("NullALU_WriteExport") 1, false, false,  4, 1,  4, 1,  0, 0}, // #4
310
  {DBGFIELD("NullALU_WriteBranch") 1, false, false,  5, 1,  5, 1,  0, 0}, // #5
311
  {DBGFIELD("NullALU")            0, false, false,  0, 0,  0, 0,  0, 0}, // #6
312
  {DBGFIELD("NullALU_WriteSALU")  1, false, false,  6, 1,  1, 1,  0, 0}, // #7
313
  {DBGFIELD("NullALU_WriteSMEM")  1, false, false,  3, 1,  3, 1,  0, 0}, // #8
314
  {DBGFIELD("NullALU_Write32Bit_WriteSALU") 2, false, false,  7, 2,  6, 2,  0, 0}, // #9
315
  {DBGFIELD("NullALU_WriteDoubleAdd") 1, false, false,  1, 1,  5, 1,  0, 0}, // #10
316
  {DBGFIELD("NullALU_Write64Bit") 1, false, false,  1, 1,  8, 1,  0, 0}, // #11
317
  {DBGFIELD("NullALU_WriteQuarterRate32") 1, false, false,  1, 1,  4, 1,  0, 0}, // #12
318
  {DBGFIELD("NullALU_WriteFloatFMA") 1, false, false,  1, 1,  9, 1,  0, 0}, // #13
319
  {DBGFIELD("NullALU_WriteDouble") 1, false, false,  1, 1,  9, 1,  0, 0}, // #14
320
  {DBGFIELD("NullALU_WriteFloatFMA_WriteSALU") 2, false, false,  7, 2, 10, 2,  0, 0}, // #15
321
  {DBGFIELD("NullALU_WriteDouble_WriteSALU") 2, false, false,  7, 2, 10, 2,  0, 0}, // #16
322
  {DBGFIELD("NullALU_WriteQuarterRate32_WriteSALU") 2, false, false,  7, 2, 12, 2,  0, 0}, // #17
323
  {DBGFIELD("NullALU_Write64Bit_Write64Bit") 2, false, false,  9, 1, 14, 2,  0, 0}, // #18
324
  {DBGFIELD("NullALU_WriteBarrier") 1, false, false,  5, 1, 16, 1,  0, 0}, // #19
325
  {DBGFIELD("COPY")               16382, false, false,  0, 0,  0, 0,  0, 0}, // #20
326
  {DBGFIELD("Write32Bit")         1, false, false,  1, 1,  1, 1,  0, 0}, // #21
327
  {DBGFIELD("Write64Bit")         1, false, false,  1, 1,  8, 1,  0, 0}, // #22
328
  {DBGFIELD("WriteSALU")          1, false, false,  6, 1,  1, 1,  0, 0}, // #23
329
}; // SIQuarterSpeedModelSchedClasses
330
331
// {Name, NumMicroOps, BeginGroup, EndGroup, WriteProcResIdx,#, WriteLatencyIdx,#, ReadAdvanceIdx,#}
332
static const llvm::MCSchedClassDesc SIFullSpeedModelSchedClasses[] = {
333
  {DBGFIELD("InvalidSchedClass")  16383, false, false,  0, 0,  0, 0,  0, 0},
334
  {DBGFIELD("NullALU_Write32Bit") 1, false, false,  1, 1,  1, 1,  0, 0}, // #1
335
  {DBGFIELD("NullALU_WriteVMEM")  1, false, false,  2, 1,  2, 1,  0, 0}, // #2
336
  {DBGFIELD("NullALU_WriteLDS")   1, false, false,  3, 1,  3, 1,  0, 0}, // #3
337
  {DBGFIELD("NullALU_WriteExport") 1, false, false,  4, 1,  4, 1,  0, 0}, // #4
338
  {DBGFIELD("NullALU_WriteBranch") 1, false, false,  5, 1,  5, 1,  0, 0}, // #5
339
  {DBGFIELD("NullALU")            0, false, false,  0, 0,  0, 0,  0, 0}, // #6
340
  {DBGFIELD("NullALU_WriteSALU")  1, false, false,  6, 1,  1, 1,  0, 0}, // #7
341
  {DBGFIELD("NullALU_WriteSMEM")  1, false, false,  3, 1,  3, 1,  0, 0}, // #8
342
  {DBGFIELD("NullALU_Write32Bit_WriteSALU") 2, false, false,  7, 2,  6, 2,  0, 0}, // #9
343
  {DBGFIELD("NullALU_WriteDoubleAdd") 1, false, false,  1, 1,  8, 1,  0, 0}, // #10
344
  {DBGFIELD("NullALU_Write64Bit") 1, false, false,  1, 1,  8, 1,  0, 0}, // #11
345
  {DBGFIELD("NullALU_WriteQuarterRate32") 1, false, false,  1, 1,  4, 1,  0, 0}, // #12
346
  {DBGFIELD("NullALU_WriteFloatFMA") 1, false, false,  1, 1,  1, 1,  0, 0}, // #13
347
  {DBGFIELD("NullALU_WriteDouble") 1, false, false,  1, 1,  4, 1,  0, 0}, // #14
348
  {DBGFIELD("NullALU_WriteFloatFMA_WriteSALU") 2, false, false,  7, 2,  6, 2,  0, 0}, // #15
349
  {DBGFIELD("NullALU_WriteDouble_WriteSALU") 2, false, false,  7, 2, 12, 2,  0, 0}, // #16
350
  {DBGFIELD("NullALU_WriteQuarterRate32_WriteSALU") 2, false, false,  7, 2, 12, 2,  0, 0}, // #17
351
  {DBGFIELD("NullALU_Write64Bit_Write64Bit") 2, false, false,  9, 1, 14, 2,  0, 0}, // #18
352
  {DBGFIELD("NullALU_WriteBarrier") 1, false, false,  5, 1, 16, 1,  0, 0}, // #19
353
  {DBGFIELD("COPY")               16382, false, false,  0, 0,  0, 0,  0, 0}, // #20
354
  {DBGFIELD("Write32Bit")         1, false, false,  1, 1,  1, 1,  0, 0}, // #21
355
  {DBGFIELD("Write64Bit")         1, false, false,  1, 1,  8, 1,  0, 0}, // #22
356
  {DBGFIELD("WriteSALU")          1, false, false,  6, 1,  1, 1,  0, 0}, // #23
357
}; // SIFullSpeedModelSchedClasses
358
359
static const llvm::MCSchedModel NoSchedModel = {
360
  MCSchedModel::DefaultIssueWidth,
361
  MCSchedModel::DefaultMicroOpBufferSize,
362
  MCSchedModel::DefaultLoopMicroOpBufferSize,
363
  MCSchedModel::DefaultLoadLatency,
364
  MCSchedModel::DefaultHighLatency,
365
  MCSchedModel::DefaultMispredictPenalty,
366
  false, // PostRAScheduler
367
  false, // CompleteModel
368
  0, // Processor ID
369
  nullptr, nullptr, 0, 0, // No instruction-level machine model.
370
  nullptr, // No Itinerary
371
  nullptr // No extra processor descriptor
372
};
373
374
static const unsigned SIQuarterSpeedModelProcResourceSubUnits[] = {
375
  0,  // Invalid
376
};
377
378
// {Name, NumUnits, SuperIdx, IsBuffered, SubUnitsIdxBegin}
379
static const llvm::MCProcResourceDesc SIQuarterSpeedModelProcResources[] = {
380
  {"InvalidUnit", 0, 0, 0, 0},
381
  {"HWBranch",        1, 0, 1, nullptr}, // #1
382
  {"HWExport",        1, 0, 7, nullptr}, // #2
383
  {"HWLGKM",          1, 0, 31, nullptr}, // #3
384
  {"HWSALU",          1, 0, 1, nullptr}, // #4
385
  {"HWVALU",          1, 0, 1, nullptr}, // #5
386
  {"HWVMEM",          1, 0, 15, nullptr}, // #6
387
};
388
389
static const llvm::MCSchedModel SIQuarterSpeedModel = {
390
  1, // IssueWidth
391
  1, // MicroOpBufferSize
392
  MCSchedModel::DefaultLoopMicroOpBufferSize,
393
  MCSchedModel::DefaultLoadLatency,
394
  MCSchedModel::DefaultHighLatency,
395
  20, // MispredictPenalty
396
  true, // PostRAScheduler
397
  false, // CompleteModel
398
  1, // Processor ID
399
  SIQuarterSpeedModelProcResources,
400
  SIQuarterSpeedModelSchedClasses,
401
  7,
402
  24,
403
  nullptr, // No Itinerary
404
  nullptr // No extra processor descriptor
405
};
406
407
static const unsigned SIFullSpeedModelProcResourceSubUnits[] = {
408
  0,  // Invalid
409
};
410
411
// {Name, NumUnits, SuperIdx, IsBuffered, SubUnitsIdxBegin}
412
static const llvm::MCProcResourceDesc SIFullSpeedModelProcResources[] = {
413
  {"InvalidUnit", 0, 0, 0, 0},
414
  {"HWBranch",        1, 0, 1, nullptr}, // #1
415
  {"HWExport",        1, 0, 7, nullptr}, // #2
416
  {"HWLGKM",          1, 0, 31, nullptr}, // #3
417
  {"HWSALU",          1, 0, 1, nullptr}, // #4
418
  {"HWVALU",          1, 0, 1, nullptr}, // #5
419
  {"HWVMEM",          1, 0, 15, nullptr}, // #6
420
};
421
422
static const llvm::MCSchedModel SIFullSpeedModel = {
423
  1, // IssueWidth
424
  1, // MicroOpBufferSize
425
  MCSchedModel::DefaultLoopMicroOpBufferSize,
426
  MCSchedModel::DefaultLoadLatency,
427
  MCSchedModel::DefaultHighLatency,
428
  20, // MispredictPenalty
429
  true, // PostRAScheduler
430
  false, // CompleteModel
431
  2, // Processor ID
432
  SIFullSpeedModelProcResources,
433
  SIFullSpeedModelSchedClasses,
434
  7,
435
  24,
436
  nullptr, // No Itinerary
437
  nullptr // No extra processor descriptor
438
};
439
440
// Sorted (by key) array of itineraries for CPU subtype.
441
extern const llvm::SubtargetInfoKV AMDGPUProcSchedKV[] = {
442
  { "bonaire", (const void *)&SIQuarterSpeedModel },
443
  { "carrizo", (const void *)&SIQuarterSpeedModel },
444
  { "fiji", (const void *)&SIQuarterSpeedModel },
445
  { "generic", (const void *)&NoSchedModel },
446
  { "gfx600", (const void *)&SIFullSpeedModel },
447
  { "gfx601", (const void *)&SIQuarterSpeedModel },
448
  { "gfx700", (const void *)&SIQuarterSpeedModel },
449
  { "gfx701", (const void *)&SIFullSpeedModel },
450
  { "gfx702", (const void *)&SIQuarterSpeedModel },
451
  { "gfx703", (const void *)&SIQuarterSpeedModel },
452
  { "gfx704", (const void *)&SIQuarterSpeedModel },
453
  { "gfx801", (const void *)&SIQuarterSpeedModel },
454
  { "gfx802", (const void *)&SIQuarterSpeedModel },
455
  { "gfx803", (const void *)&SIQuarterSpeedModel },
456
  { "gfx810", (const void *)&SIQuarterSpeedModel },
457
  { "gfx900", (const void *)&SIQuarterSpeedModel },
458
  { "gfx902", (const void *)&SIQuarterSpeedModel },
459
  { "gfx904", (const void *)&SIQuarterSpeedModel },
460
  { "gfx906", (const void *)&SIQuarterSpeedModel },
461
  { "hainan", (const void *)&SIQuarterSpeedModel },
462
  { "hawaii", (const void *)&SIFullSpeedModel },
463
  { "iceland", (const void *)&SIQuarterSpeedModel },
464
  { "kabini", (const void *)&SIQuarterSpeedModel },
465
  { "kaveri", (const void *)&SIQuarterSpeedModel },
466
  { "mullins", (const void *)&SIQuarterSpeedModel },
467
  { "oland", (const void *)&SIQuarterSpeedModel },
468
  { "pitcairn", (const void *)&SIQuarterSpeedModel },
469
  { "polaris10", (const void *)&SIQuarterSpeedModel },
470
  { "polaris11", (const void *)&SIQuarterSpeedModel },
471
  { "stoney", (const void *)&SIQuarterSpeedModel },
472
  { "tahiti", (const void *)&SIFullSpeedModel },
473
  { "tonga", (const void *)&SIQuarterSpeedModel },
474
  { "verde", (const void *)&SIQuarterSpeedModel },
475
};
476
477
#undef DBGFIELD
478
namespace AMDGPU_MC {
479
unsigned resolveVariantSchedClassImpl(unsigned SchedClass,
480
0
    const MCInst *MI, unsigned CPUID) {
481
0
  // Don't know how to resolve this scheduling class.
482
0
  return 0;
483
0
}
484
} // end of namespace AMDGPU_MC
485
486
struct AMDGPUGenMCSubtargetInfo : public MCSubtargetInfo {
487
  AMDGPUGenMCSubtargetInfo(const Triple &TT, 
488
    StringRef CPU, StringRef FS, ArrayRef<SubtargetFeatureKV> PF,
489
    ArrayRef<SubtargetFeatureKV> PD,
490
    const SubtargetInfoKV *ProcSched,
491
    const MCWriteProcResEntry *WPR,
492
    const MCWriteLatencyEntry *WL,
493
    const MCReadAdvanceEntry *RA, const InstrStage *IS,
494
    const unsigned *OC, const unsigned *FP) :
495
      MCSubtargetInfo(TT, CPU, FS, PF, PD, ProcSched,
496
2.72k
                      WPR, WL, RA, IS, OC, FP) { }
497
498
  unsigned resolveVariantSchedClass(unsigned SchedClass,
499
0
      const MCInst *MI, unsigned CPUID) const override {
500
0
    return AMDGPU_MC::resolveVariantSchedClassImpl(SchedClass, MI, CPUID); 
501
0
  }
502
};
503
504
2.72k
static inline MCSubtargetInfo *createAMDGPUMCSubtargetInfoImpl(const Triple &TT, StringRef CPU, StringRef FS) {
505
2.72k
  return new AMDGPUGenMCSubtargetInfo(TT, CPU, FS, AMDGPUFeatureKV, AMDGPUSubTypeKV, 
506
2.72k
                      AMDGPUProcSchedKV, AMDGPUWriteProcResTable, AMDGPUWriteLatencyTable, AMDGPUReadAdvanceTable, 
507
2.72k
                      nullptr, nullptr, nullptr);
508
2.72k
}
509
510
} // end namespace llvm
511
512
#endif // GET_SUBTARGETINFO_MC_DESC
513
514
515
#ifdef GET_SUBTARGETINFO_TARGET_DESC
516
#undef GET_SUBTARGETINFO_TARGET_DESC
517
518
#include "llvm/Support/Debug.h"
519
#include "llvm/Support/raw_ostream.h"
520
521
// ParseSubtargetFeatures - Parses features string setting specified
522
// subtarget options.
523
2.28k
void llvm::AMDGPUSubtarget::ParseSubtargetFeatures(StringRef CPU, StringRef FS) {
524
2.28k
  LLVM_DEBUG(dbgs() << "\nFeatures:" << FS);
525
2.28k
  LLVM_DEBUG(dbgs() << "\nCPU:" << CPU << "\n\n");
526
2.28k
  InitMCProcessorInfo(CPU, FS);
527
2.28k
  const FeatureBitset& Bits = getFeatureBits();
528
2.28k
  if (Bits[AMDGPU::Feature16BitInsts]) 
Has16BitInsts = true1.11k
;
529
2.28k
  if (Bits[AMDGPU::FeatureAddNoCarryInsts]) 
AddNoCarryInsts = true275
;
530
2.28k
  if (Bits[AMDGPU::FeatureApertureRegs]) 
HasApertureRegs = true275
;
531
2.28k
  if (Bits[AMDGPU::FeatureAutoWaitcntBeforeBarrier]) 
AutoWaitcntBeforeBarrier = true2
;
532
2.28k
  if (Bits[AMDGPU::FeatureCIInsts]) 
CIInsts = true1.33k
;
533
2.28k
  if (Bits[AMDGPU::FeatureCodeObjectV3]) 
CodeObjectV3 = true2
;
534
2.28k
  if (Bits[AMDGPU::FeatureD16PreservesUnusedBits]) 
D16PreservesUnusedBits = true254
;
535
2.28k
  if (Bits[AMDGPU::FeatureDLInsts]) 
HasDLInsts = true21
;
536
2.28k
  if (Bits[AMDGPU::FeatureDPP]) 
HasDPP = true1.11k
;
537
2.28k
  if (Bits[AMDGPU::FeatureDX10Clamp]) 
DX10Clamp = true2.27k
;
538
2.28k
  if (Bits[AMDGPU::FeatureDebuggerEmitPrologue]) 
DebuggerEmitPrologue = true4
;
539
2.28k
  if (Bits[AMDGPU::FeatureDebuggerInsertNops]) 
DebuggerInsertNops = true5
;
540
2.28k
  if (Bits[AMDGPU::FeatureDisable]) 
FeatureDisable = true0
;
541
2.28k
  if (Bits[AMDGPU::FeatureDumpCode]) 
DumpCode = true0
;
542
2.28k
  if (Bits[AMDGPU::FeatureDumpCodeLower]) 
DumpCode = true2
;
543
2.28k
  if (Bits[AMDGPU::FeatureEnableDS128]) 
EnableDS128 = true14
;
544
2.28k
  if (Bits[AMDGPU::FeatureEnableHugePrivateBuffer]) 
EnableHugePrivateBuffer = true1
;
545
2.28k
  if (Bits[AMDGPU::FeatureEnableLoadStoreOpt]) 
EnableLoadStoreOpt = true2.27k
;
546
2.28k
  if (Bits[AMDGPU::FeatureEnableSIScheduler]) 
EnableSIScheduler = true1
;
547
2.28k
  if (Bits[AMDGPU::FeatureEnableUnsafeDSOffsetFolding]) 
EnableUnsafeDSOffsetFolding = true1
;
548
2.28k
  if (Bits[AMDGPU::FeatureFMA]) 
FMA = true0
;
549
2.28k
  if (Bits[AMDGPU::FeatureFP16Denormals]) 
FP64FP16Denormals = true1
;
550
2.28k
  if (Bits[AMDGPU::FeatureFP32Denormals]) 
FP32Denormals = true56
;
551
2.28k
  if (Bits[AMDGPU::FeatureFP64]) FP64 = true;
552
2.28k
  if (Bits[AMDGPU::FeatureFP64Denormals]) 
FP64FP16Denormals = true2
;
553
2.28k
  if (Bits[AMDGPU::FeatureFP64FP16Denormals]) 
FP64FP16Denormals = true2.24k
;
554
2.28k
  if (Bits[AMDGPU::FeatureFPExceptions]) 
FPExceptions = true10
;
555
2.28k
  if (Bits[AMDGPU::FeatureFastFMAF32]) 
FastFMAF32 = true528
;
556
2.28k
  if (Bits[AMDGPU::FeatureFlatAddressSpace]) 
FlatAddressSpace = true1.47k
;
557
2.28k
  if (Bits[AMDGPU::FeatureFlatForGlobal]) 
FlatForGlobal = true393
;
558
2.28k
  if (Bits[AMDGPU::FeatureFlatGlobalInsts]) 
FlatGlobalInsts = true275
;
559
2.28k
  if (Bits[AMDGPU::FeatureFlatInstOffsets]) 
FlatInstOffsets = true275
;
560
2.28k
  if (Bits[AMDGPU::FeatureFlatScratchInsts]) 
FlatScratchInsts = true275
;
561
2.28k
  if (Bits[AMDGPU::FeatureFmaMixInsts]) 
HasFmaMixInsts = true23
;
562
2.28k
  if (Bits[AMDGPU::FeatureGCN]) 
IsGCN = true2.26k
;
563
2.28k
  if (Bits[AMDGPU::FeatureGCN3Encoding]) 
GCN3Encoding = true1.11k
;
564
2.28k
  if (Bits[AMDGPU::FeatureGFX9] && 
Gen < GCNSubtarget::GFX9275
)
Gen = GCNSubtarget::GFX9275
;
565
2.28k
  if (Bits[AMDGPU::FeatureGFX9Insts]) 
GFX9Insts = true275
;
566
2.28k
  if (Bits[AMDGPU::FeatureISAVersion6_0_0] && 
IsaVersion < ISAVersion6_0_0175
)
IsaVersion = ISAVersion6_0_0175
;
567
2.28k
  if (Bits[AMDGPU::FeatureISAVersion6_0_1] && 
IsaVersion < ISAVersion6_0_183
)
IsaVersion = ISAVersion6_0_183
;
568
2.28k
  if (Bits[AMDGPU::FeatureISAVersion7_0_0] && 
IsaVersion < ISAVersion7_0_096
)
IsaVersion = ISAVersion7_0_096
;
569
2.28k
  if (Bits[AMDGPU::FeatureISAVersion7_0_1] && 
IsaVersion < ISAVersion7_0_142
)
IsaVersion = ISAVersion7_0_142
;
570
2.28k
  if (Bits[AMDGPU::FeatureISAVersion7_0_2] && 
IsaVersion < ISAVersion7_0_21
)
IsaVersion = ISAVersion7_0_21
;
571
2.28k
  if (Bits[AMDGPU::FeatureISAVersion7_0_3] && 
IsaVersion < ISAVersion7_0_34
)
IsaVersion = ISAVersion7_0_34
;
572
2.28k
  if (Bits[AMDGPU::FeatureISAVersion7_0_4] && 
IsaVersion < ISAVersion7_0_478
)
IsaVersion = ISAVersion7_0_478
;
573
2.28k
  if (Bits[AMDGPU::FeatureISAVersion8_0_1] && 
IsaVersion < ISAVersion8_0_130
)
IsaVersion = ISAVersion8_0_130
;
574
2.28k
  if (Bits[AMDGPU::FeatureISAVersion8_0_2] && 
IsaVersion < ISAVersion8_0_2445
)
IsaVersion = ISAVersion8_0_2445
;
575
2.28k
  if (Bits[AMDGPU::FeatureISAVersion8_0_3] && 
IsaVersion < ISAVersion8_0_3345
)
IsaVersion = ISAVersion8_0_3345
;
576
2.28k
  if (Bits[AMDGPU::FeatureISAVersion8_1_0] && 
IsaVersion < ISAVersion8_1_013
)
IsaVersion = ISAVersion8_1_013
;
577
2.28k
  if (Bits[AMDGPU::FeatureISAVersion9_0_0] && 
IsaVersion < ISAVersion9_0_0248
)
IsaVersion = ISAVersion9_0_0248
;
578
2.28k
  if (Bits[AMDGPU::FeatureISAVersion9_0_2] && 
IsaVersion < ISAVersion9_0_24
)
IsaVersion = ISAVersion9_0_24
;
579
2.28k
  if (Bits[AMDGPU::FeatureISAVersion9_0_4] && 
IsaVersion < ISAVersion9_0_42
)
IsaVersion = ISAVersion9_0_42
;
580
2.28k
  if (Bits[AMDGPU::FeatureISAVersion9_0_6] && 
IsaVersion < ISAVersion9_0_621
)
IsaVersion = ISAVersion9_0_621
;
581
2.28k
  if (Bits[AMDGPU::FeatureIntClamp]) 
HasIntClamp = true1.11k
;
582
2.28k
  if (Bits[AMDGPU::FeatureInv2PiInlineImm]) 
HasInv2PiInlineImm = true1.11k
;
583
2.28k
  if (Bits[AMDGPU::FeatureLDSBankCount16] && 
LDSBankCount < 1619
)
LDSBankCount = 1619
;
584
2.28k
  if (Bits[AMDGPU::FeatureLDSBankCount32] && 
LDSBankCount < 321.57k
)
LDSBankCount = 321.57k
;
585
2.28k
  if (Bits[AMDGPU::FeatureLocalMemorySize0] && 
LocalMemorySize < 00
)
LocalMemorySize = 00
;
586
2.28k
  if (Bits[AMDGPU::FeatureLocalMemorySize32768] && 
LocalMemorySize < 32768258
)
LocalMemorySize = 32768258
;
587
2.28k
  if (Bits[AMDGPU::FeatureLocalMemorySize65536] && 
LocalMemorySize < 655361.33k
)
LocalMemorySize = 655361.33k
;
588
2.28k
  if (Bits[AMDGPU::FeatureMIMG_R128]) 
MIMG_R128 = true1.31k
;
589
2.28k
  if (Bits[AMDGPU::FeatureMadMixInsts]) 
HasMadMixInsts = true252
;
590
2.28k
  if (Bits[AMDGPU::FeatureMaxPrivateElementSize4] && 
MaxPrivateElementSize < 46
)
MaxPrivateElementSize = 46
;
591
2.28k
  if (Bits[AMDGPU::FeatureMaxPrivateElementSize8] && 
MaxPrivateElementSize < 83
)
MaxPrivateElementSize = 83
;
592
2.28k
  if (Bits[AMDGPU::FeatureMaxPrivateElementSize16] && 
MaxPrivateElementSize < 1612
)
MaxPrivateElementSize = 1612
;
593
2.28k
  if (Bits[AMDGPU::FeatureMovrel]) 
HasMovrel = true1.31k
;
594
2.28k
  if (Bits[AMDGPU::FeaturePromoteAlloca]) 
EnablePromoteAlloca = true2.23k
;
595
2.28k
  if (Bits[AMDGPU::FeatureSDWA]) 
HasSDWA = true1.11k
;
596
2.28k
  if (Bits[AMDGPU::FeatureSDWAMac]) 
HasSDWAMac = true837
;
597
2.28k
  if (Bits[AMDGPU::FeatureSDWAOmod]) 
HasSDWAOmod = true275
;
598
2.28k
  if (Bits[AMDGPU::FeatureSDWAOutModsVOPC]) 
HasSDWAOutModsVOPC = true837
;
599
2.28k
  if (Bits[AMDGPU::FeatureSDWAScalar]) 
HasSDWAScalar = true275
;
600
2.28k
  if (Bits[AMDGPU::FeatureSDWASdst]) 
HasSDWASdst = true275
;
601
2.28k
  if (Bits[AMDGPU::FeatureSGPRInitBug]) 
SGPRInitBug = true445
;
602
2.28k
  if (Bits[AMDGPU::FeatureSMemRealTime]) 
HasSMemRealTime = true1.11k
;
603
2.28k
  if (Bits[AMDGPU::FeatureScalarAtomics]) 
HasScalarAtomics = true275
;
604
2.28k
  if (Bits[AMDGPU::FeatureScalarStores]) 
HasScalarStores = true1.11k
;
605
2.28k
  if (Bits[AMDGPU::FeatureSeaIslands] && 
Gen < GCNSubtarget::SEA_ISLANDS221
)
Gen = GCNSubtarget::SEA_ISLANDS221
;
606
2.28k
  if (Bits[AMDGPU::FeatureSouthernIslands] && 
Gen < GCNSubtarget::SOUTHERN_ISLANDS258
)
Gen = GCNSubtarget::SOUTHERN_ISLANDS0
;
607
2.28k
  if (Bits[AMDGPU::FeatureTrapHandler]) 
TrapHandler = true431
;
608
2.28k
  if (Bits[AMDGPU::FeatureUnalignedBufferAccess]) 
UnalignedBufferAccess = true429
;
609
2.28k
  if (Bits[AMDGPU::FeatureUnalignedScratchAccess]) 
UnalignedScratchAccess = true4
;
610
2.28k
  if (Bits[AMDGPU::FeatureUnpackedD16VMem]) 
HasUnpackedD16VMem = true823
;
611
2.28k
  if (Bits[AMDGPU::FeatureVGPRIndexMode]) 
HasVGPRIndexMode = true1.11k
;
612
2.28k
  if (Bits[AMDGPU::FeatureVGPRSpilling]) 
EnableVGPRSpilling = true21
;
613
2.28k
  if (Bits[AMDGPU::FeatureVOP3P]) 
HasVOP3PInsts = true275
;
614
2.28k
  if (Bits[AMDGPU::FeatureVolcanicIslands] && 
Gen < GCNSubtarget::VOLCANIC_ISLANDS837
)
Gen = GCNSubtarget::VOLCANIC_ISLANDS837
;
615
2.28k
  if (Bits[AMDGPU::FeatureWavefrontSize16] && 
WavefrontSize < 160
)
WavefrontSize = 160
;
616
2.28k
  if (Bits[AMDGPU::FeatureWavefrontSize32] && 
WavefrontSize < 320
)
WavefrontSize = 320
;
617
2.28k
  if (Bits[AMDGPU::FeatureWavefrontSize64] && 
WavefrontSize < 642.26k
)
WavefrontSize = 642.26k
;
618
2.28k
  if (Bits[AMDGPU::FeatureXNACK]) 
EnableXNACK = true48
;
619
2.28k
  if (Bits[AMDGPU::HalfRate64Ops]) 
HalfRate64Ops = true278
;
620
2.28k
}
621
#endif // GET_SUBTARGETINFO_TARGET_DESC
622
623
624
#ifdef GET_SUBTARGETINFO_HEADER
625
#undef GET_SUBTARGETINFO_HEADER
626
627
namespace llvm {
628
class DFAPacketizer;
629
namespace AMDGPU_MC {
630
unsigned resolveVariantSchedClassImpl(unsigned SchedClass, const MCInst *MI, unsigned CPUID);
631
}
632
633
struct AMDGPUGenSubtargetInfo : public TargetSubtargetInfo {
634
  explicit AMDGPUGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS);
635
public:
636
  unsigned resolveSchedClass(unsigned SchedClass,  const MachineInstr *DefMI, const TargetSchedModel *SchedModel) const override;
637
  unsigned resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, unsigned CPUID) const override;
638
  DFAPacketizer *createDFAPacketizer(const InstrItineraryData *IID) const;
639
};
640
} // end namespace llvm
641
642
#endif // GET_SUBTARGETINFO_HEADER
643
644
645
#ifdef GET_SUBTARGETINFO_CTOR
646
#undef GET_SUBTARGETINFO_CTOR
647
648
#include "llvm/CodeGen/TargetSchedule.h"
649
650
namespace llvm {
651
extern const llvm::SubtargetFeatureKV AMDGPUFeatureKV[];
652
extern const llvm::SubtargetFeatureKV AMDGPUSubTypeKV[];
653
extern const llvm::SubtargetInfoKV AMDGPUProcSchedKV[];
654
extern const llvm::MCWriteProcResEntry AMDGPUWriteProcResTable[];
655
extern const llvm::MCWriteLatencyEntry AMDGPUWriteLatencyTable[];
656
extern const llvm::MCReadAdvanceEntry AMDGPUReadAdvanceTable[];
657
AMDGPUGenSubtargetInfo::AMDGPUGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
658
  : TargetSubtargetInfo(TT, CPU, FS, makeArrayRef(AMDGPUFeatureKV, 91), makeArrayRef(AMDGPUSubTypeKV, 33), 
659
                        AMDGPUProcSchedKV, AMDGPUWriteProcResTable, AMDGPUWriteLatencyTable, AMDGPUReadAdvanceTable, 
660
2.28k
                        nullptr, nullptr, nullptr) {}
661
662
unsigned AMDGPUGenSubtargetInfo
663
552k
::resolveSchedClass(unsigned SchedClass, const MachineInstr *MI, const TargetSchedModel *SchedModel) const {
664
552k
665
552k
  const SIInstrInfo *TII =
666
552k
    static_cast<const SIInstrInfo*>(SchedModel->getInstrInfo());
667
552k
  (void)TII;
668
552k
669
552k
  switch (SchedClass) {
670
552k
  case 20: // COPY
671
552k
    if (SchedModel->getProcessorID() == 1) { // SIQuarterSpeedModel
672
483k
      if ((TII->isVGPRCopy(*MI) && 
TII->getOpSize(*MI, 0) <= 32279k
))
673
276k
        return 21; // Write32Bit
674
207k
      if ((TII->isVGPRCopy(*MI) && 
TII->getOpSize(*MI, 0) > 322.44k
))
675
2.44k
        return 22; // Write64Bit
676
204k
      if ((true))
677
204k
        return 23; // WriteSALU
678
69.1k
    }
679
69.1k
    if (SchedModel->getProcessorID() == 2) { // SIFullSpeedModel
680
69.1k
      if ((TII->isVGPRCopy(*MI) && 
TII->getOpSize(*MI, 0) <= 3230.7k
))
681
30.0k
        return 21; // Write32Bit
682
39.1k
      if ((TII->isVGPRCopy(*MI) && 
TII->getOpSize(*MI, 0) > 32778
))
683
778
        return 22; // Write64Bit
684
38.3k
      if ((true))
685
38.3k
        return 23; // WriteSALU
686
0
    }
687
0
    break;
688
0
  };
689
0
  report_fatal_error("Expected a variant SchedClass");
690
0
} // AMDGPUGenSubtargetInfo::resolveSchedClass
691
692
unsigned AMDGPUGenSubtargetInfo
693
0
::resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, unsigned CPUID) const {
694
0
  return AMDGPU_MC::resolveVariantSchedClassImpl(SchedClass, MI, CPUID);
695
0
} // AMDGPUGenSubtargetInfo::resolveVariantSchedClass
696
} // end namespace llvm
697
698
#endif // GET_SUBTARGETINFO_CTOR
699