xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPU.td (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
10b57cec5SDimitry Andric//===-- AMDGPU.td - AMDGPU Tablegen files --------*- tablegen -*-===//
20b57cec5SDimitry Andric//
30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric//
70b57cec5SDimitry Andric//===------------------------------------------------------------===//
80b57cec5SDimitry Andric
90b57cec5SDimitry Andricinclude "llvm/TableGen/SearchableTable.td"
100b57cec5SDimitry Andricinclude "llvm/Target/Target.td"
110b57cec5SDimitry Andricinclude "AMDGPUFeatures.td"
120b57cec5SDimitry Andric
138bcb0991SDimitry Andricdef p0 : PtrValueType<i64, 0>;
148bcb0991SDimitry Andricdef p1 : PtrValueType<i64, 1>;
158bcb0991SDimitry Andricdef p2 : PtrValueType<i32, 2>;
168bcb0991SDimitry Andricdef p3 : PtrValueType<i32, 3>;
178bcb0991SDimitry Andricdef p4 : PtrValueType<i64, 4>;
188bcb0991SDimitry Andricdef p5 : PtrValueType<i32, 5>;
198bcb0991SDimitry Andricdef p6 : PtrValueType<i32, 6>;
208bcb0991SDimitry Andric
210b57cec5SDimitry Andricclass BoolToList<bit Value> {
220b57cec5SDimitry Andric  list<int> ret = !if(Value, [1]<int>, []<int>);
230b57cec5SDimitry Andric}
240b57cec5SDimitry Andric
250b57cec5SDimitry Andric//===------------------------------------------------------------===//
260b57cec5SDimitry Andric// Subtarget Features (device properties)
270b57cec5SDimitry Andric//===------------------------------------------------------------===//
280b57cec5SDimitry Andric
290b57cec5SDimitry Andricdef FeatureFastFMAF32 : SubtargetFeature<"fast-fmaf",
300b57cec5SDimitry Andric  "FastFMAF32",
310b57cec5SDimitry Andric  "true",
320b57cec5SDimitry Andric  "Assuming f32 fma is at least as fast as mul + add"
330b57cec5SDimitry Andric>;
340b57cec5SDimitry Andric
355ffd83dbSDimitry Andricdef FeatureFastDenormalF32 : SubtargetFeature<"fast-denormal-f32",
365ffd83dbSDimitry Andric  "FastDenormalF32",
375ffd83dbSDimitry Andric  "true",
385ffd83dbSDimitry Andric  "Enabling denormals does not cause f32 instructions to run at f64 rates"
395ffd83dbSDimitry Andric>;
405ffd83dbSDimitry Andric
410b57cec5SDimitry Andricdef FeatureMIMG_R128 : SubtargetFeature<"mimg-r128",
420b57cec5SDimitry Andric  "MIMG_R128",
430b57cec5SDimitry Andric  "true",
440b57cec5SDimitry Andric  "Support 128-bit texture resources"
450b57cec5SDimitry Andric>;
460b57cec5SDimitry Andric
470b57cec5SDimitry Andricdef HalfRate64Ops : SubtargetFeature<"half-rate-64-ops",
480b57cec5SDimitry Andric  "HalfRate64Ops",
490b57cec5SDimitry Andric  "true",
500b57cec5SDimitry Andric  "Most fp64 instructions are half rate instead of quarter"
510b57cec5SDimitry Andric>;
520b57cec5SDimitry Andric
53fe6060f1SDimitry Andricdef FullRate64Ops : SubtargetFeature<"full-rate-64-ops",
54fe6060f1SDimitry Andric  "FullRate64Ops",
55fe6060f1SDimitry Andric  "true",
56fe6060f1SDimitry Andric  "Most fp64 instructions are full rate"
57fe6060f1SDimitry Andric>;
58fe6060f1SDimitry Andric
590b57cec5SDimitry Andricdef FeatureFlatAddressSpace : SubtargetFeature<"flat-address-space",
600b57cec5SDimitry Andric  "FlatAddressSpace",
610b57cec5SDimitry Andric  "true",
620b57cec5SDimitry Andric  "Support flat address space"
630b57cec5SDimitry Andric>;
640b57cec5SDimitry Andric
650b57cec5SDimitry Andricdef FeatureFlatInstOffsets : SubtargetFeature<"flat-inst-offsets",
660b57cec5SDimitry Andric  "FlatInstOffsets",
670b57cec5SDimitry Andric  "true",
680b57cec5SDimitry Andric  "Flat instructions have immediate offset addressing mode"
690b57cec5SDimitry Andric>;
700b57cec5SDimitry Andric
710b57cec5SDimitry Andricdef FeatureFlatGlobalInsts : SubtargetFeature<"flat-global-insts",
720b57cec5SDimitry Andric  "FlatGlobalInsts",
730b57cec5SDimitry Andric  "true",
740b57cec5SDimitry Andric  "Have global_* flat memory instructions"
750b57cec5SDimitry Andric>;
760b57cec5SDimitry Andric
770b57cec5SDimitry Andricdef FeatureFlatScratchInsts : SubtargetFeature<"flat-scratch-insts",
780b57cec5SDimitry Andric  "FlatScratchInsts",
790b57cec5SDimitry Andric  "true",
800b57cec5SDimitry Andric  "Have scratch_* flat memory instructions"
810b57cec5SDimitry Andric>;
820b57cec5SDimitry Andric
830b57cec5SDimitry Andricdef FeatureScalarFlatScratchInsts : SubtargetFeature<"scalar-flat-scratch-insts",
840b57cec5SDimitry Andric  "ScalarFlatScratchInsts",
850b57cec5SDimitry Andric  "true",
860b57cec5SDimitry Andric  "Have s_scratch_* flat memory instructions"
870b57cec5SDimitry Andric>;
880b57cec5SDimitry Andric
89*81ad6265SDimitry Andricdef FeatureEnableFlatScratch : SubtargetFeature<"enable-flat-scratch",
90*81ad6265SDimitry Andric  "EnableFlatScratch",
91*81ad6265SDimitry Andric  "true",
92*81ad6265SDimitry Andric  "Use scratch_* flat memory instructions to access scratch"
93*81ad6265SDimitry Andric>;
94*81ad6265SDimitry Andric
950b57cec5SDimitry Andricdef FeatureAddNoCarryInsts : SubtargetFeature<"add-no-carry-insts",
960b57cec5SDimitry Andric  "AddNoCarryInsts",
970b57cec5SDimitry Andric  "true",
980b57cec5SDimitry Andric  "Have VALU add/sub instructions without carry out"
990b57cec5SDimitry Andric>;
1000b57cec5SDimitry Andric
1010b57cec5SDimitry Andricdef FeatureUnalignedBufferAccess : SubtargetFeature<"unaligned-buffer-access",
1020b57cec5SDimitry Andric  "UnalignedBufferAccess",
1030b57cec5SDimitry Andric  "true",
104e8d8bef9SDimitry Andric  "Hardware supports unaligned global loads and stores"
1050b57cec5SDimitry Andric>;
1060b57cec5SDimitry Andric
1070b57cec5SDimitry Andricdef FeatureTrapHandler: SubtargetFeature<"trap-handler",
1080b57cec5SDimitry Andric  "TrapHandler",
1090b57cec5SDimitry Andric  "true",
1100b57cec5SDimitry Andric  "Trap handler support"
1110b57cec5SDimitry Andric>;
1120b57cec5SDimitry Andric
1130b57cec5SDimitry Andricdef FeatureUnalignedScratchAccess : SubtargetFeature<"unaligned-scratch-access",
1140b57cec5SDimitry Andric  "UnalignedScratchAccess",
1150b57cec5SDimitry Andric  "true",
1160b57cec5SDimitry Andric  "Support unaligned scratch loads and stores"
1170b57cec5SDimitry Andric>;
1180b57cec5SDimitry Andric
119e8d8bef9SDimitry Andricdef FeatureUnalignedDSAccess : SubtargetFeature<"unaligned-ds-access",
120e8d8bef9SDimitry Andric  "UnalignedDSAccess",
121e8d8bef9SDimitry Andric  "true",
122e8d8bef9SDimitry Andric  "Hardware supports unaligned local and region loads and stores"
123e8d8bef9SDimitry Andric>;
124e8d8bef9SDimitry Andric
1250b57cec5SDimitry Andricdef FeatureApertureRegs : SubtargetFeature<"aperture-regs",
1260b57cec5SDimitry Andric  "HasApertureRegs",
1270b57cec5SDimitry Andric  "true",
1280b57cec5SDimitry Andric  "Has Memory Aperture Base and Size Registers"
1290b57cec5SDimitry Andric>;
1300b57cec5SDimitry Andric
1310b57cec5SDimitry Andricdef FeatureMadMixInsts : SubtargetFeature<"mad-mix-insts",
1320b57cec5SDimitry Andric  "HasMadMixInsts",
1330b57cec5SDimitry Andric  "true",
1340b57cec5SDimitry Andric  "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions"
1350b57cec5SDimitry Andric>;
1360b57cec5SDimitry Andric
1370b57cec5SDimitry Andricdef FeatureFmaMixInsts : SubtargetFeature<"fma-mix-insts",
1380b57cec5SDimitry Andric  "HasFmaMixInsts",
1390b57cec5SDimitry Andric  "true",
1400b57cec5SDimitry Andric  "Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions"
1410b57cec5SDimitry Andric>;
1420b57cec5SDimitry Andric
143e8d8bef9SDimitry Andricdef FeatureSupportsXNACK : SubtargetFeature<"xnack-support",
144e8d8bef9SDimitry Andric  "SupportsXNACK",
1450b57cec5SDimitry Andric  "true",
146e8d8bef9SDimitry Andric  "Hardware supports XNACK"
1470b57cec5SDimitry Andric>;
1480b57cec5SDimitry Andric
1490b57cec5SDimitry Andric// XNACK is disabled if SH_MEM_CONFIG.ADDRESS_MODE = GPUVM on chips that support
1500b57cec5SDimitry Andric// XNACK. The current default kernel driver setting is:
1510b57cec5SDimitry Andric// - graphics ring: XNACK disabled
1520b57cec5SDimitry Andric// - compute ring: XNACK enabled
1530b57cec5SDimitry Andric//
1540b57cec5SDimitry Andric// If XNACK is enabled, the VMEM latency can be worse.
1550b57cec5SDimitry Andric// If XNACK is disabled, the 2 SGPRs can be used for general purposes.
1560b57cec5SDimitry Andricdef FeatureXNACK : SubtargetFeature<"xnack",
1570b57cec5SDimitry Andric  "EnableXNACK",
1580b57cec5SDimitry Andric  "true",
1590b57cec5SDimitry Andric  "Enable XNACK support"
1600b57cec5SDimitry Andric>;
1610b57cec5SDimitry Andric
162fe6060f1SDimitry Andricdef FeatureTgSplit : SubtargetFeature<"tgsplit",
163fe6060f1SDimitry Andric  "EnableTgSplit",
164fe6060f1SDimitry Andric  "true",
165fe6060f1SDimitry Andric  "Enable threadgroup split execution"
166fe6060f1SDimitry Andric>;
167fe6060f1SDimitry Andric
1680b57cec5SDimitry Andricdef FeatureCuMode : SubtargetFeature<"cumode",
1690b57cec5SDimitry Andric  "EnableCuMode",
1700b57cec5SDimitry Andric  "true",
1710b57cec5SDimitry Andric  "Enable CU wavefront execution mode"
1720b57cec5SDimitry Andric>;
1730b57cec5SDimitry Andric
1740b57cec5SDimitry Andricdef FeatureSGPRInitBug : SubtargetFeature<"sgpr-init-bug",
1750b57cec5SDimitry Andric  "SGPRInitBug",
1760b57cec5SDimitry Andric  "true",
1770b57cec5SDimitry Andric  "VI SGPR initialization bug requiring a fixed SGPR allocation size"
1780b57cec5SDimitry Andric>;
1790b57cec5SDimitry Andric
180*81ad6265SDimitry Andricdef FeatureUserSGPRInit16Bug : SubtargetFeature<"user-sgpr-init16-bug",
181*81ad6265SDimitry Andric  "UserSGPRInit16Bug",
182*81ad6265SDimitry Andric  "true",
183*81ad6265SDimitry Andric  "Bug requiring at least 16 user+system SGPRs to be enabled"
184*81ad6265SDimitry Andric>;
185*81ad6265SDimitry Andric
1860b57cec5SDimitry Andricdef FeatureLdsMisalignedBug : SubtargetFeature<"lds-misaligned-bug",
1870b57cec5SDimitry Andric  "LDSMisalignedBug",
1880b57cec5SDimitry Andric  "true",
189e8d8bef9SDimitry Andric  "Some GFX10 bug with multi-dword LDS and flat access that is not naturally aligned in WGP mode"
1900b57cec5SDimitry Andric>;
1910b57cec5SDimitry Andric
1928bcb0991SDimitry Andricdef FeatureMFMAInlineLiteralBug : SubtargetFeature<"mfma-inline-literal-bug",
1938bcb0991SDimitry Andric  "HasMFMAInlineLiteralBug",
1948bcb0991SDimitry Andric  "true",
1958bcb0991SDimitry Andric  "MFMA cannot use inline literal as SrcC"
1968bcb0991SDimitry Andric>;
1978bcb0991SDimitry Andric
1980b57cec5SDimitry Andricdef FeatureVcmpxPermlaneHazard : SubtargetFeature<"vcmpx-permlane-hazard",
1990b57cec5SDimitry Andric  "HasVcmpxPermlaneHazard",
2000b57cec5SDimitry Andric  "true",
2010b57cec5SDimitry Andric  "TODO: describe me"
2020b57cec5SDimitry Andric>;
2030b57cec5SDimitry Andric
2040b57cec5SDimitry Andricdef FeatureVMEMtoScalarWriteHazard : SubtargetFeature<"vmem-to-scalar-write-hazard",
2050b57cec5SDimitry Andric  "HasVMEMtoScalarWriteHazard",
2060b57cec5SDimitry Andric  "true",
2070b57cec5SDimitry Andric  "VMEM instruction followed by scalar writing to EXEC mask, M0 or SGPR leads to incorrect execution."
2080b57cec5SDimitry Andric>;
2090b57cec5SDimitry Andric
2100b57cec5SDimitry Andricdef FeatureSMEMtoVectorWriteHazard : SubtargetFeature<"smem-to-vector-write-hazard",
2110b57cec5SDimitry Andric  "HasSMEMtoVectorWriteHazard",
2120b57cec5SDimitry Andric  "true",
2130b57cec5SDimitry Andric  "s_load_dword followed by v_cmp page faults"
2140b57cec5SDimitry Andric>;
2150b57cec5SDimitry Andric
2160b57cec5SDimitry Andricdef FeatureInstFwdPrefetchBug : SubtargetFeature<"inst-fwd-prefetch-bug",
2170b57cec5SDimitry Andric  "HasInstFwdPrefetchBug",
2180b57cec5SDimitry Andric  "true",
2190b57cec5SDimitry Andric  "S_INST_PREFETCH instruction causes shader to hang"
2200b57cec5SDimitry Andric>;
2210b57cec5SDimitry Andric
2220b57cec5SDimitry Andricdef FeatureVcmpxExecWARHazard : SubtargetFeature<"vcmpx-exec-war-hazard",
2230b57cec5SDimitry Andric  "HasVcmpxExecWARHazard",
2240b57cec5SDimitry Andric  "true",
2250b57cec5SDimitry Andric  "V_CMPX WAR hazard on EXEC (V_CMPX issue ONLY)"
2260b57cec5SDimitry Andric>;
2270b57cec5SDimitry Andric
2280b57cec5SDimitry Andricdef FeatureLdsBranchVmemWARHazard : SubtargetFeature<"lds-branch-vmem-war-hazard",
2290b57cec5SDimitry Andric  "HasLdsBranchVmemWARHazard",
2300b57cec5SDimitry Andric  "true",
2310b57cec5SDimitry Andric  "Switching between LDS and VMEM-tex not waiting VM_VSRC=0"
2320b57cec5SDimitry Andric>;
2330b57cec5SDimitry Andric
2340b57cec5SDimitry Andricdef FeatureNSAtoVMEMBug : SubtargetFeature<"nsa-to-vmem-bug",
2350b57cec5SDimitry Andric  "HasNSAtoVMEMBug",
2360b57cec5SDimitry Andric  "true",
2370b57cec5SDimitry Andric  "MIMG-NSA followed by VMEM fail if EXEC_LO or EXEC_HI equals zero"
2380b57cec5SDimitry Andric>;
2390b57cec5SDimitry Andric
240fe6060f1SDimitry Andricdef FeatureNSAClauseBug : SubtargetFeature<"nsa-clause-bug",
241fe6060f1SDimitry Andric  "HasNSAClauseBug",
242fe6060f1SDimitry Andric  "true",
243fe6060f1SDimitry Andric  "MIMG-NSA in a hard clause has unpredictable results on GFX10.1"
244fe6060f1SDimitry Andric>;
245fe6060f1SDimitry Andric
2460b57cec5SDimitry Andricdef FeatureFlatSegmentOffsetBug : SubtargetFeature<"flat-segment-offset-bug",
2470b57cec5SDimitry Andric  "HasFlatSegmentOffsetBug",
2480b57cec5SDimitry Andric  "true",
249fe6060f1SDimitry Andric  "GFX10 bug where inst_offset is ignored when flat instructions access global memory"
250fe6060f1SDimitry Andric>;
251fe6060f1SDimitry Andric
252fe6060f1SDimitry Andricdef FeatureNegativeScratchOffsetBug : SubtargetFeature<"negative-scratch-offset-bug",
253fe6060f1SDimitry Andric  "NegativeScratchOffsetBug",
254fe6060f1SDimitry Andric  "true",
255fe6060f1SDimitry Andric  "Negative immediate offsets in scratch instructions with an SGPR offset page fault on GFX9"
256fe6060f1SDimitry Andric>;
257fe6060f1SDimitry Andric
258fe6060f1SDimitry Andricdef FeatureNegativeUnalignedScratchOffsetBug : SubtargetFeature<"negative-unaligned-scratch-offset-bug",
259fe6060f1SDimitry Andric  "NegativeUnalignedScratchOffsetBug",
260fe6060f1SDimitry Andric  "true",
261fe6060f1SDimitry Andric  "Scratch instructions with a VGPR offset and a negative immediate offset that is not a multiple of 4 read wrong memory on GFX10"
2620b57cec5SDimitry Andric>;
2630b57cec5SDimitry Andric
2640b57cec5SDimitry Andricdef FeatureOffset3fBug : SubtargetFeature<"offset-3f-bug",
2650b57cec5SDimitry Andric  "HasOffset3fBug",
2660b57cec5SDimitry Andric  "true",
2670b57cec5SDimitry Andric  "Branch offset of 3f hardware bug"
2680b57cec5SDimitry Andric>;
2690b57cec5SDimitry Andric
270e8d8bef9SDimitry Andricdef FeatureImageStoreD16Bug : SubtargetFeature<"image-store-d16-bug",
271e8d8bef9SDimitry Andric  "HasImageStoreD16Bug",
272e8d8bef9SDimitry Andric  "true",
273e8d8bef9SDimitry Andric  "Image Store D16 hardware bug"
274e8d8bef9SDimitry Andric>;
275e8d8bef9SDimitry Andric
276e8d8bef9SDimitry Andricdef FeatureImageGather4D16Bug : SubtargetFeature<"image-gather4-d16-bug",
277e8d8bef9SDimitry Andric  "HasImageGather4D16Bug",
278e8d8bef9SDimitry Andric  "true",
279e8d8bef9SDimitry Andric  "Image Gather4 D16 hardware bug"
280e8d8bef9SDimitry Andric>;
281e8d8bef9SDimitry Andric
2820b57cec5SDimitry Andricclass SubtargetFeatureLDSBankCount <int Value> : SubtargetFeature <
2830b57cec5SDimitry Andric  "ldsbankcount"#Value,
2840b57cec5SDimitry Andric  "LDSBankCount",
2850b57cec5SDimitry Andric  !cast<string>(Value),
2860b57cec5SDimitry Andric  "The number of LDS banks per compute unit."
2870b57cec5SDimitry Andric>;
2880b57cec5SDimitry Andric
2890b57cec5SDimitry Andricdef FeatureLDSBankCount16 : SubtargetFeatureLDSBankCount<16>;
2900b57cec5SDimitry Andricdef FeatureLDSBankCount32 : SubtargetFeatureLDSBankCount<32>;
2910b57cec5SDimitry Andric
2920b57cec5SDimitry Andricdef FeatureGCN3Encoding : SubtargetFeature<"gcn3-encoding",
2930b57cec5SDimitry Andric  "GCN3Encoding",
2940b57cec5SDimitry Andric  "true",
2950b57cec5SDimitry Andric  "Encoding format for VI"
2960b57cec5SDimitry Andric>;
2970b57cec5SDimitry Andric
2980b57cec5SDimitry Andricdef FeatureCIInsts : SubtargetFeature<"ci-insts",
2990b57cec5SDimitry Andric  "CIInsts",
3000b57cec5SDimitry Andric  "true",
3010b57cec5SDimitry Andric  "Additional instructions for CI+"
3020b57cec5SDimitry Andric>;
3030b57cec5SDimitry Andric
3040b57cec5SDimitry Andricdef FeatureGFX8Insts : SubtargetFeature<"gfx8-insts",
3050b57cec5SDimitry Andric  "GFX8Insts",
3060b57cec5SDimitry Andric  "true",
3070b57cec5SDimitry Andric  "Additional instructions for GFX8+"
3080b57cec5SDimitry Andric>;
3090b57cec5SDimitry Andric
3100b57cec5SDimitry Andricdef FeatureGFX9Insts : SubtargetFeature<"gfx9-insts",
3110b57cec5SDimitry Andric  "GFX9Insts",
3120b57cec5SDimitry Andric  "true",
3130b57cec5SDimitry Andric  "Additional instructions for GFX9+"
3140b57cec5SDimitry Andric>;
3150b57cec5SDimitry Andric
316fe6060f1SDimitry Andricdef FeatureGFX90AInsts : SubtargetFeature<"gfx90a-insts",
317fe6060f1SDimitry Andric  "GFX90AInsts",
318fe6060f1SDimitry Andric  "true",
319fe6060f1SDimitry Andric  "Additional instructions for GFX90A+"
320fe6060f1SDimitry Andric>;
321fe6060f1SDimitry Andric
322*81ad6265SDimitry Andricdef FeatureGFX940Insts : SubtargetFeature<"gfx940-insts",
323*81ad6265SDimitry Andric  "GFX940Insts",
324*81ad6265SDimitry Andric  "true",
325*81ad6265SDimitry Andric  "Additional instructions for GFX940+"
326*81ad6265SDimitry Andric>;
327*81ad6265SDimitry Andric
3280b57cec5SDimitry Andricdef FeatureGFX10Insts : SubtargetFeature<"gfx10-insts",
3290b57cec5SDimitry Andric  "GFX10Insts",
3300b57cec5SDimitry Andric  "true",
3310b57cec5SDimitry Andric  "Additional instructions for GFX10+"
3320b57cec5SDimitry Andric>;
3330b57cec5SDimitry Andric
334*81ad6265SDimitry Andricdef FeatureGFX11Insts : SubtargetFeature<"gfx11-insts",
335*81ad6265SDimitry Andric  "GFX11Insts",
336*81ad6265SDimitry Andric  "true",
337*81ad6265SDimitry Andric  "Additional instructions for GFX11+"
338*81ad6265SDimitry Andric>;
339*81ad6265SDimitry Andric
3405ffd83dbSDimitry Andricdef FeatureGFX10_3Insts : SubtargetFeature<"gfx10-3-insts",
3415ffd83dbSDimitry Andric  "GFX10_3Insts",
3425ffd83dbSDimitry Andric  "true",
3435ffd83dbSDimitry Andric  "Additional instructions for GFX10.3"
3445ffd83dbSDimitry Andric>;
3455ffd83dbSDimitry Andric
3460b57cec5SDimitry Andricdef FeatureGFX7GFX8GFX9Insts : SubtargetFeature<"gfx7-gfx8-gfx9-insts",
3470b57cec5SDimitry Andric  "GFX7GFX8GFX9Insts",
3480b57cec5SDimitry Andric  "true",
3490b57cec5SDimitry Andric  "Instructions shared in GFX7, GFX8, GFX9"
3500b57cec5SDimitry Andric>;
3510b57cec5SDimitry Andric
3520b57cec5SDimitry Andricdef FeatureSMemRealTime : SubtargetFeature<"s-memrealtime",
3530b57cec5SDimitry Andric  "HasSMemRealTime",
3540b57cec5SDimitry Andric  "true",
3550b57cec5SDimitry Andric  "Has s_memrealtime instruction"
3560b57cec5SDimitry Andric>;
3570b57cec5SDimitry Andric
3580b57cec5SDimitry Andricdef FeatureInv2PiInlineImm : SubtargetFeature<"inv-2pi-inline-imm",
3590b57cec5SDimitry Andric  "HasInv2PiInlineImm",
3600b57cec5SDimitry Andric  "true",
3610b57cec5SDimitry Andric  "Has 1 / (2 * pi) as inline immediate"
3620b57cec5SDimitry Andric>;
3630b57cec5SDimitry Andric
3640b57cec5SDimitry Andricdef Feature16BitInsts : SubtargetFeature<"16-bit-insts",
3650b57cec5SDimitry Andric  "Has16BitInsts",
3660b57cec5SDimitry Andric  "true",
3670b57cec5SDimitry Andric  "Has i16/f16 instructions"
3680b57cec5SDimitry Andric>;
3690b57cec5SDimitry Andric
370*81ad6265SDimitry Andricdef FeatureTrue16BitInsts : SubtargetFeature<"true16",
371*81ad6265SDimitry Andric  "HasTrue16BitInsts",
372*81ad6265SDimitry Andric  "true",
373*81ad6265SDimitry Andric  "True 16-bit operand instructions"
374*81ad6265SDimitry Andric>;
375*81ad6265SDimitry Andric
3760b57cec5SDimitry Andricdef FeatureVOP3P : SubtargetFeature<"vop3p",
3770b57cec5SDimitry Andric  "HasVOP3PInsts",
3780b57cec5SDimitry Andric  "true",
3790b57cec5SDimitry Andric  "Has VOP3P packed instructions"
3800b57cec5SDimitry Andric>;
3810b57cec5SDimitry Andric
3820b57cec5SDimitry Andricdef FeatureMovrel : SubtargetFeature<"movrel",
3830b57cec5SDimitry Andric  "HasMovrel",
3840b57cec5SDimitry Andric  "true",
3850b57cec5SDimitry Andric  "Has v_movrel*_b32 instructions"
3860b57cec5SDimitry Andric>;
3870b57cec5SDimitry Andric
3880b57cec5SDimitry Andricdef FeatureVGPRIndexMode : SubtargetFeature<"vgpr-index-mode",
3890b57cec5SDimitry Andric  "HasVGPRIndexMode",
3900b57cec5SDimitry Andric  "true",
3910b57cec5SDimitry Andric  "Has VGPR mode register indexing"
3920b57cec5SDimitry Andric>;
3930b57cec5SDimitry Andric
3940b57cec5SDimitry Andricdef FeatureScalarStores : SubtargetFeature<"scalar-stores",
3950b57cec5SDimitry Andric  "HasScalarStores",
3960b57cec5SDimitry Andric  "true",
3970b57cec5SDimitry Andric  "Has store scalar memory instructions"
3980b57cec5SDimitry Andric>;
3990b57cec5SDimitry Andric
4000b57cec5SDimitry Andricdef FeatureScalarAtomics : SubtargetFeature<"scalar-atomics",
4010b57cec5SDimitry Andric  "HasScalarAtomics",
4020b57cec5SDimitry Andric  "true",
4030b57cec5SDimitry Andric  "Has atomic scalar memory instructions"
4040b57cec5SDimitry Andric>;
4050b57cec5SDimitry Andric
4060b57cec5SDimitry Andricdef FeatureSDWA : SubtargetFeature<"sdwa",
4070b57cec5SDimitry Andric  "HasSDWA",
4080b57cec5SDimitry Andric  "true",
4090b57cec5SDimitry Andric  "Support SDWA (Sub-DWORD Addressing) extension"
4100b57cec5SDimitry Andric>;
4110b57cec5SDimitry Andric
4120b57cec5SDimitry Andricdef FeatureSDWAOmod : SubtargetFeature<"sdwa-omod",
4130b57cec5SDimitry Andric  "HasSDWAOmod",
4140b57cec5SDimitry Andric  "true",
4150b57cec5SDimitry Andric  "Support OMod with SDWA (Sub-DWORD Addressing) extension"
4160b57cec5SDimitry Andric>;
4170b57cec5SDimitry Andric
4180b57cec5SDimitry Andricdef FeatureSDWAScalar : SubtargetFeature<"sdwa-scalar",
4190b57cec5SDimitry Andric  "HasSDWAScalar",
4200b57cec5SDimitry Andric  "true",
4210b57cec5SDimitry Andric  "Support scalar register with SDWA (Sub-DWORD Addressing) extension"
4220b57cec5SDimitry Andric>;
4230b57cec5SDimitry Andric
4240b57cec5SDimitry Andricdef FeatureSDWASdst : SubtargetFeature<"sdwa-sdst",
4250b57cec5SDimitry Andric  "HasSDWASdst",
4260b57cec5SDimitry Andric  "true",
4270b57cec5SDimitry Andric  "Support scalar dst for VOPC with SDWA (Sub-DWORD Addressing) extension"
4280b57cec5SDimitry Andric>;
4290b57cec5SDimitry Andric
4300b57cec5SDimitry Andricdef FeatureSDWAMac : SubtargetFeature<"sdwa-mav",
4310b57cec5SDimitry Andric  "HasSDWAMac",
4320b57cec5SDimitry Andric  "true",
4330b57cec5SDimitry Andric  "Support v_mac_f32/f16 with SDWA (Sub-DWORD Addressing) extension"
4340b57cec5SDimitry Andric>;
4350b57cec5SDimitry Andric
4360b57cec5SDimitry Andricdef FeatureSDWAOutModsVOPC : SubtargetFeature<"sdwa-out-mods-vopc",
4370b57cec5SDimitry Andric  "HasSDWAOutModsVOPC",
4380b57cec5SDimitry Andric  "true",
4390b57cec5SDimitry Andric  "Support clamp for VOPC with SDWA (Sub-DWORD Addressing) extension"
4400b57cec5SDimitry Andric>;
4410b57cec5SDimitry Andric
4420b57cec5SDimitry Andricdef FeatureDPP : SubtargetFeature<"dpp",
4430b57cec5SDimitry Andric  "HasDPP",
4440b57cec5SDimitry Andric  "true",
4450b57cec5SDimitry Andric  "Support DPP (Data Parallel Primitives) extension"
4460b57cec5SDimitry Andric>;
4470b57cec5SDimitry Andric
448349cc55cSDimitry Andric// DPP8 allows arbitrary cross-lane swizzling within groups of 8 lanes.
4490b57cec5SDimitry Andricdef FeatureDPP8 : SubtargetFeature<"dpp8",
4500b57cec5SDimitry Andric  "HasDPP8",
4510b57cec5SDimitry Andric  "true",
4520b57cec5SDimitry Andric  "Support DPP8 (Data Parallel Primitives) extension"
4530b57cec5SDimitry Andric>;
4540b57cec5SDimitry Andric
455fe6060f1SDimitry Andricdef Feature64BitDPP : SubtargetFeature<"dpp-64bit",
456fe6060f1SDimitry Andric  "Has64BitDPP",
457fe6060f1SDimitry Andric  "true",
458fe6060f1SDimitry Andric  "Support DPP (Data Parallel Primitives) extension"
459fe6060f1SDimitry Andric>;
460fe6060f1SDimitry Andric
461fe6060f1SDimitry Andricdef FeaturePackedFP32Ops : SubtargetFeature<"packed-fp32-ops",
462fe6060f1SDimitry Andric  "HasPackedFP32Ops",
463fe6060f1SDimitry Andric  "true",
464fe6060f1SDimitry Andric  "Support packed fp32 instructions"
465fe6060f1SDimitry Andric>;
466fe6060f1SDimitry Andric
4670b57cec5SDimitry Andricdef FeatureR128A16 : SubtargetFeature<"r128-a16",
4680b57cec5SDimitry Andric  "HasR128A16",
4690b57cec5SDimitry Andric  "true",
4705ffd83dbSDimitry Andric  "Support gfx9-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands, where a16 is aliased with r128"
4715ffd83dbSDimitry Andric>;
4725ffd83dbSDimitry Andric
4735ffd83dbSDimitry Andricdef FeatureGFX10A16 : SubtargetFeature<"a16",
4745ffd83dbSDimitry Andric  "HasGFX10A16",
4755ffd83dbSDimitry Andric  "true",
4765ffd83dbSDimitry Andric  "Support gfx10-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands"
4775ffd83dbSDimitry Andric>;
4785ffd83dbSDimitry Andric
4795ffd83dbSDimitry Andricdef FeatureG16 : SubtargetFeature<"g16",
4805ffd83dbSDimitry Andric  "HasG16",
4815ffd83dbSDimitry Andric  "true",
4825ffd83dbSDimitry Andric  "Support G16 for 16-bit gradient image operands"
4830b57cec5SDimitry Andric>;
4840b57cec5SDimitry Andric
4850b57cec5SDimitry Andricdef FeatureNSAEncoding : SubtargetFeature<"nsa-encoding",
4860b57cec5SDimitry Andric  "HasNSAEncoding",
4870b57cec5SDimitry Andric  "true",
4880b57cec5SDimitry Andric  "Support NSA encoding for image instructions"
4890b57cec5SDimitry Andric>;
4900b57cec5SDimitry Andric
491*81ad6265SDimitry Andricdef FeatureImageInsts : SubtargetFeature<"image-insts",
492*81ad6265SDimitry Andric  "HasImageInsts",
493*81ad6265SDimitry Andric  "true",
494*81ad6265SDimitry Andric  "Support image instructions"
495*81ad6265SDimitry Andric>;
496*81ad6265SDimitry Andric
497fe6060f1SDimitry Andricdef FeatureExtendedImageInsts : SubtargetFeature<"extended-image-insts",
498fe6060f1SDimitry Andric  "HasExtendedImageInsts",
499fe6060f1SDimitry Andric  "true",
500fe6060f1SDimitry Andric  "Support mips != 0, lod != 0, gather4, and get_lod"
501fe6060f1SDimitry Andric>;
502fe6060f1SDimitry Andric
503fe6060f1SDimitry Andricdef FeatureGFX10_AEncoding : SubtargetFeature<"gfx10_a-encoding",
504fe6060f1SDimitry Andric  "GFX10_AEncoding",
505fe6060f1SDimitry Andric  "true",
506fe6060f1SDimitry Andric  "Has BVH ray tracing instructions"
507fe6060f1SDimitry Andric>;
508fe6060f1SDimitry Andric
5095ffd83dbSDimitry Andricdef FeatureGFX10_BEncoding : SubtargetFeature<"gfx10_b-encoding",
5105ffd83dbSDimitry Andric  "GFX10_BEncoding",
5115ffd83dbSDimitry Andric  "true",
5125ffd83dbSDimitry Andric  "Encoding format GFX10_B"
5135ffd83dbSDimitry Andric>;
5145ffd83dbSDimitry Andric
5150b57cec5SDimitry Andricdef FeatureIntClamp : SubtargetFeature<"int-clamp-insts",
5160b57cec5SDimitry Andric  "HasIntClamp",
5170b57cec5SDimitry Andric  "true",
5180b57cec5SDimitry Andric  "Support clamp for integer destination"
5190b57cec5SDimitry Andric>;
5200b57cec5SDimitry Andric
5210b57cec5SDimitry Andricdef FeatureUnpackedD16VMem : SubtargetFeature<"unpacked-d16-vmem",
5220b57cec5SDimitry Andric  "HasUnpackedD16VMem",
5230b57cec5SDimitry Andric  "true",
5240b57cec5SDimitry Andric  "Has unpacked d16 vmem instructions"
5250b57cec5SDimitry Andric>;
5260b57cec5SDimitry Andric
5270b57cec5SDimitry Andricdef FeatureDLInsts : SubtargetFeature<"dl-insts",
5280b57cec5SDimitry Andric  "HasDLInsts",
5290b57cec5SDimitry Andric  "true",
5300b57cec5SDimitry Andric  "Has v_fmac_f32 and v_xnor_b32 instructions"
5310b57cec5SDimitry Andric>;
5320b57cec5SDimitry Andric
5330b57cec5SDimitry Andricdef FeatureDot1Insts : SubtargetFeature<"dot1-insts",
5340b57cec5SDimitry Andric  "HasDot1Insts",
5350b57cec5SDimitry Andric  "true",
5360b57cec5SDimitry Andric  "Has v_dot4_i32_i8 and v_dot8_i32_i4 instructions"
5370b57cec5SDimitry Andric>;
5380b57cec5SDimitry Andric
5390b57cec5SDimitry Andricdef FeatureDot2Insts : SubtargetFeature<"dot2-insts",
5400b57cec5SDimitry Andric  "HasDot2Insts",
5410b57cec5SDimitry Andric  "true",
542fe6060f1SDimitry Andric  "Has v_dot2_i32_i16, v_dot2_u32_u16 instructions"
5430b57cec5SDimitry Andric>;
5440b57cec5SDimitry Andric
5450b57cec5SDimitry Andricdef FeatureDot3Insts : SubtargetFeature<"dot3-insts",
5460b57cec5SDimitry Andric  "HasDot3Insts",
5470b57cec5SDimitry Andric  "true",
5480b57cec5SDimitry Andric  "Has v_dot8c_i32_i4 instruction"
5490b57cec5SDimitry Andric>;
5500b57cec5SDimitry Andric
5510b57cec5SDimitry Andricdef FeatureDot4Insts : SubtargetFeature<"dot4-insts",
5520b57cec5SDimitry Andric  "HasDot4Insts",
5530b57cec5SDimitry Andric  "true",
5540b57cec5SDimitry Andric  "Has v_dot2c_i32_i16 instruction"
5550b57cec5SDimitry Andric>;
5560b57cec5SDimitry Andric
5570b57cec5SDimitry Andricdef FeatureDot5Insts : SubtargetFeature<"dot5-insts",
5580b57cec5SDimitry Andric  "HasDot5Insts",
5590b57cec5SDimitry Andric  "true",
5600b57cec5SDimitry Andric  "Has v_dot2c_f32_f16 instruction"
5610b57cec5SDimitry Andric>;
5620b57cec5SDimitry Andric
5630b57cec5SDimitry Andricdef FeatureDot6Insts : SubtargetFeature<"dot6-insts",
5640b57cec5SDimitry Andric  "HasDot6Insts",
5650b57cec5SDimitry Andric  "true",
5660b57cec5SDimitry Andric  "Has v_dot4c_i32_i8 instruction"
5670b57cec5SDimitry Andric>;
5680b57cec5SDimitry Andric
569fe6060f1SDimitry Andricdef FeatureDot7Insts : SubtargetFeature<"dot7-insts",
570fe6060f1SDimitry Andric  "HasDot7Insts",
571fe6060f1SDimitry Andric  "true",
572fe6060f1SDimitry Andric  "Has v_dot2_f32_f16, v_dot4_u32_u8, v_dot8_u32_u4 instructions"
573fe6060f1SDimitry Andric>;
574fe6060f1SDimitry Andric
575*81ad6265SDimitry Andricdef FeatureDot8Insts : SubtargetFeature<"dot8-insts",
576*81ad6265SDimitry Andric  "HasDot8Insts",
577*81ad6265SDimitry Andric  "true",
578*81ad6265SDimitry Andric  "Has v_dot2_f16_f16, v_dot2_bf16_bf16, v_dot2_f32_bf16, "
579*81ad6265SDimitry Andric  "v_dot4_i32_iu8, v_dot8_i32_iu4 instructions"
580*81ad6265SDimitry Andric>;
581*81ad6265SDimitry Andric
5820b57cec5SDimitry Andricdef FeatureMAIInsts : SubtargetFeature<"mai-insts",
5830b57cec5SDimitry Andric  "HasMAIInsts",
5840b57cec5SDimitry Andric  "true",
5850b57cec5SDimitry Andric  "Has mAI instructions"
5860b57cec5SDimitry Andric>;
5870b57cec5SDimitry Andric
5880b57cec5SDimitry Andricdef FeaturePkFmacF16Inst : SubtargetFeature<"pk-fmac-f16-inst",
5890b57cec5SDimitry Andric  "HasPkFmacF16Inst",
5900b57cec5SDimitry Andric  "true",
5910b57cec5SDimitry Andric  "Has v_pk_fmac_f16 instruction"
5920b57cec5SDimitry Andric>;
5930b57cec5SDimitry Andric
594*81ad6265SDimitry Andricdef FeatureAtomicFaddRtnInsts : SubtargetFeature<"atomic-fadd-rtn-insts",
595*81ad6265SDimitry Andric  "HasAtomicFaddRtnInsts",
5960b57cec5SDimitry Andric  "true",
597*81ad6265SDimitry Andric  "Has buffer_atomic_add_f32 and global_atomic_add_f32 instructions that "
598*81ad6265SDimitry Andric  "return original value",
599*81ad6265SDimitry Andric  [FeatureFlatGlobalInsts]
600*81ad6265SDimitry Andric>;
601*81ad6265SDimitry Andric
602*81ad6265SDimitry Andricdef FeatureAtomicFaddNoRtnInsts : SubtargetFeature<"atomic-fadd-no-rtn-insts",
603*81ad6265SDimitry Andric  "HasAtomicFaddNoRtnInsts",
604*81ad6265SDimitry Andric  "true",
605*81ad6265SDimitry Andric  "Has buffer_atomic_add_f32 and global_atomic_add_f32 instructions that "
606*81ad6265SDimitry Andric  "don't return original value",
607*81ad6265SDimitry Andric  [FeatureFlatGlobalInsts]
608*81ad6265SDimitry Andric>;
609*81ad6265SDimitry Andric
610*81ad6265SDimitry Andricdef FeatureAtomicPkFaddNoRtnInsts
611*81ad6265SDimitry Andric  : SubtargetFeature<"atomic-pk-fadd-no-rtn-insts",
612*81ad6265SDimitry Andric  "HasAtomicPkFaddNoRtnInsts",
613*81ad6265SDimitry Andric  "true",
614*81ad6265SDimitry Andric  "Has buffer_atomic_pk_add_f16 and global_atomic_pk_add_f16 instructions that "
615*81ad6265SDimitry Andric  "don't return original value",
6165ffd83dbSDimitry Andric  [FeatureFlatGlobalInsts]
6170b57cec5SDimitry Andric>;
6180b57cec5SDimitry Andric
619e8d8bef9SDimitry Andricdef FeatureSupportsSRAMECC : SubtargetFeature<"sramecc-support",
620e8d8bef9SDimitry Andric  "SupportsSRAMECC",
6210b57cec5SDimitry Andric  "true",
622e8d8bef9SDimitry Andric  "Hardware supports SRAMECC"
6230b57cec5SDimitry Andric>;
6240b57cec5SDimitry Andric
625e8d8bef9SDimitry Andricdef FeatureSRAMECC : SubtargetFeature<"sramecc",
6260b57cec5SDimitry Andric  "EnableSRAMECC",
6270b57cec5SDimitry Andric  "true",
6280b57cec5SDimitry Andric  "Enable SRAMECC"
6290b57cec5SDimitry Andric>;
6300b57cec5SDimitry Andric
6310b57cec5SDimitry Andricdef FeatureNoSdstCMPX : SubtargetFeature<"no-sdst-cmpx",
6320b57cec5SDimitry Andric  "HasNoSdstCMPX",
6330b57cec5SDimitry Andric  "true",
6340b57cec5SDimitry Andric  "V_CMPX does not write VCC/SGPR in addition to EXEC"
6350b57cec5SDimitry Andric>;
6360b57cec5SDimitry Andric
6370b57cec5SDimitry Andricdef FeatureVscnt : SubtargetFeature<"vscnt",
6380b57cec5SDimitry Andric  "HasVscnt",
6390b57cec5SDimitry Andric  "true",
6400b57cec5SDimitry Andric  "Has separate store vscnt counter"
6410b57cec5SDimitry Andric>;
6420b57cec5SDimitry Andric
6435ffd83dbSDimitry Andricdef FeatureGetWaveIdInst : SubtargetFeature<"get-wave-id-inst",
6445ffd83dbSDimitry Andric  "HasGetWaveIdInst",
6455ffd83dbSDimitry Andric  "true",
6465ffd83dbSDimitry Andric  "Has s_get_waveid_in_workgroup instruction"
6475ffd83dbSDimitry Andric>;
6485ffd83dbSDimitry Andric
6495ffd83dbSDimitry Andricdef FeatureSMemTimeInst : SubtargetFeature<"s-memtime-inst",
6505ffd83dbSDimitry Andric  "HasSMemTimeInst",
6515ffd83dbSDimitry Andric  "true",
6525ffd83dbSDimitry Andric  "Has s_memtime instruction"
6535ffd83dbSDimitry Andric>;
6545ffd83dbSDimitry Andric
655fe6060f1SDimitry Andricdef FeatureShaderCyclesRegister : SubtargetFeature<"shader-cycles-register",
656fe6060f1SDimitry Andric  "HasShaderCyclesRegister",
657fe6060f1SDimitry Andric  "true",
658fe6060f1SDimitry Andric  "Has SHADER_CYCLES hardware register"
659fe6060f1SDimitry Andric>;
660fe6060f1SDimitry Andric
6615ffd83dbSDimitry Andricdef FeatureMadMacF32Insts : SubtargetFeature<"mad-mac-f32-insts",
6625ffd83dbSDimitry Andric  "HasMadMacF32Insts",
6635ffd83dbSDimitry Andric  "true",
6645ffd83dbSDimitry Andric  "Has v_mad_f32/v_mac_f32/v_madak_f32/v_madmk_f32 instructions"
6655ffd83dbSDimitry Andric>;
6665ffd83dbSDimitry Andric
6675ffd83dbSDimitry Andricdef FeatureDsSrc2Insts : SubtargetFeature<"ds-src2-insts",
6685ffd83dbSDimitry Andric  "HasDsSrc2Insts",
6695ffd83dbSDimitry Andric  "true",
6705ffd83dbSDimitry Andric  "Has ds_*_src2 instructions"
6715ffd83dbSDimitry Andric>;
6725ffd83dbSDimitry Andric
6730b57cec5SDimitry Andricdef FeatureVOP3Literal : SubtargetFeature<"vop3-literal",
6740b57cec5SDimitry Andric  "HasVOP3Literal",
6750b57cec5SDimitry Andric  "true",
6760b57cec5SDimitry Andric  "Can use one literal in VOP3"
6770b57cec5SDimitry Andric>;
6780b57cec5SDimitry Andric
6790b57cec5SDimitry Andricdef FeatureNoDataDepHazard : SubtargetFeature<"no-data-dep-hazard",
6800b57cec5SDimitry Andric  "HasNoDataDepHazard",
6810b57cec5SDimitry Andric  "true",
6820b57cec5SDimitry Andric  "Does not need SW waitstates"
6830b57cec5SDimitry Andric>;
6840b57cec5SDimitry Andric
685fe6060f1SDimitry Andricclass SubtargetFeatureNSAMaxSize <int Value> : SubtargetFeature <
686fe6060f1SDimitry Andric  "nsa-max-size-"#Value,
687fe6060f1SDimitry Andric  "NSAMaxSize",
688fe6060f1SDimitry Andric  !cast<string>(Value),
689fe6060f1SDimitry Andric  "The maximum non-sequential address size in VGPRs."
690fe6060f1SDimitry Andric>;
691fe6060f1SDimitry Andric
692fe6060f1SDimitry Andricdef FeatureNSAMaxSize5 : SubtargetFeatureNSAMaxSize<5>;
693fe6060f1SDimitry Andricdef FeatureNSAMaxSize13 : SubtargetFeatureNSAMaxSize<13>;
694fe6060f1SDimitry Andric
695*81ad6265SDimitry Andricdef FeatureVOPD : SubtargetFeature<"vopd",
696*81ad6265SDimitry Andric  "HasVOPDInsts",
697*81ad6265SDimitry Andric  "true",
698*81ad6265SDimitry Andric  "Has VOPD dual issue wave32 instructions"
699*81ad6265SDimitry Andric>;
700*81ad6265SDimitry Andric
7010b57cec5SDimitry Andric//===------------------------------------------------------------===//
7020b57cec5SDimitry Andric// Subtarget Features (options and debugging)
7030b57cec5SDimitry Andric//===------------------------------------------------------------===//
7040b57cec5SDimitry Andric
7050b57cec5SDimitry Andricclass FeatureMaxPrivateElementSize<int size> : SubtargetFeature<
7060b57cec5SDimitry Andric  "max-private-element-size-"#size,
7070b57cec5SDimitry Andric  "MaxPrivateElementSize",
7080b57cec5SDimitry Andric  !cast<string>(size),
7090b57cec5SDimitry Andric  "Maximum private access size may be "#size
7100b57cec5SDimitry Andric>;
7110b57cec5SDimitry Andric
7120b57cec5SDimitry Andricdef FeatureMaxPrivateElementSize4 : FeatureMaxPrivateElementSize<4>;
7130b57cec5SDimitry Andricdef FeatureMaxPrivateElementSize8 : FeatureMaxPrivateElementSize<8>;
7140b57cec5SDimitry Andricdef FeatureMaxPrivateElementSize16 : FeatureMaxPrivateElementSize<16>;
7150b57cec5SDimitry Andric
7160b57cec5SDimitry Andricdef FeatureDumpCode : SubtargetFeature <"DumpCode",
7170b57cec5SDimitry Andric  "DumpCode",
7180b57cec5SDimitry Andric  "true",
7190b57cec5SDimitry Andric  "Dump MachineInstrs in the CodeEmitter"
7200b57cec5SDimitry Andric>;
7210b57cec5SDimitry Andric
7220b57cec5SDimitry Andricdef FeatureDumpCodeLower : SubtargetFeature <"dumpcode",
7230b57cec5SDimitry Andric  "DumpCode",
7240b57cec5SDimitry Andric  "true",
7250b57cec5SDimitry Andric  "Dump MachineInstrs in the CodeEmitter"
7260b57cec5SDimitry Andric>;
7270b57cec5SDimitry Andric
7280b57cec5SDimitry Andric// XXX - This should probably be removed once enabled by default
7290b57cec5SDimitry Andricdef FeatureEnableLoadStoreOpt : SubtargetFeature <"load-store-opt",
7300b57cec5SDimitry Andric  "EnableLoadStoreOpt",
7310b57cec5SDimitry Andric  "true",
7320b57cec5SDimitry Andric  "Enable SI load/store optimizer pass"
7330b57cec5SDimitry Andric>;
7340b57cec5SDimitry Andric
7350b57cec5SDimitry Andric// Performance debugging feature. Allow using DS instruction immediate
7360b57cec5SDimitry Andric// offsets even if the base pointer can't be proven to be base. On SI,
7370b57cec5SDimitry Andric// base pointer values that won't give the same result as a 16-bit add
7380b57cec5SDimitry Andric// are not safe to fold, but this will override the conservative test
7390b57cec5SDimitry Andric// for the base pointer.
7400b57cec5SDimitry Andricdef FeatureEnableUnsafeDSOffsetFolding : SubtargetFeature <
7410b57cec5SDimitry Andric  "unsafe-ds-offset-folding",
7420b57cec5SDimitry Andric  "EnableUnsafeDSOffsetFolding",
7430b57cec5SDimitry Andric  "true",
7440b57cec5SDimitry Andric  "Force using DS instruction immediate offsets on SI"
7450b57cec5SDimitry Andric>;
7460b57cec5SDimitry Andric
7470b57cec5SDimitry Andricdef FeatureEnableSIScheduler : SubtargetFeature<"si-scheduler",
7480b57cec5SDimitry Andric  "EnableSIScheduler",
7490b57cec5SDimitry Andric  "true",
7500b57cec5SDimitry Andric  "Enable SI Machine Scheduler"
7510b57cec5SDimitry Andric>;
7520b57cec5SDimitry Andric
7530b57cec5SDimitry Andricdef FeatureEnableDS128 : SubtargetFeature<"enable-ds128",
7540b57cec5SDimitry Andric  "EnableDS128",
7550b57cec5SDimitry Andric  "true",
7560b57cec5SDimitry Andric  "Use ds_{read|write}_b128"
7570b57cec5SDimitry Andric>;
7580b57cec5SDimitry Andric
7590b57cec5SDimitry Andric// Sparse texture support requires that all result registers are zeroed when
7600b57cec5SDimitry Andric// PRTStrictNull is set to true. This feature is turned on for all architectures
7610b57cec5SDimitry Andric// but is enabled as a feature in case there are situations where PRTStrictNull
7620b57cec5SDimitry Andric// is disabled by the driver.
7630b57cec5SDimitry Andricdef FeatureEnablePRTStrictNull : SubtargetFeature<"enable-prt-strict-null",
7640b57cec5SDimitry Andric  "EnablePRTStrictNull",
7650b57cec5SDimitry Andric  "true",
7660b57cec5SDimitry Andric  "Enable zeroing of result registers for sparse texture fetches"
7670b57cec5SDimitry Andric>;
7680b57cec5SDimitry Andric
7690b57cec5SDimitry Andric// Unless +-flat-for-global is specified, turn on FlatForGlobal for
7700b57cec5SDimitry Andric// all OS-es on VI and newer hardware to avoid assertion failures due
7710b57cec5SDimitry Andric// to missing ADDR64 variants of MUBUF instructions.
7720b57cec5SDimitry Andric// FIXME: moveToVALU should be able to handle converting addr64 MUBUF
7730b57cec5SDimitry Andric// instructions.
7740b57cec5SDimitry Andric
7750b57cec5SDimitry Andricdef FeatureFlatForGlobal : SubtargetFeature<"flat-for-global",
7760b57cec5SDimitry Andric  "FlatForGlobal",
7770b57cec5SDimitry Andric  "true",
7780b57cec5SDimitry Andric  "Force to generate flat instruction for global"
7790b57cec5SDimitry Andric>;
7800b57cec5SDimitry Andric
7810b57cec5SDimitry Andricdef FeatureAutoWaitcntBeforeBarrier : SubtargetFeature <
7820b57cec5SDimitry Andric  "auto-waitcnt-before-barrier",
7830b57cec5SDimitry Andric  "AutoWaitcntBeforeBarrier",
7840b57cec5SDimitry Andric  "true",
7850b57cec5SDimitry Andric  "Hardware automatically inserts waitcnt before barrier"
7860b57cec5SDimitry Andric>;
7870b57cec5SDimitry Andric
7880b57cec5SDimitry Andricdef FeatureTrigReducedRange : SubtargetFeature<"trig-reduced-range",
7890b57cec5SDimitry Andric  "HasTrigReducedRange",
7900b57cec5SDimitry Andric  "true",
7910b57cec5SDimitry Andric  "Requires use of fract on arguments to trig instructions"
7920b57cec5SDimitry Andric>;
7930b57cec5SDimitry Andric
794e8d8bef9SDimitry Andric// Alignment enforcement is controlled by a configuration register:
795e8d8bef9SDimitry Andric// SH_MEM_CONFIG.alignment_mode
796e8d8bef9SDimitry Andricdef FeatureUnalignedAccessMode : SubtargetFeature<"unaligned-access-mode",
797e8d8bef9SDimitry Andric  "UnalignedAccessMode",
798e8d8bef9SDimitry Andric  "true",
799e8d8bef9SDimitry Andric  "Enable unaligned global, local and region loads and stores if the hardware"
800e8d8bef9SDimitry Andric  " supports it"
801e8d8bef9SDimitry Andric>;
802e8d8bef9SDimitry Andric
803fe6060f1SDimitry Andricdef FeaturePackedTID : SubtargetFeature<"packed-tid",
804fe6060f1SDimitry Andric  "HasPackedTID",
805fe6060f1SDimitry Andric  "true",
806fe6060f1SDimitry Andric  "Workitem IDs are packed into v0 at kernel launch"
807fe6060f1SDimitry Andric>;
808fe6060f1SDimitry Andric
809fe6060f1SDimitry Andricdef FeatureArchitectedFlatScratch : SubtargetFeature<"architected-flat-scratch",
810fe6060f1SDimitry Andric  "HasArchitectedFlatScratch",
811fe6060f1SDimitry Andric  "true",
812fe6060f1SDimitry Andric  "Flat Scratch register is a readonly SPI initialized architected register"
813fe6060f1SDimitry Andric>;
814fe6060f1SDimitry Andric
8150b57cec5SDimitry Andric// Dummy feature used to disable assembler instructions.
8160b57cec5SDimitry Andricdef FeatureDisable : SubtargetFeature<"",
8170b57cec5SDimitry Andric  "FeatureDisable","true",
8180b57cec5SDimitry Andric  "Dummy feature to disable assembler instructions"
8190b57cec5SDimitry Andric>;
8200b57cec5SDimitry Andric
8210b57cec5SDimitry Andricclass GCNSubtargetFeatureGeneration <string Value,
8220b57cec5SDimitry Andric                                     string FeatureName,
8230b57cec5SDimitry Andric                                     list<SubtargetFeature> Implies> :
8240b57cec5SDimitry Andric        SubtargetFeatureGeneration <Value, FeatureName, "GCNSubtarget", Implies>;
8250b57cec5SDimitry Andric
8260b57cec5SDimitry Andricdef FeatureSouthernIslands : GCNSubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
8270b57cec5SDimitry Andric    "southern-islands",
8280b57cec5SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize32768, FeatureMIMG_R128,
8295ffd83dbSDimitry Andric  FeatureWavefrontSize64, FeatureSMemTimeInst, FeatureMadMacF32Insts,
8305ffd83dbSDimitry Andric  FeatureDsSrc2Insts, FeatureLDSBankCount32, FeatureMovrel,
831*81ad6265SDimitry Andric  FeatureTrigReducedRange, FeatureExtendedImageInsts, FeatureImageInsts
832fe6060f1SDimitry Andric  ]
8330b57cec5SDimitry Andric>;
8340b57cec5SDimitry Andric
8350b57cec5SDimitry Andricdef FeatureSeaIslands : GCNSubtargetFeatureGeneration<"SEA_ISLANDS",
8360b57cec5SDimitry Andric    "sea-islands",
8370b57cec5SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
8380b57cec5SDimitry Andric  FeatureWavefrontSize64, FeatureFlatAddressSpace,
8390b57cec5SDimitry Andric  FeatureCIInsts, FeatureMovrel, FeatureTrigReducedRange,
8405ffd83dbSDimitry Andric  FeatureGFX7GFX8GFX9Insts, FeatureSMemTimeInst, FeatureMadMacF32Insts,
841*81ad6265SDimitry Andric  FeatureDsSrc2Insts, FeatureExtendedImageInsts, FeatureUnalignedBufferAccess,
842*81ad6265SDimitry Andric  FeatureImageInsts
843fe6060f1SDimitry Andric  ]
8440b57cec5SDimitry Andric>;
8450b57cec5SDimitry Andric
8460b57cec5SDimitry Andricdef FeatureVolcanicIslands : GCNSubtargetFeatureGeneration<"VOLCANIC_ISLANDS",
8470b57cec5SDimitry Andric  "volcanic-islands",
8480b57cec5SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
8490b57cec5SDimitry Andric   FeatureWavefrontSize64, FeatureFlatAddressSpace,
8500b57cec5SDimitry Andric   FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
8510b57cec5SDimitry Andric   FeatureSMemRealTime, FeatureVGPRIndexMode, FeatureMovrel,
8520b57cec5SDimitry Andric   FeatureScalarStores, FeatureInv2PiInlineImm,
8530b57cec5SDimitry Andric   FeatureSDWA, FeatureSDWAOutModsVOPC, FeatureSDWAMac, FeatureDPP,
8545ffd83dbSDimitry Andric   FeatureIntClamp, FeatureTrigReducedRange, FeatureGFX8Insts,
8555ffd83dbSDimitry Andric   FeatureGFX7GFX8GFX9Insts, FeatureSMemTimeInst, FeatureMadMacF32Insts,
856fe6060f1SDimitry Andric   FeatureDsSrc2Insts, FeatureExtendedImageInsts, FeatureFastDenormalF32,
857*81ad6265SDimitry Andric   FeatureUnalignedBufferAccess, FeatureImageInsts
858fe6060f1SDimitry Andric  ]
8590b57cec5SDimitry Andric>;
8600b57cec5SDimitry Andric
8610b57cec5SDimitry Andricdef FeatureGFX9 : GCNSubtargetFeatureGeneration<"GFX9",
8620b57cec5SDimitry Andric  "gfx9",
8630b57cec5SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize65536,
8640b57cec5SDimitry Andric   FeatureWavefrontSize64, FeatureFlatAddressSpace,
8650b57cec5SDimitry Andric   FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
8660b57cec5SDimitry Andric   FeatureSMemRealTime, FeatureScalarStores, FeatureInv2PiInlineImm,
8670b57cec5SDimitry Andric   FeatureApertureRegs, FeatureGFX9Insts, FeatureVOP3P, FeatureVGPRIndexMode,
8680b57cec5SDimitry Andric   FeatureFastFMAF32, FeatureDPP, FeatureIntClamp,
8690b57cec5SDimitry Andric   FeatureSDWA, FeatureSDWAOmod, FeatureSDWAScalar, FeatureSDWASdst,
8700b57cec5SDimitry Andric   FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
8710b57cec5SDimitry Andric   FeatureAddNoCarryInsts, FeatureGFX8Insts, FeatureGFX7GFX8GFX9Insts,
8725ffd83dbSDimitry Andric   FeatureScalarFlatScratchInsts, FeatureScalarAtomics, FeatureR128A16,
873fe6060f1SDimitry Andric   FeatureSMemTimeInst, FeatureFastDenormalF32, FeatureSupportsXNACK,
874fe6060f1SDimitry Andric   FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess,
875fe6060f1SDimitry Andric   FeatureNegativeScratchOffsetBug
876fe6060f1SDimitry Andric  ]
8770b57cec5SDimitry Andric>;
8780b57cec5SDimitry Andric
8790b57cec5SDimitry Andricdef FeatureGFX10 : GCNSubtargetFeatureGeneration<"GFX10",
8800b57cec5SDimitry Andric  "gfx10",
8810b57cec5SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
8820b57cec5SDimitry Andric   FeatureFlatAddressSpace,
8830b57cec5SDimitry Andric   FeatureCIInsts, Feature16BitInsts,
8840b57cec5SDimitry Andric   FeatureSMemRealTime, FeatureInv2PiInlineImm,
8850b57cec5SDimitry Andric   FeatureApertureRegs, FeatureGFX9Insts, FeatureGFX10Insts, FeatureVOP3P,
8860b57cec5SDimitry Andric   FeatureMovrel, FeatureFastFMAF32, FeatureDPP, FeatureIntClamp,
8870b57cec5SDimitry Andric   FeatureSDWA, FeatureSDWAOmod, FeatureSDWAScalar, FeatureSDWASdst,
8880b57cec5SDimitry Andric   FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
8890b57cec5SDimitry Andric   FeatureAddNoCarryInsts, FeatureFmaMixInsts, FeatureGFX8Insts,
89004eeddc0SDimitry Andric   FeatureNoSdstCMPX, FeatureVscnt,
891fe6060f1SDimitry Andric   FeatureVOP3Literal, FeatureDPP8, FeatureExtendedImageInsts,
892e8d8bef9SDimitry Andric   FeatureNoDataDepHazard, FeaturePkFmacF16Inst,
893fe6060f1SDimitry Andric   FeatureGFX10A16, FeatureSMemTimeInst, FeatureFastDenormalF32, FeatureG16,
894*81ad6265SDimitry Andric   FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess, FeatureImageInsts
895*81ad6265SDimitry Andric  ]
896*81ad6265SDimitry Andric>;
897*81ad6265SDimitry Andric
898*81ad6265SDimitry Andricdef FeatureGFX11 : GCNSubtargetFeatureGeneration<"GFX11",
899*81ad6265SDimitry Andric  "gfx11",
900*81ad6265SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
901*81ad6265SDimitry Andric   FeatureFlatAddressSpace, Feature16BitInsts,
902*81ad6265SDimitry Andric   FeatureInv2PiInlineImm, FeatureApertureRegs,
903*81ad6265SDimitry Andric   FeatureCIInsts, FeatureGFX8Insts, FeatureGFX9Insts, FeatureGFX10Insts,
904*81ad6265SDimitry Andric   FeatureGFX10_AEncoding, FeatureGFX10_BEncoding, FeatureGFX10_3Insts,
905*81ad6265SDimitry Andric   FeatureGFX11Insts, FeatureVOP3P, FeatureVOPD, FeatureTrue16BitInsts,
906*81ad6265SDimitry Andric   FeatureMovrel, FeatureFastFMAF32, FeatureDPP, FeatureIntClamp,
907*81ad6265SDimitry Andric   FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
908*81ad6265SDimitry Andric   FeatureAddNoCarryInsts, FeatureFmaMixInsts,
909*81ad6265SDimitry Andric   FeatureNoSdstCMPX, FeatureVscnt,
910*81ad6265SDimitry Andric   FeatureVOP3Literal, FeatureDPP8, FeatureExtendedImageInsts,
911*81ad6265SDimitry Andric   FeatureNoDataDepHazard, FeaturePkFmacF16Inst,
912*81ad6265SDimitry Andric   FeatureGFX10A16, FeatureFastDenormalF32, FeatureG16,
913e8d8bef9SDimitry Andric   FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess
9140b57cec5SDimitry Andric  ]
9150b57cec5SDimitry Andric>;
9160b57cec5SDimitry Andric
9170b57cec5SDimitry Andricclass FeatureSet<list<SubtargetFeature> Features_> {
9180b57cec5SDimitry Andric  list<SubtargetFeature> Features = Features_;
9190b57cec5SDimitry Andric}
9200b57cec5SDimitry Andric
9210b57cec5SDimitry Andricdef FeatureISAVersion6_0_0 : FeatureSet<[FeatureSouthernIslands,
9220b57cec5SDimitry Andric   FeatureFastFMAF32,
9230b57cec5SDimitry Andric   HalfRate64Ops,
924e8d8bef9SDimitry Andric   FeatureLDSBankCount32]>;
9250b57cec5SDimitry Andric
9260b57cec5SDimitry Andricdef FeatureISAVersion6_0_1 : FeatureSet<
9270b57cec5SDimitry Andric  [FeatureSouthernIslands,
928e8d8bef9SDimitry Andric   FeatureLDSBankCount32]>;
929e8d8bef9SDimitry Andric
930e8d8bef9SDimitry Andricdef FeatureISAVersion6_0_2 : FeatureSet<
931e8d8bef9SDimitry Andric  [FeatureSouthernIslands,
932e8d8bef9SDimitry Andric   FeatureLDSBankCount32]>;
9330b57cec5SDimitry Andric
9340b57cec5SDimitry Andricdef FeatureISAVersion7_0_0 : FeatureSet<
9350b57cec5SDimitry Andric  [FeatureSeaIslands,
936e8d8bef9SDimitry Andric   FeatureLDSBankCount32]>;
9370b57cec5SDimitry Andric
9380b57cec5SDimitry Andricdef FeatureISAVersion7_0_1 : FeatureSet<
9390b57cec5SDimitry Andric  [FeatureSeaIslands,
9400b57cec5SDimitry Andric   HalfRate64Ops,
9410b57cec5SDimitry Andric   FeatureLDSBankCount32,
942e8d8bef9SDimitry Andric   FeatureFastFMAF32]>;
9430b57cec5SDimitry Andric
9440b57cec5SDimitry Andricdef FeatureISAVersion7_0_2 : FeatureSet<
9450b57cec5SDimitry Andric  [FeatureSeaIslands,
9460b57cec5SDimitry Andric   FeatureLDSBankCount16,
947e8d8bef9SDimitry Andric   FeatureFastFMAF32]>;
9480b57cec5SDimitry Andric
9490b57cec5SDimitry Andricdef FeatureISAVersion7_0_3 : FeatureSet<
9500b57cec5SDimitry Andric  [FeatureSeaIslands,
951e8d8bef9SDimitry Andric   FeatureLDSBankCount16]>;
9520b57cec5SDimitry Andric
9530b57cec5SDimitry Andricdef FeatureISAVersion7_0_4 : FeatureSet<
9540b57cec5SDimitry Andric  [FeatureSeaIslands,
955e8d8bef9SDimitry Andric   FeatureLDSBankCount32]>;
956e8d8bef9SDimitry Andric
957e8d8bef9SDimitry Andricdef FeatureISAVersion7_0_5 : FeatureSet<
958e8d8bef9SDimitry Andric  [FeatureSeaIslands,
959e8d8bef9SDimitry Andric   FeatureLDSBankCount16]>;
9600b57cec5SDimitry Andric
9610b57cec5SDimitry Andricdef FeatureISAVersion8_0_1 : FeatureSet<
9620b57cec5SDimitry Andric  [FeatureVolcanicIslands,
9630b57cec5SDimitry Andric   FeatureFastFMAF32,
9640b57cec5SDimitry Andric   HalfRate64Ops,
9650b57cec5SDimitry Andric   FeatureLDSBankCount32,
966e8d8bef9SDimitry Andric   FeatureSupportsXNACK,
967e8d8bef9SDimitry Andric   FeatureUnpackedD16VMem]>;
9680b57cec5SDimitry Andric
9690b57cec5SDimitry Andricdef FeatureISAVersion8_0_2 : FeatureSet<
9700b57cec5SDimitry Andric  [FeatureVolcanicIslands,
9710b57cec5SDimitry Andric   FeatureLDSBankCount32,
9720b57cec5SDimitry Andric   FeatureSGPRInitBug,
973e8d8bef9SDimitry Andric   FeatureUnpackedD16VMem]>;
9740b57cec5SDimitry Andric
9750b57cec5SDimitry Andricdef FeatureISAVersion8_0_3 : FeatureSet<
9760b57cec5SDimitry Andric  [FeatureVolcanicIslands,
9770b57cec5SDimitry Andric   FeatureLDSBankCount32,
978e8d8bef9SDimitry Andric   FeatureUnpackedD16VMem]>;
979e8d8bef9SDimitry Andric
980e8d8bef9SDimitry Andricdef FeatureISAVersion8_0_5 : FeatureSet<
981e8d8bef9SDimitry Andric  [FeatureVolcanicIslands,
982e8d8bef9SDimitry Andric   FeatureLDSBankCount32,
983e8d8bef9SDimitry Andric   FeatureSGPRInitBug,
984e8d8bef9SDimitry Andric   FeatureUnpackedD16VMem]>;
9850b57cec5SDimitry Andric
9860b57cec5SDimitry Andricdef FeatureISAVersion8_1_0 : FeatureSet<
9870b57cec5SDimitry Andric  [FeatureVolcanicIslands,
9880b57cec5SDimitry Andric   FeatureLDSBankCount16,
989e8d8bef9SDimitry Andric   FeatureSupportsXNACK,
990e8d8bef9SDimitry Andric   FeatureImageStoreD16Bug,
991e8d8bef9SDimitry Andric   FeatureImageGather4D16Bug]>;
9920b57cec5SDimitry Andric
9930b57cec5SDimitry Andricdef FeatureISAVersion9_0_0 : FeatureSet<
9940b57cec5SDimitry Andric  [FeatureGFX9,
9950b57cec5SDimitry Andric   FeatureMadMixInsts,
9960b57cec5SDimitry Andric   FeatureLDSBankCount32,
997fe6060f1SDimitry Andric   FeatureDsSrc2Insts,
998fe6060f1SDimitry Andric   FeatureExtendedImageInsts,
999*81ad6265SDimitry Andric   FeatureImageInsts,
1000fe6060f1SDimitry Andric   FeatureMadMacF32Insts,
1001e8d8bef9SDimitry Andric   FeatureImageGather4D16Bug]>;
10020b57cec5SDimitry Andric
10030b57cec5SDimitry Andricdef FeatureISAVersion9_0_2 : FeatureSet<
10040b57cec5SDimitry Andric  [FeatureGFX9,
10050b57cec5SDimitry Andric   FeatureMadMixInsts,
10060b57cec5SDimitry Andric   FeatureLDSBankCount32,
1007fe6060f1SDimitry Andric   FeatureDsSrc2Insts,
1008fe6060f1SDimitry Andric   FeatureExtendedImageInsts,
1009*81ad6265SDimitry Andric   FeatureImageInsts,
1010fe6060f1SDimitry Andric   FeatureMadMacF32Insts,
1011e8d8bef9SDimitry Andric   FeatureImageGather4D16Bug]>;
10120b57cec5SDimitry Andric
10130b57cec5SDimitry Andricdef FeatureISAVersion9_0_4 : FeatureSet<
10140b57cec5SDimitry Andric  [FeatureGFX9,
10150b57cec5SDimitry Andric   FeatureLDSBankCount32,
1016fe6060f1SDimitry Andric   FeatureDsSrc2Insts,
1017fe6060f1SDimitry Andric   FeatureExtendedImageInsts,
1018*81ad6265SDimitry Andric   FeatureImageInsts,
1019fe6060f1SDimitry Andric   FeatureMadMacF32Insts,
10200b57cec5SDimitry Andric   FeatureFmaMixInsts,
1021e8d8bef9SDimitry Andric   FeatureImageGather4D16Bug]>;
10220b57cec5SDimitry Andric
10230b57cec5SDimitry Andricdef FeatureISAVersion9_0_6 : FeatureSet<
10240b57cec5SDimitry Andric  [FeatureGFX9,
10250b57cec5SDimitry Andric   HalfRate64Ops,
10260b57cec5SDimitry Andric   FeatureFmaMixInsts,
10270b57cec5SDimitry Andric   FeatureLDSBankCount32,
1028fe6060f1SDimitry Andric   FeatureDsSrc2Insts,
1029fe6060f1SDimitry Andric   FeatureExtendedImageInsts,
1030*81ad6265SDimitry Andric   FeatureImageInsts,
1031fe6060f1SDimitry Andric   FeatureMadMacF32Insts,
10320b57cec5SDimitry Andric   FeatureDLInsts,
10330b57cec5SDimitry Andric   FeatureDot1Insts,
10340b57cec5SDimitry Andric   FeatureDot2Insts,
1035fe6060f1SDimitry Andric   FeatureDot7Insts,
1036e8d8bef9SDimitry Andric   FeatureSupportsSRAMECC,
1037e8d8bef9SDimitry Andric   FeatureImageGather4D16Bug]>;
10380b57cec5SDimitry Andric
10390b57cec5SDimitry Andricdef FeatureISAVersion9_0_8 : FeatureSet<
10400b57cec5SDimitry Andric  [FeatureGFX9,
10410b57cec5SDimitry Andric   HalfRate64Ops,
10420b57cec5SDimitry Andric   FeatureFmaMixInsts,
10430b57cec5SDimitry Andric   FeatureLDSBankCount32,
1044fe6060f1SDimitry Andric   FeatureDsSrc2Insts,
1045fe6060f1SDimitry Andric   FeatureExtendedImageInsts,
1046*81ad6265SDimitry Andric   FeatureImageInsts,
1047fe6060f1SDimitry Andric   FeatureMadMacF32Insts,
10480b57cec5SDimitry Andric   FeatureDLInsts,
10490b57cec5SDimitry Andric   FeatureDot1Insts,
10500b57cec5SDimitry Andric   FeatureDot2Insts,
10510b57cec5SDimitry Andric   FeatureDot3Insts,
10520b57cec5SDimitry Andric   FeatureDot4Insts,
10530b57cec5SDimitry Andric   FeatureDot5Insts,
10540b57cec5SDimitry Andric   FeatureDot6Insts,
1055fe6060f1SDimitry Andric   FeatureDot7Insts,
10560b57cec5SDimitry Andric   FeatureMAIInsts,
10570b57cec5SDimitry Andric   FeaturePkFmacF16Inst,
1058*81ad6265SDimitry Andric   FeatureAtomicFaddNoRtnInsts,
1059*81ad6265SDimitry Andric   FeatureAtomicPkFaddNoRtnInsts,
1060e8d8bef9SDimitry Andric   FeatureSupportsSRAMECC,
10618bcb0991SDimitry Andric   FeatureMFMAInlineLiteralBug,
1062e8d8bef9SDimitry Andric   FeatureImageGather4D16Bug]>;
10630b57cec5SDimitry Andric
10640b57cec5SDimitry Andricdef FeatureISAVersion9_0_9 : FeatureSet<
10650b57cec5SDimitry Andric  [FeatureGFX9,
10660b57cec5SDimitry Andric   FeatureMadMixInsts,
10670b57cec5SDimitry Andric   FeatureLDSBankCount32,
1068fe6060f1SDimitry Andric   FeatureDsSrc2Insts,
1069fe6060f1SDimitry Andric   FeatureExtendedImageInsts,
1070*81ad6265SDimitry Andric   FeatureImageInsts,
1071fe6060f1SDimitry Andric   FeatureMadMacF32Insts,
1072e8d8bef9SDimitry Andric   FeatureImageGather4D16Bug]>;
1073e8d8bef9SDimitry Andric
1074fe6060f1SDimitry Andricdef FeatureISAVersion9_0_A : FeatureSet<
1075fe6060f1SDimitry Andric  [FeatureGFX9,
1076fe6060f1SDimitry Andric   FeatureGFX90AInsts,
1077fe6060f1SDimitry Andric   FeatureFmaMixInsts,
1078fe6060f1SDimitry Andric   FeatureLDSBankCount32,
1079fe6060f1SDimitry Andric   FeatureDLInsts,
1080fe6060f1SDimitry Andric   FeatureDot1Insts,
1081fe6060f1SDimitry Andric   FeatureDot2Insts,
1082fe6060f1SDimitry Andric   FeatureDot3Insts,
1083fe6060f1SDimitry Andric   FeatureDot4Insts,
1084fe6060f1SDimitry Andric   FeatureDot5Insts,
1085fe6060f1SDimitry Andric   FeatureDot6Insts,
1086fe6060f1SDimitry Andric   FeatureDot7Insts,
1087fe6060f1SDimitry Andric   Feature64BitDPP,
1088fe6060f1SDimitry Andric   FeaturePackedFP32Ops,
1089fe6060f1SDimitry Andric   FeatureMAIInsts,
1090fe6060f1SDimitry Andric   FeaturePkFmacF16Inst,
1091*81ad6265SDimitry Andric   FeatureAtomicFaddRtnInsts,
1092*81ad6265SDimitry Andric   FeatureAtomicFaddNoRtnInsts,
1093*81ad6265SDimitry Andric   FeatureAtomicPkFaddNoRtnInsts,
1094*81ad6265SDimitry Andric   FeatureImageInsts,
1095fe6060f1SDimitry Andric   FeatureMadMacF32Insts,
1096fe6060f1SDimitry Andric   FeatureSupportsSRAMECC,
1097fe6060f1SDimitry Andric   FeaturePackedTID,
1098fe6060f1SDimitry Andric   FullRate64Ops]>;
1099fe6060f1SDimitry Andric
1100e8d8bef9SDimitry Andricdef FeatureISAVersion9_0_C : FeatureSet<
1101e8d8bef9SDimitry Andric  [FeatureGFX9,
1102e8d8bef9SDimitry Andric   FeatureMadMixInsts,
1103e8d8bef9SDimitry Andric   FeatureLDSBankCount32,
1104fe6060f1SDimitry Andric   FeatureDsSrc2Insts,
1105fe6060f1SDimitry Andric   FeatureExtendedImageInsts,
1106*81ad6265SDimitry Andric   FeatureImageInsts,
1107fe6060f1SDimitry Andric   FeatureMadMacF32Insts,
1108e8d8bef9SDimitry Andric   FeatureImageGather4D16Bug]>;
11090b57cec5SDimitry Andric
1110*81ad6265SDimitry Andricdef FeatureISAVersion9_4_0 : FeatureSet<
1111*81ad6265SDimitry Andric  [FeatureGFX9,
1112*81ad6265SDimitry Andric   FeatureGFX90AInsts,
1113*81ad6265SDimitry Andric   FeatureGFX940Insts,
1114*81ad6265SDimitry Andric   FeatureFmaMixInsts,
1115*81ad6265SDimitry Andric   FeatureLDSBankCount32,
1116*81ad6265SDimitry Andric   FeatureDLInsts,
1117*81ad6265SDimitry Andric   FeatureDot1Insts,
1118*81ad6265SDimitry Andric   FeatureDot2Insts,
1119*81ad6265SDimitry Andric   FeatureDot3Insts,
1120*81ad6265SDimitry Andric   FeatureDot4Insts,
1121*81ad6265SDimitry Andric   FeatureDot5Insts,
1122*81ad6265SDimitry Andric   FeatureDot6Insts,
1123*81ad6265SDimitry Andric   FeatureDot7Insts,
1124*81ad6265SDimitry Andric   Feature64BitDPP,
1125*81ad6265SDimitry Andric   FeaturePackedFP32Ops,
1126*81ad6265SDimitry Andric   FeatureMAIInsts,
1127*81ad6265SDimitry Andric   FeaturePkFmacF16Inst,
1128*81ad6265SDimitry Andric   FeatureAtomicFaddRtnInsts,
1129*81ad6265SDimitry Andric   FeatureAtomicFaddNoRtnInsts,
1130*81ad6265SDimitry Andric   FeatureAtomicPkFaddNoRtnInsts,
1131*81ad6265SDimitry Andric   FeatureSupportsSRAMECC,
1132*81ad6265SDimitry Andric   FeaturePackedTID,
1133*81ad6265SDimitry Andric   FeatureArchitectedFlatScratch,
1134*81ad6265SDimitry Andric   FullRate64Ops]>;
1135*81ad6265SDimitry Andric
11360b57cec5SDimitry Andric// TODO: Organize more features into groups.
11370b57cec5SDimitry Andricdef FeatureGroup {
11380b57cec5SDimitry Andric  // Bugs present on gfx10.1.
11390b57cec5SDimitry Andric  list<SubtargetFeature> GFX10_1_Bugs = [
11400b57cec5SDimitry Andric    FeatureVcmpxPermlaneHazard,
11410b57cec5SDimitry Andric    FeatureVMEMtoScalarWriteHazard,
11420b57cec5SDimitry Andric    FeatureSMEMtoVectorWriteHazard,
11430b57cec5SDimitry Andric    FeatureInstFwdPrefetchBug,
11440b57cec5SDimitry Andric    FeatureVcmpxExecWARHazard,
11450b57cec5SDimitry Andric    FeatureLdsBranchVmemWARHazard,
11460b57cec5SDimitry Andric    FeatureNSAtoVMEMBug,
1147fe6060f1SDimitry Andric    FeatureNSAClauseBug,
11480b57cec5SDimitry Andric    FeatureOffset3fBug,
1149fe6060f1SDimitry Andric    FeatureFlatSegmentOffsetBug,
1150fe6060f1SDimitry Andric    FeatureNegativeUnalignedScratchOffsetBug
11510b57cec5SDimitry Andric   ];
11520b57cec5SDimitry Andric}
11530b57cec5SDimitry Andric
11540b57cec5SDimitry Andricdef FeatureISAVersion10_1_0 : FeatureSet<
11550b57cec5SDimitry Andric  !listconcat(FeatureGroup.GFX10_1_Bugs,
11560b57cec5SDimitry Andric    [FeatureGFX10,
11570b57cec5SDimitry Andric     FeatureLDSBankCount32,
11580b57cec5SDimitry Andric     FeatureDLInsts,
11590b57cec5SDimitry Andric     FeatureNSAEncoding,
1160fe6060f1SDimitry Andric     FeatureNSAMaxSize5,
11610b57cec5SDimitry Andric     FeatureWavefrontSize32,
11620b57cec5SDimitry Andric     FeatureScalarStores,
11630b57cec5SDimitry Andric     FeatureScalarAtomics,
11640b57cec5SDimitry Andric     FeatureScalarFlatScratchInsts,
11655ffd83dbSDimitry Andric     FeatureGetWaveIdInst,
11665ffd83dbSDimitry Andric     FeatureMadMacF32Insts,
11675ffd83dbSDimitry Andric     FeatureDsSrc2Insts,
11680b57cec5SDimitry Andric     FeatureLdsMisalignedBug,
1169e8d8bef9SDimitry Andric     FeatureSupportsXNACK])>;
11700b57cec5SDimitry Andric
11710b57cec5SDimitry Andricdef FeatureISAVersion10_1_1 : FeatureSet<
11720b57cec5SDimitry Andric  !listconcat(FeatureGroup.GFX10_1_Bugs,
11730b57cec5SDimitry Andric    [FeatureGFX10,
11740b57cec5SDimitry Andric     FeatureLDSBankCount32,
11750b57cec5SDimitry Andric     FeatureDLInsts,
11760b57cec5SDimitry Andric     FeatureDot1Insts,
11770b57cec5SDimitry Andric     FeatureDot2Insts,
11780b57cec5SDimitry Andric     FeatureDot5Insts,
11790b57cec5SDimitry Andric     FeatureDot6Insts,
1180fe6060f1SDimitry Andric     FeatureDot7Insts,
11810b57cec5SDimitry Andric     FeatureNSAEncoding,
1182fe6060f1SDimitry Andric     FeatureNSAMaxSize5,
11830b57cec5SDimitry Andric     FeatureWavefrontSize32,
11840b57cec5SDimitry Andric     FeatureScalarStores,
11850b57cec5SDimitry Andric     FeatureScalarAtomics,
11860b57cec5SDimitry Andric     FeatureScalarFlatScratchInsts,
11875ffd83dbSDimitry Andric     FeatureGetWaveIdInst,
11885ffd83dbSDimitry Andric     FeatureMadMacF32Insts,
11895ffd83dbSDimitry Andric     FeatureDsSrc2Insts,
1190e8d8bef9SDimitry Andric     FeatureLdsMisalignedBug,
1191e8d8bef9SDimitry Andric     FeatureSupportsXNACK])>;
11920b57cec5SDimitry Andric
11930b57cec5SDimitry Andricdef FeatureISAVersion10_1_2 : FeatureSet<
11940b57cec5SDimitry Andric  !listconcat(FeatureGroup.GFX10_1_Bugs,
11950b57cec5SDimitry Andric    [FeatureGFX10,
11960b57cec5SDimitry Andric     FeatureLDSBankCount32,
11970b57cec5SDimitry Andric     FeatureDLInsts,
11980b57cec5SDimitry Andric     FeatureDot1Insts,
11990b57cec5SDimitry Andric     FeatureDot2Insts,
12000b57cec5SDimitry Andric     FeatureDot5Insts,
12010b57cec5SDimitry Andric     FeatureDot6Insts,
1202fe6060f1SDimitry Andric     FeatureDot7Insts,
12030b57cec5SDimitry Andric     FeatureNSAEncoding,
1204fe6060f1SDimitry Andric     FeatureNSAMaxSize5,
12050b57cec5SDimitry Andric     FeatureWavefrontSize32,
12060b57cec5SDimitry Andric     FeatureScalarStores,
12070b57cec5SDimitry Andric     FeatureScalarAtomics,
12080b57cec5SDimitry Andric     FeatureScalarFlatScratchInsts,
12095ffd83dbSDimitry Andric     FeatureGetWaveIdInst,
1210fe6060f1SDimitry Andric     FeatureMadMacF32Insts,
1211fe6060f1SDimitry Andric     FeatureDsSrc2Insts,
1212fe6060f1SDimitry Andric     FeatureLdsMisalignedBug,
1213fe6060f1SDimitry Andric     FeatureSupportsXNACK])>;
1214fe6060f1SDimitry Andric
1215fe6060f1SDimitry Andricdef FeatureISAVersion10_1_3 : FeatureSet<
1216fe6060f1SDimitry Andric  !listconcat(FeatureGroup.GFX10_1_Bugs,
1217fe6060f1SDimitry Andric    [FeatureGFX10,
1218fe6060f1SDimitry Andric     FeatureGFX10_AEncoding,
1219fe6060f1SDimitry Andric     FeatureLDSBankCount32,
1220fe6060f1SDimitry Andric     FeatureDLInsts,
1221fe6060f1SDimitry Andric     FeatureNSAEncoding,
1222fe6060f1SDimitry Andric     FeatureNSAMaxSize5,
1223fe6060f1SDimitry Andric     FeatureWavefrontSize32,
1224fe6060f1SDimitry Andric     FeatureScalarStores,
1225fe6060f1SDimitry Andric     FeatureScalarAtomics,
1226fe6060f1SDimitry Andric     FeatureScalarFlatScratchInsts,
1227fe6060f1SDimitry Andric     FeatureGetWaveIdInst,
12285ffd83dbSDimitry Andric     FeatureMadMacF32Insts,
12295ffd83dbSDimitry Andric     FeatureDsSrc2Insts,
12300b57cec5SDimitry Andric     FeatureLdsMisalignedBug,
1231e8d8bef9SDimitry Andric     FeatureSupportsXNACK])>;
12320b57cec5SDimitry Andric
12335ffd83dbSDimitry Andricdef FeatureISAVersion10_3_0 : FeatureSet<
12345ffd83dbSDimitry Andric  [FeatureGFX10,
1235fe6060f1SDimitry Andric   FeatureGFX10_AEncoding,
12365ffd83dbSDimitry Andric   FeatureGFX10_BEncoding,
12375ffd83dbSDimitry Andric   FeatureGFX10_3Insts,
12385ffd83dbSDimitry Andric   FeatureLDSBankCount32,
12395ffd83dbSDimitry Andric   FeatureDLInsts,
12405ffd83dbSDimitry Andric   FeatureDot1Insts,
12415ffd83dbSDimitry Andric   FeatureDot2Insts,
12425ffd83dbSDimitry Andric   FeatureDot5Insts,
12435ffd83dbSDimitry Andric   FeatureDot6Insts,
1244fe6060f1SDimitry Andric   FeatureDot7Insts,
12455ffd83dbSDimitry Andric   FeatureNSAEncoding,
1246fe6060f1SDimitry Andric   FeatureNSAMaxSize13,
1247fe6060f1SDimitry Andric   FeatureWavefrontSize32,
1248fe6060f1SDimitry Andric   FeatureShaderCyclesRegister]>;
12495ffd83dbSDimitry Andric
1250*81ad6265SDimitry Andricdef FeatureISAVersion11_Common : FeatureSet<
1251*81ad6265SDimitry Andric  [FeatureGFX11,
1252*81ad6265SDimitry Andric   FeatureLDSBankCount32,
1253*81ad6265SDimitry Andric   FeatureDLInsts,
1254*81ad6265SDimitry Andric   FeatureDot5Insts,
1255*81ad6265SDimitry Andric   FeatureDot7Insts,
1256*81ad6265SDimitry Andric   FeatureDot8Insts,
1257*81ad6265SDimitry Andric   FeatureNSAEncoding,
1258*81ad6265SDimitry Andric   FeatureNSAMaxSize5,
1259*81ad6265SDimitry Andric   FeatureWavefrontSize32,
1260*81ad6265SDimitry Andric   FeatureShaderCyclesRegister,
1261*81ad6265SDimitry Andric   FeatureArchitectedFlatScratch,
1262*81ad6265SDimitry Andric   FeatureAtomicFaddRtnInsts,
1263*81ad6265SDimitry Andric   FeatureAtomicFaddNoRtnInsts,
1264*81ad6265SDimitry Andric   FeatureImageInsts,
1265*81ad6265SDimitry Andric   FeaturePackedTID,
1266*81ad6265SDimitry Andric   FeatureVcmpxPermlaneHazard]>;
1267*81ad6265SDimitry Andric
1268*81ad6265SDimitry Andric// Features for GFX 11.0.0 and 11.0.1
1269*81ad6265SDimitry Andricdef FeatureISAVersion11_0 : FeatureSet<
1270*81ad6265SDimitry Andric  !listconcat(FeatureISAVersion11_Common.Features,
1271*81ad6265SDimitry Andric    [FeatureUserSGPRInit16Bug])>;
1272*81ad6265SDimitry Andric
1273*81ad6265SDimitry Andricdef FeatureISAVersion11_0_2 : FeatureSet<
1274*81ad6265SDimitry Andric  !listconcat(FeatureISAVersion11_Common.Features,
1275*81ad6265SDimitry Andric    [FeatureUserSGPRInit16Bug])>;
1276*81ad6265SDimitry Andric
12770b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12780b57cec5SDimitry Andric
12790b57cec5SDimitry Andricdef AMDGPUInstrInfo : InstrInfo {
12800b57cec5SDimitry Andric  let guessInstructionProperties = 1;
12810b57cec5SDimitry Andric  let noNamedPositionallyEncodedOperands = 1;
12820b57cec5SDimitry Andric}
12830b57cec5SDimitry Andric
12840b57cec5SDimitry Andricdef AMDGPUAsmParser : AsmParser {
12850b57cec5SDimitry Andric  // Some of the R600 registers have the same name, so this crashes.
12860b57cec5SDimitry Andric  // For example T0_XYZW and T0_XY both have the asm name T0.
12870b57cec5SDimitry Andric  let ShouldEmitMatchRegisterName = 0;
12880b57cec5SDimitry Andric}
12890b57cec5SDimitry Andric
12900b57cec5SDimitry Andricdef AMDGPUAsmWriter : AsmWriter {
12910b57cec5SDimitry Andric  int PassSubtarget = 1;
12920b57cec5SDimitry Andric}
12930b57cec5SDimitry Andric
12940b57cec5SDimitry Andricdef AMDGPUAsmVariants {
12950b57cec5SDimitry Andric  string Default = "Default";
12960b57cec5SDimitry Andric  int Default_ID = 0;
12970b57cec5SDimitry Andric  string VOP3 = "VOP3";
12980b57cec5SDimitry Andric  int VOP3_ID = 1;
12990b57cec5SDimitry Andric  string SDWA = "SDWA";
13000b57cec5SDimitry Andric  int SDWA_ID = 2;
13010b57cec5SDimitry Andric  string SDWA9 = "SDWA9";
13020b57cec5SDimitry Andric  int SDWA9_ID = 3;
13030b57cec5SDimitry Andric  string DPP = "DPP";
13040b57cec5SDimitry Andric  int DPP_ID = 4;
1305*81ad6265SDimitry Andric  string VOP3_DPP = "VOP3_DPP";
1306*81ad6265SDimitry Andric  int VOP3_DPP_ID = 5;
13070b57cec5SDimitry Andric  string Disable = "Disable";
1308*81ad6265SDimitry Andric  int Disable_ID = 6;
13090b57cec5SDimitry Andric}
13100b57cec5SDimitry Andric
13110b57cec5SDimitry Andricdef DefaultAMDGPUAsmParserVariant : AsmParserVariant {
13120b57cec5SDimitry Andric  let Variant = AMDGPUAsmVariants.Default_ID;
13130b57cec5SDimitry Andric  let Name = AMDGPUAsmVariants.Default;
13140b57cec5SDimitry Andric}
13150b57cec5SDimitry Andric
13160b57cec5SDimitry Andricdef VOP3AsmParserVariant : AsmParserVariant {
13170b57cec5SDimitry Andric  let Variant = AMDGPUAsmVariants.VOP3_ID;
13180b57cec5SDimitry Andric  let Name = AMDGPUAsmVariants.VOP3;
13190b57cec5SDimitry Andric}
13200b57cec5SDimitry Andric
13210b57cec5SDimitry Andricdef SDWAAsmParserVariant : AsmParserVariant {
13220b57cec5SDimitry Andric  let Variant = AMDGPUAsmVariants.SDWA_ID;
13230b57cec5SDimitry Andric  let Name = AMDGPUAsmVariants.SDWA;
13240b57cec5SDimitry Andric}
13250b57cec5SDimitry Andric
13260b57cec5SDimitry Andricdef SDWA9AsmParserVariant : AsmParserVariant {
13270b57cec5SDimitry Andric  let Variant = AMDGPUAsmVariants.SDWA9_ID;
13280b57cec5SDimitry Andric  let Name = AMDGPUAsmVariants.SDWA9;
13290b57cec5SDimitry Andric}
13300b57cec5SDimitry Andric
13310b57cec5SDimitry Andricdef DPPAsmParserVariant : AsmParserVariant {
13320b57cec5SDimitry Andric  let Variant = AMDGPUAsmVariants.DPP_ID;
13330b57cec5SDimitry Andric  let Name = AMDGPUAsmVariants.DPP;
13340b57cec5SDimitry Andric}
13350b57cec5SDimitry Andric
1336*81ad6265SDimitry Andricdef VOP3_DPPAsmParserVariant : AsmParserVariant {
1337*81ad6265SDimitry Andric  let Variant = AMDGPUAsmVariants.VOP3_DPP_ID;
1338*81ad6265SDimitry Andric  let Name = AMDGPUAsmVariants.VOP3_DPP;
1339*81ad6265SDimitry Andric}
1340*81ad6265SDimitry Andric
13410b57cec5SDimitry Andricdef AMDGPU : Target {
13420b57cec5SDimitry Andric  // Pull in Instruction Info:
13430b57cec5SDimitry Andric  let InstructionSet = AMDGPUInstrInfo;
13440b57cec5SDimitry Andric  let AssemblyParsers = [AMDGPUAsmParser];
13450b57cec5SDimitry Andric  let AssemblyParserVariants = [DefaultAMDGPUAsmParserVariant,
13460b57cec5SDimitry Andric                                VOP3AsmParserVariant,
13470b57cec5SDimitry Andric                                SDWAAsmParserVariant,
13480b57cec5SDimitry Andric                                SDWA9AsmParserVariant,
1349*81ad6265SDimitry Andric                                DPPAsmParserVariant,
1350*81ad6265SDimitry Andric                                VOP3_DPPAsmParserVariant];
13510b57cec5SDimitry Andric  let AssemblyWriters = [AMDGPUAsmWriter];
13520b57cec5SDimitry Andric  let AllowRegisterRenaming = 1;
13530b57cec5SDimitry Andric}
13540b57cec5SDimitry Andric
13550b57cec5SDimitry Andric// Dummy Instruction itineraries for pseudo instructions
13560b57cec5SDimitry Andricdef ALU_NULL : FuncUnit;
13570b57cec5SDimitry Andricdef NullALU : InstrItinClass;
13580b57cec5SDimitry Andric
13590b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
13600b57cec5SDimitry Andric// Predicate helper class
13610b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
13620b57cec5SDimitry Andric
13630b57cec5SDimitry Andricdef isGFX6 :
13640b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS">,
13655ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureSouthernIslands)>;
13660b57cec5SDimitry Andric
13670b57cec5SDimitry Andricdef isGFX6GFX7 :
13680b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
13690b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS">,
13705ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), (not FeatureGFX10Insts))>;
13710b57cec5SDimitry Andric
13720b57cec5SDimitry Andricdef isGFX6GFX7GFX10 :
13730b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
13740b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
13750b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
1376*81ad6265SDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), (not FeatureGFX11Insts))>;
1377*81ad6265SDimitry Andric
1378*81ad6265SDimitry Andricdef isGFX6GFX7GFX10Plus :
1379*81ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
1380*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
1381*81ad6265SDimitry Andric            "Subtarget->getGeneration() >= AMDGPUSubtarget::GFX10">,
13825ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding))>;
13830b57cec5SDimitry Andric
13840b57cec5SDimitry Andricdef isGFX7Only :
13850b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS">,
13865ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureCIInsts, (not FeatureGFX10Insts))>;
13870b57cec5SDimitry Andric
13880b57cec5SDimitry Andricdef isGFX7GFX10 :
13890b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
13900b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
1391*81ad6265SDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureCIInsts, (not FeatureGFX11Insts))>;
1392*81ad6265SDimitry Andric
1393*81ad6265SDimitry Andricdef isGFX7GFX10GFX11 :
1394*81ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
1395*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10 ||"
1396*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX11">,
13975ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureCIInsts)>;
13980b57cec5SDimitry Andric
13990b57cec5SDimitry Andricdef isGFX7GFX8GFX9 :
14000b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
14010b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
14020b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
14035ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX7GFX8GFX9Insts)>;
14040b57cec5SDimitry Andric
14050b57cec5SDimitry Andricdef isGFX6GFX7GFX8GFX9 :
14060b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
14070b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
14080b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
14090b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
14105ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGFX10Insts))>;
14110b57cec5SDimitry Andric
1412fe6060f1SDimitry Andricdef isGFX6GFX7GFX8GFX9NotGFX90A :
1413fe6060f1SDimitry Andric  Predicate<"!Subtarget->hasGFX90AInsts() &&"
1414fe6060f1SDimitry Andric            "(Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
1415fe6060f1SDimitry Andric            " Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
1416fe6060f1SDimitry Andric            " Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1417fe6060f1SDimitry Andric            " Subtarget->getGeneration() == AMDGPUSubtarget::GFX9)">,
1418fe6060f1SDimitry Andric  AssemblerPredicate<(all_of (not FeatureGFX10Insts), (not FeatureGFX90AInsts))>;
1419fe6060f1SDimitry Andric
1420*81ad6265SDimitry Andricdef isGFX6GFX7GFX8GFX9GFX10 :
1421*81ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
1422*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
1423*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1424*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9 ||"
1425*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
1426*81ad6265SDimitry Andric  AssemblerPredicate<(all_of (not FeatureGFX11Insts))>;
1427*81ad6265SDimitry Andric
1428*81ad6265SDimitry Andricdef isGFX7GFX8GFX9GFX10 :
1429*81ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
1430*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1431*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9 ||"
1432*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
1433*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureCIInsts, (not FeatureGFX11Insts))>;
1434*81ad6265SDimitry Andric
14350b57cec5SDimitry Andricdef isGFX7Plus :
14360b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::SEA_ISLANDS">,
14375ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureCIInsts)>;
14380b57cec5SDimitry Andric
14390b57cec5SDimitry Andricdef isGFX8Plus :
14400b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS">,
14415ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts)>;
14420b57cec5SDimitry Andric
14430b57cec5SDimitry Andricdef isGFX8Only : Predicate<"Subtarget->getGeneration() =="
14440b57cec5SDimitry Andric                           "AMDGPUSubtarget::VOLCANIC_ISLANDS">,
14455ffd83dbSDimitry Andric  AssemblerPredicate <(all_of FeatureVolcanicIslands)>;
14460b57cec5SDimitry Andric
14470b57cec5SDimitry Andricdef isGFX9Plus :
14480b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
14495ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX9Insts)>;
14500b57cec5SDimitry Andric
14510b57cec5SDimitry Andricdef isGFX9Only : Predicate <
14520b57cec5SDimitry Andric  "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
14535ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGCN3Encoding, FeatureGFX9Insts)>;
14540b57cec5SDimitry Andric
1455fe6060f1SDimitry Andricdef isGCN3ExcludingGFX90A :
1456fe6060f1SDimitry Andric  Predicate<"Subtarget->isGCN3Encoding() && !Subtarget->hasGFX90AInsts()">,
1457fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureGCN3Encoding, (not FeatureGFX90AInsts))>;
1458fe6060f1SDimitry Andric
1459fe6060f1SDimitry Andricdef isGFX90APlus :
1460fe6060f1SDimitry Andric  Predicate<"Subtarget->hasGFX90AInsts()">,
1461fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX90AInsts)>;
1462fe6060f1SDimitry Andric
1463fe6060f1SDimitry Andricdef isNotGFX90APlus :
1464fe6060f1SDimitry Andric  Predicate<"!Subtarget->hasGFX90AInsts()">,
1465fe6060f1SDimitry Andric  AssemblerPredicate<(all_of (not FeatureGFX90AInsts))>;
1466fe6060f1SDimitry Andric
1467fe6060f1SDimitry Andricdef isGFX8GFX9NotGFX90A :
1468fe6060f1SDimitry Andric  Predicate<"!Subtarget->hasGFX90AInsts() &&"
1469fe6060f1SDimitry Andric            "(Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1470fe6060f1SDimitry Andric            " Subtarget->getGeneration() == AMDGPUSubtarget::GFX9)">,
1471fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts, FeatureGCN3Encoding, (not FeatureGFX90AInsts))>;
1472fe6060f1SDimitry Andric
1473fe6060f1SDimitry Andricdef isGFX90AOnly :
1474*81ad6265SDimitry Andric  Predicate<"Subtarget->hasGFX90AInsts() && !Subtarget->hasGFX940Insts()">,
1475*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX90AInsts, (not FeatureGFX940Insts))>;
1476fe6060f1SDimitry Andric
1477fe6060f1SDimitry Andricdef isGFX908orGFX90A :
1478*81ad6265SDimitry Andric  Predicate<"Subtarget->hasMAIInsts() && !Subtarget->hasGFX940Insts()">,
1479*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureMAIInsts, (not FeatureGFX940Insts))>;
1480*81ad6265SDimitry Andric
1481*81ad6265SDimitry Andricdef isGFX940Plus :
1482*81ad6265SDimitry Andric  Predicate<"Subtarget->hasGFX940Insts()">,
1483*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX940Insts)>;
1484*81ad6265SDimitry Andric
1485*81ad6265SDimitry Andricdef isGFX940GFX11Plus :
1486*81ad6265SDimitry Andric  Predicate<"Subtarget->hasGFX940Insts() ||"
1487*81ad6265SDimitry Andric            "Subtarget->getGeneration() >= AMDGPUSubtarget::GFX11">,
1488*81ad6265SDimitry Andric  AssemblerPredicate<(any_of FeatureGFX940Insts, FeatureGFX11Insts)>;
1489*81ad6265SDimitry Andric
1490*81ad6265SDimitry Andricdef isGFX8GFX9NotGFX940 :
1491*81ad6265SDimitry Andric  Predicate<"!Subtarget->hasGFX940Insts() &&"
1492*81ad6265SDimitry Andric            "(Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1493*81ad6265SDimitry Andric            " Subtarget->getGeneration() == AMDGPUSubtarget::GFX9)">,
1494*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts, FeatureGCN3Encoding, (not FeatureGFX940Insts))>;
1495fe6060f1SDimitry Andric
14960b57cec5SDimitry Andricdef isGFX8GFX9 :
14970b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
14980b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
14995ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts, FeatureGCN3Encoding)>;
15000b57cec5SDimitry Andric
1501*81ad6265SDimitry Andricdef isGFX10Only :
1502*81ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
1503*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10Insts, (not FeatureGFX11Insts))>;
1504*81ad6265SDimitry Andric
15050b57cec5SDimitry Andricdef isGFX10Plus :
15060b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX10">,
15075ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10Insts)>;
15080b57cec5SDimitry Andric
1509e8d8bef9SDimitry Andricdef isGFX10Before1030 :
1510e8d8bef9SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::GFX10 &&"
1511e8d8bef9SDimitry Andric            "!Subtarget->hasGFX10_3Insts()">,
1512e8d8bef9SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10Insts,(not FeatureGFX10_3Insts))>;
1513e8d8bef9SDimitry Andric
1514*81ad6265SDimitry Andricdef isGFX9GFX10 :
1515*81ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::GFX9 ||"
1516*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
1517*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX9Insts, (not FeatureGFX11Insts))>;
1518*81ad6265SDimitry Andric
1519*81ad6265SDimitry Andricdef isGFX8GFX9GFX10 :
1520*81ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1521*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9 ||"
1522*81ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
1523*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts, (not FeatureGFX11Insts))>;
1524*81ad6265SDimitry Andric
1525*81ad6265SDimitry Andricdef isGFX11Only :
1526*81ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::GFX11">,
1527*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX11Insts)>;
1528*81ad6265SDimitry Andric
1529*81ad6265SDimitry Andricdef isGFX11Plus :
1530*81ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX11">,
1531*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX11Insts)>;
1532*81ad6265SDimitry Andric
15330b57cec5SDimitry Andricdef HasFlatAddressSpace : Predicate<"Subtarget->hasFlatAddressSpace()">,
15345ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureFlatAddressSpace)>;
15350b57cec5SDimitry Andric
15360b57cec5SDimitry Andricdef HasFlatGlobalInsts : Predicate<"Subtarget->hasFlatGlobalInsts()">,
15375ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureFlatGlobalInsts)>;
15380b57cec5SDimitry Andricdef HasFlatScratchInsts : Predicate<"Subtarget->hasFlatScratchInsts()">,
15395ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureFlatScratchInsts)>;
15400b57cec5SDimitry Andricdef HasScalarFlatScratchInsts : Predicate<"Subtarget->hasScalarFlatScratchInsts()">,
15415ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureScalarFlatScratchInsts)>;
15420b57cec5SDimitry Andricdef HasD16LoadStore : Predicate<"Subtarget->hasD16LoadStore()">,
15435ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX9Insts)>;
15445ffd83dbSDimitry Andric
1545e8d8bef9SDimitry Andricdef HasFlatScratchSTMode : Predicate<"Subtarget->hasFlatScratchSTMode()">,
1546*81ad6265SDimitry Andric  AssemblerPredicate<(any_of FeatureGFX10_3Insts, FeatureGFX940Insts)>;
1547*81ad6265SDimitry Andricdef HasFlatScratchSVSMode : Predicate<"Subtarget->hasFlatScratchSVSMode()">,
1548*81ad6265SDimitry Andric  AssemblerPredicate<(any_of FeatureGFX940Insts, FeatureGFX11Insts)>;
1549e8d8bef9SDimitry Andric
1550fe6060f1SDimitry Andricdef HasGFX10_AEncoding : Predicate<"Subtarget->hasGFX10_AEncoding()">,
1551fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10_AEncoding)>;
1552fe6060f1SDimitry Andric
15535ffd83dbSDimitry Andricdef HasGFX10_BEncoding : Predicate<"Subtarget->hasGFX10_BEncoding()">,
15545ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10_BEncoding)>;
15550b57cec5SDimitry Andric
15560b57cec5SDimitry Andricdef HasUnpackedD16VMem : Predicate<"Subtarget->hasUnpackedD16VMem()">,
15575ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureUnpackedD16VMem)>;
15580b57cec5SDimitry Andricdef HasPackedD16VMem : Predicate<"!Subtarget->hasUnpackedD16VMem()">,
15595ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureUnpackedD16VMem))>;
15600b57cec5SDimitry Andric
15610b57cec5SDimitry Andricdef D16PreservesUnusedBits :
15620b57cec5SDimitry Andric  Predicate<"Subtarget->d16PreservesUnusedBits()">,
15635ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX9Insts, (not FeatureSRAMECC))>;
15640b57cec5SDimitry Andric
15650b57cec5SDimitry Andricdef LDSRequiresM0Init : Predicate<"Subtarget->ldsRequiresM0Init()">;
15660b57cec5SDimitry Andricdef NotLDSRequiresM0Init : Predicate<"!Subtarget->ldsRequiresM0Init()">;
15670b57cec5SDimitry Andric
15680b57cec5SDimitry Andricdef HasDSAddTid : Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
15695ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX9Insts)>;
15705ffd83dbSDimitry Andric
1571349cc55cSDimitry Andricdef HasLDSFPAtomicAdd : Predicate<"Subtarget->hasLDSFPAtomicAdd()">,
15725ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts)>;
15730b57cec5SDimitry Andric
15740b57cec5SDimitry Andricdef HasAddNoCarryInsts : Predicate<"Subtarget->hasAddNoCarry()">,
15755ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureAddNoCarryInsts)>;
15760b57cec5SDimitry Andric
15770b57cec5SDimitry Andricdef NotHasAddNoCarryInsts : Predicate<"!Subtarget->hasAddNoCarry()">;
15780b57cec5SDimitry Andric
15790b57cec5SDimitry Andricdef Has16BitInsts : Predicate<"Subtarget->has16BitInsts()">,
15805ffd83dbSDimitry Andric  AssemblerPredicate<(all_of Feature16BitInsts)>;
1581*81ad6265SDimitry Andric
1582*81ad6265SDimitry Andricdef HasTrue16BitInsts : Predicate<"Subtarget->hasTrue16BitInsts()">,
1583*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureTrue16BitInsts)>;
1584*81ad6265SDimitry Andricdef NotHasTrue16BitInsts : Predicate<"!Subtarget->hasTrue16BitInsts()">;
1585*81ad6265SDimitry Andric
15860b57cec5SDimitry Andricdef HasVOP3PInsts : Predicate<"Subtarget->hasVOP3PInsts()">,
15875ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureVOP3P)>;
15885ffd83dbSDimitry Andric
15895ffd83dbSDimitry Andricdef HasMinMaxDenormModes : Predicate<"Subtarget->supportsMinMaxDenormModes()">;
15905ffd83dbSDimitry Andricdef NotHasMinMaxDenormModes : Predicate<"!Subtarget->supportsMinMaxDenormModes()">;
15910b57cec5SDimitry Andric
15920b57cec5SDimitry Andricdef HasSDWA : Predicate<"Subtarget->hasSDWA()">,
15935ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureSDWA, FeatureVolcanicIslands)>;
15940b57cec5SDimitry Andric
15950b57cec5SDimitry Andricdef HasSDWA9 :
15960b57cec5SDimitry Andric  Predicate<"Subtarget->hasSDWA()">,
15975ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGCN3Encoding, FeatureGFX9Insts,FeatureSDWA)>;
15980b57cec5SDimitry Andric
15990b57cec5SDimitry Andricdef HasSDWA10 :
16000b57cec5SDimitry Andric  Predicate<"Subtarget->hasSDWA()">,
16015ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureGFX10Insts, FeatureSDWA)>;
16020b57cec5SDimitry Andric
16030b57cec5SDimitry Andricdef HasDPP : Predicate<"Subtarget->hasDPP()">,
16045ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGCN3Encoding, FeatureDPP)>;
16050b57cec5SDimitry Andric
16060b57cec5SDimitry Andricdef HasDPP8 : Predicate<"Subtarget->hasDPP8()">,
16075ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureGFX10Insts, FeatureDPP8)>;
16080b57cec5SDimitry Andric
1609fe6060f1SDimitry Andricdef Has64BitDPP : Predicate<"Subtarget->has64BitDPP()">,
1610fe6060f1SDimitry Andric  AssemblerPredicate<(all_of Feature64BitDPP)>;
1611fe6060f1SDimitry Andric
1612fe6060f1SDimitry Andricdef HasPackedFP32Ops : Predicate<"Subtarget->hasPackedFP32Ops()">,
1613fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeaturePackedFP32Ops)>;
1614fe6060f1SDimitry Andric
1615fe6060f1SDimitry Andricdef HasFmaakFmamkF32Insts :
1616fe6060f1SDimitry Andric  Predicate<"Subtarget->hasFmaakFmamkF32Insts()">,
1617*81ad6265SDimitry Andric  AssemblerPredicate<(any_of FeatureGFX10Insts, FeatureGFX940Insts)>;
1618*81ad6265SDimitry Andric
1619*81ad6265SDimitry Andricdef HasImageInsts : Predicate<"Subtarget->hasImageInsts()">,
1620*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureImageInsts)>;
1621fe6060f1SDimitry Andric
1622fe6060f1SDimitry Andricdef HasExtendedImageInsts : Predicate<"Subtarget->hasExtendedImageInsts()">,
1623fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureExtendedImageInsts)>;
1624fe6060f1SDimitry Andric
16250b57cec5SDimitry Andricdef HasR128A16 : Predicate<"Subtarget->hasR128A16()">,
16265ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureR128A16)>;
16275ffd83dbSDimitry Andric
16285ffd83dbSDimitry Andricdef HasGFX10A16 : Predicate<"Subtarget->hasGFX10A16()">,
16295ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10A16)>;
16305ffd83dbSDimitry Andric
16315ffd83dbSDimitry Andricdef HasG16 : Predicate<"Subtarget->hasG16()">,
16325ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureG16)>;
16330b57cec5SDimitry Andric
16340b57cec5SDimitry Andricdef HasDPP16 : Predicate<"Subtarget->hasDPP()">,
16355ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureGFX10Insts, FeatureDPP)>;
16360b57cec5SDimitry Andric
16370b57cec5SDimitry Andricdef HasIntClamp : Predicate<"Subtarget->hasIntClamp()">,
16385ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureIntClamp)>;
16390b57cec5SDimitry Andric
16400b57cec5SDimitry Andricdef HasMadMixInsts : Predicate<"Subtarget->hasMadMixInsts()">,
16415ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureMadMixInsts)>;
16420b57cec5SDimitry Andric
16430b57cec5SDimitry Andricdef HasScalarStores : Predicate<"Subtarget->hasScalarStores()">,
16445ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureScalarStores)>;
16450b57cec5SDimitry Andric
16460b57cec5SDimitry Andricdef HasScalarAtomics : Predicate<"Subtarget->hasScalarAtomics()">,
16475ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureScalarAtomics)>;
16480b57cec5SDimitry Andric
16490b57cec5SDimitry Andricdef HasNoSdstCMPX : Predicate<"Subtarget->hasNoSdstCMPX()">,
16505ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureNoSdstCMPX)>;
16510b57cec5SDimitry Andric
16520b57cec5SDimitry Andricdef HasSdstCMPX : Predicate<"!Subtarget->hasNoSdstCMPX()">,
16535ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureNoSdstCMPX))>;
16540b57cec5SDimitry Andric
16550b57cec5SDimitry Andricdef has16BankLDS : Predicate<"Subtarget->getLDSBankCount() == 16">;
16560b57cec5SDimitry Andricdef has32BankLDS : Predicate<"Subtarget->getLDSBankCount() == 32">;
16570b57cec5SDimitry Andricdef HasVGPRIndexMode : Predicate<"Subtarget->hasVGPRIndexMode()">,
16585ffd83dbSDimitry Andric                      AssemblerPredicate<(all_of FeatureVGPRIndexMode)>;
16590b57cec5SDimitry Andricdef HasMovrel : Predicate<"Subtarget->hasMovrel()">,
16605ffd83dbSDimitry Andric                AssemblerPredicate<(all_of FeatureMovrel)>;
16610b57cec5SDimitry Andric
16620b57cec5SDimitry Andricdef HasFmaMixInsts : Predicate<"Subtarget->hasFmaMixInsts()">,
16635ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureFmaMixInsts)>;
16640b57cec5SDimitry Andric
16650b57cec5SDimitry Andricdef HasDLInsts : Predicate<"Subtarget->hasDLInsts()">,
16665ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDLInsts)>;
16670b57cec5SDimitry Andric
16680b57cec5SDimitry Andricdef HasDot1Insts : Predicate<"Subtarget->hasDot1Insts()">,
16695ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot1Insts)>;
16700b57cec5SDimitry Andric
16710b57cec5SDimitry Andricdef HasDot2Insts : Predicate<"Subtarget->hasDot2Insts()">,
16725ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot2Insts)>;
16730b57cec5SDimitry Andric
16740b57cec5SDimitry Andricdef HasDot3Insts : Predicate<"Subtarget->hasDot3Insts()">,
16755ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot3Insts)>;
16760b57cec5SDimitry Andric
16770b57cec5SDimitry Andricdef HasDot4Insts : Predicate<"Subtarget->hasDot4Insts()">,
16785ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot4Insts)>;
16790b57cec5SDimitry Andric
16800b57cec5SDimitry Andricdef HasDot5Insts : Predicate<"Subtarget->hasDot5Insts()">,
16815ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot5Insts)>;
16820b57cec5SDimitry Andric
16830b57cec5SDimitry Andricdef HasDot6Insts : Predicate<"Subtarget->hasDot6Insts()">,
16845ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot6Insts)>;
16855ffd83dbSDimitry Andric
1686fe6060f1SDimitry Andricdef HasDot7Insts : Predicate<"Subtarget->hasDot7Insts()">,
1687fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureDot7Insts)>;
1688fe6060f1SDimitry Andric
1689*81ad6265SDimitry Andricdef HasDot8Insts : Predicate<"Subtarget->hasDot8Insts()">,
1690*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureDot8Insts)>;
1691*81ad6265SDimitry Andric
16925ffd83dbSDimitry Andricdef HasGetWaveIdInst : Predicate<"Subtarget->hasGetWaveIdInst()">,
16935ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGetWaveIdInst)>;
16940b57cec5SDimitry Andric
16950b57cec5SDimitry Andricdef HasMAIInsts : Predicate<"Subtarget->hasMAIInsts()">,
16965ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureMAIInsts)>;
16975ffd83dbSDimitry Andric
1698e8d8bef9SDimitry Andricdef HasSMemRealTime : Predicate<"Subtarget->hasSMemRealTime()">,
1699e8d8bef9SDimitry Andric  AssemblerPredicate<(all_of FeatureSMemRealTime)>;
1700e8d8bef9SDimitry Andric
17015ffd83dbSDimitry Andricdef HasSMemTimeInst : Predicate<"Subtarget->hasSMemTimeInst()">,
17025ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureSMemTimeInst)>;
17035ffd83dbSDimitry Andric
1704fe6060f1SDimitry Andricdef HasShaderCyclesRegister : Predicate<"Subtarget->hasShaderCyclesRegister()">,
1705fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureShaderCyclesRegister)>;
17060b57cec5SDimitry Andric
17070b57cec5SDimitry Andricdef HasPkFmacF16Inst : Predicate<"Subtarget->hasPkFmacF16Inst()">,
17085ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeaturePkFmacF16Inst)>;
17095ffd83dbSDimitry Andric
17105ffd83dbSDimitry Andricdef HasMadMacF32Insts : Predicate<"Subtarget->hasMadMacF32Insts()">,
17115ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureMadMacF32Insts)>;
17120b57cec5SDimitry Andric
1713e8d8bef9SDimitry Andricdef HasFmaLegacy32 : Predicate<"Subtarget->hasGFX10_3Insts()">,
1714e8d8bef9SDimitry Andric  AssemblerPredicate<(any_of FeatureGFX10_3Insts)>;
1715e8d8bef9SDimitry Andric
1716*81ad6265SDimitry Andricdef HasAtomicFaddRtnInsts : Predicate<"Subtarget->hasAtomicFaddRtnInsts()">,
1717*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureAtomicFaddRtnInsts)>;
1718*81ad6265SDimitry Andricdef HasAtomicFaddNoRtnInsts : Predicate<"Subtarget->hasAtomicFaddNoRtnInsts()">,
1719*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureAtomicFaddNoRtnInsts)>;
1720*81ad6265SDimitry Andricdef HasAtomicPkFaddNoRtnInsts
1721*81ad6265SDimitry Andric  : Predicate<"Subtarget->hasAtomicPkFaddNoRtnInsts()">,
1722*81ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureAtomicPkFaddNoRtnInsts)>;
17235ffd83dbSDimitry Andric
17245ffd83dbSDimitry Andricdef HasDsSrc2Insts : Predicate<"!Subtarget->hasDsSrc2Insts()">,
17255ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDsSrc2Insts)>;
17260b57cec5SDimitry Andric
17270b57cec5SDimitry Andricdef EnableLateCFGStructurize : Predicate<
17280b57cec5SDimitry Andric  "EnableLateStructurizeCFG">;
17290b57cec5SDimitry Andric
1730e8d8bef9SDimitry Andricdef EnableFlatScratch : Predicate<"Subtarget->enableFlatScratch()">;
1731e8d8bef9SDimitry Andric
1732e8d8bef9SDimitry Andricdef DisableFlatScratch : Predicate<"!Subtarget->enableFlatScratch()">;
1733e8d8bef9SDimitry Andric
1734e8d8bef9SDimitry Andricdef HasUnalignedAccessMode : Predicate<"Subtarget->hasUnalignedAccessMode()">,
1735e8d8bef9SDimitry Andric  AssemblerPredicate<(all_of FeatureUnalignedAccessMode)>;
1736e8d8bef9SDimitry Andric
17370b57cec5SDimitry Andric// Include AMDGPU TD files
17380b57cec5SDimitry Andricinclude "SISchedule.td"
17390b57cec5SDimitry Andricinclude "GCNProcessors.td"
17400b57cec5SDimitry Andricinclude "AMDGPUInstrInfo.td"
17415ffd83dbSDimitry Andricinclude "SIRegisterInfo.td"
17420b57cec5SDimitry Andricinclude "AMDGPURegisterBanks.td"
17430b57cec5SDimitry Andricinclude "AMDGPUInstructions.td"
17440b57cec5SDimitry Andricinclude "SIInstrInfo.td"
17450b57cec5SDimitry Andricinclude "AMDGPUCallingConv.td"
17460b57cec5SDimitry Andricinclude "AMDGPUSearchableTables.td"
1747