xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPU.td (revision 6c4b055cfb6bf549e9145dde6454cc6b178c35e4)
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"
120fca6ea1SDimitry Andricinclude "AMDGPUPredicateControl.td"
130b57cec5SDimitry Andric
148bcb0991SDimitry Andricdef p0 : PtrValueType<i64, 0>;
158bcb0991SDimitry Andricdef p1 : PtrValueType<i64, 1>;
168bcb0991SDimitry Andricdef p2 : PtrValueType<i32, 2>;
178bcb0991SDimitry Andricdef p3 : PtrValueType<i32, 3>;
188bcb0991SDimitry Andricdef p4 : PtrValueType<i64, 4>;
198bcb0991SDimitry Andricdef p5 : PtrValueType<i32, 5>;
208bcb0991SDimitry Andricdef p6 : PtrValueType<i32, 6>;
218bcb0991SDimitry Andric
220b57cec5SDimitry Andric//===------------------------------------------------------------===//
230b57cec5SDimitry Andric// Subtarget Features (device properties)
240b57cec5SDimitry Andric//===------------------------------------------------------------===//
250b57cec5SDimitry Andric
260b57cec5SDimitry Andricdef FeatureFastFMAF32 : SubtargetFeature<"fast-fmaf",
270b57cec5SDimitry Andric  "FastFMAF32",
280b57cec5SDimitry Andric  "true",
290b57cec5SDimitry Andric  "Assuming f32 fma is at least as fast as mul + add"
300b57cec5SDimitry Andric>;
310b57cec5SDimitry Andric
325ffd83dbSDimitry Andricdef FeatureFastDenormalF32 : SubtargetFeature<"fast-denormal-f32",
335ffd83dbSDimitry Andric  "FastDenormalF32",
345ffd83dbSDimitry Andric  "true",
355ffd83dbSDimitry Andric  "Enabling denormals does not cause f32 instructions to run at f64 rates"
365ffd83dbSDimitry Andric>;
375ffd83dbSDimitry Andric
380b57cec5SDimitry Andricdef FeatureMIMG_R128 : SubtargetFeature<"mimg-r128",
390b57cec5SDimitry Andric  "MIMG_R128",
400b57cec5SDimitry Andric  "true",
410b57cec5SDimitry Andric  "Support 128-bit texture resources"
420b57cec5SDimitry Andric>;
430b57cec5SDimitry Andric
440b57cec5SDimitry Andricdef HalfRate64Ops : SubtargetFeature<"half-rate-64-ops",
450b57cec5SDimitry Andric  "HalfRate64Ops",
460b57cec5SDimitry Andric  "true",
470b57cec5SDimitry Andric  "Most fp64 instructions are half rate instead of quarter"
480b57cec5SDimitry Andric>;
490b57cec5SDimitry Andric
50fe6060f1SDimitry Andricdef FullRate64Ops : SubtargetFeature<"full-rate-64-ops",
51fe6060f1SDimitry Andric  "FullRate64Ops",
52fe6060f1SDimitry Andric  "true",
53fe6060f1SDimitry Andric  "Most fp64 instructions are full rate"
54fe6060f1SDimitry Andric>;
55fe6060f1SDimitry Andric
560b57cec5SDimitry Andricdef FeatureFlatAddressSpace : SubtargetFeature<"flat-address-space",
570b57cec5SDimitry Andric  "FlatAddressSpace",
580b57cec5SDimitry Andric  "true",
590b57cec5SDimitry Andric  "Support flat address space"
600b57cec5SDimitry Andric>;
610b57cec5SDimitry Andric
620b57cec5SDimitry Andricdef FeatureFlatInstOffsets : SubtargetFeature<"flat-inst-offsets",
630b57cec5SDimitry Andric  "FlatInstOffsets",
640b57cec5SDimitry Andric  "true",
650b57cec5SDimitry Andric  "Flat instructions have immediate offset addressing mode"
660b57cec5SDimitry Andric>;
670b57cec5SDimitry Andric
680b57cec5SDimitry Andricdef FeatureFlatGlobalInsts : SubtargetFeature<"flat-global-insts",
690b57cec5SDimitry Andric  "FlatGlobalInsts",
700b57cec5SDimitry Andric  "true",
710b57cec5SDimitry Andric  "Have global_* flat memory instructions"
720b57cec5SDimitry Andric>;
730b57cec5SDimitry Andric
740b57cec5SDimitry Andricdef FeatureFlatScratchInsts : SubtargetFeature<"flat-scratch-insts",
750b57cec5SDimitry Andric  "FlatScratchInsts",
760b57cec5SDimitry Andric  "true",
770b57cec5SDimitry Andric  "Have scratch_* flat memory instructions"
780b57cec5SDimitry Andric>;
790b57cec5SDimitry Andric
800b57cec5SDimitry Andricdef FeatureScalarFlatScratchInsts : SubtargetFeature<"scalar-flat-scratch-insts",
810b57cec5SDimitry Andric  "ScalarFlatScratchInsts",
820b57cec5SDimitry Andric  "true",
830b57cec5SDimitry Andric  "Have s_scratch_* flat memory instructions"
840b57cec5SDimitry Andric>;
850b57cec5SDimitry Andric
8681ad6265SDimitry Andricdef FeatureEnableFlatScratch : SubtargetFeature<"enable-flat-scratch",
8781ad6265SDimitry Andric  "EnableFlatScratch",
8881ad6265SDimitry Andric  "true",
8981ad6265SDimitry Andric  "Use scratch_* flat memory instructions to access scratch"
9081ad6265SDimitry Andric>;
9181ad6265SDimitry Andric
920b57cec5SDimitry Andricdef FeatureAddNoCarryInsts : SubtargetFeature<"add-no-carry-insts",
930b57cec5SDimitry Andric  "AddNoCarryInsts",
940b57cec5SDimitry Andric  "true",
950b57cec5SDimitry Andric  "Have VALU add/sub instructions without carry out"
960b57cec5SDimitry Andric>;
970b57cec5SDimitry Andric
980b57cec5SDimitry Andricdef FeatureUnalignedBufferAccess : SubtargetFeature<"unaligned-buffer-access",
990b57cec5SDimitry Andric  "UnalignedBufferAccess",
1000b57cec5SDimitry Andric  "true",
101e8d8bef9SDimitry Andric  "Hardware supports unaligned global loads and stores"
1020b57cec5SDimitry Andric>;
1030b57cec5SDimitry Andric
1040b57cec5SDimitry Andricdef FeatureTrapHandler: SubtargetFeature<"trap-handler",
1050b57cec5SDimitry Andric  "TrapHandler",
1060b57cec5SDimitry Andric  "true",
1070b57cec5SDimitry Andric  "Trap handler support"
1080b57cec5SDimitry Andric>;
1090b57cec5SDimitry Andric
1100b57cec5SDimitry Andricdef FeatureUnalignedScratchAccess : SubtargetFeature<"unaligned-scratch-access",
1110b57cec5SDimitry Andric  "UnalignedScratchAccess",
1120b57cec5SDimitry Andric  "true",
1130b57cec5SDimitry Andric  "Support unaligned scratch loads and stores"
1140b57cec5SDimitry Andric>;
1150b57cec5SDimitry Andric
116e8d8bef9SDimitry Andricdef FeatureUnalignedDSAccess : SubtargetFeature<"unaligned-ds-access",
117e8d8bef9SDimitry Andric  "UnalignedDSAccess",
118e8d8bef9SDimitry Andric  "true",
119e8d8bef9SDimitry Andric  "Hardware supports unaligned local and region loads and stores"
120e8d8bef9SDimitry Andric>;
121e8d8bef9SDimitry Andric
1220b57cec5SDimitry Andricdef FeatureApertureRegs : SubtargetFeature<"aperture-regs",
1230b57cec5SDimitry Andric  "HasApertureRegs",
1240b57cec5SDimitry Andric  "true",
1250b57cec5SDimitry Andric  "Has Memory Aperture Base and Size Registers"
1260b57cec5SDimitry Andric>;
1270b57cec5SDimitry Andric
1280b57cec5SDimitry Andricdef FeatureMadMixInsts : SubtargetFeature<"mad-mix-insts",
1290b57cec5SDimitry Andric  "HasMadMixInsts",
1300b57cec5SDimitry Andric  "true",
1310b57cec5SDimitry Andric  "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions"
1320b57cec5SDimitry Andric>;
1330b57cec5SDimitry Andric
1340b57cec5SDimitry Andricdef FeatureFmaMixInsts : SubtargetFeature<"fma-mix-insts",
1350b57cec5SDimitry Andric  "HasFmaMixInsts",
1360b57cec5SDimitry Andric  "true",
1370b57cec5SDimitry Andric  "Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions"
1380b57cec5SDimitry Andric>;
1390b57cec5SDimitry Andric
140e8d8bef9SDimitry Andricdef FeatureSupportsXNACK : SubtargetFeature<"xnack-support",
141e8d8bef9SDimitry Andric  "SupportsXNACK",
1420b57cec5SDimitry Andric  "true",
143e8d8bef9SDimitry Andric  "Hardware supports XNACK"
1440b57cec5SDimitry Andric>;
1450b57cec5SDimitry Andric
1460b57cec5SDimitry Andric// XNACK is disabled if SH_MEM_CONFIG.ADDRESS_MODE = GPUVM on chips that support
1470b57cec5SDimitry Andric// XNACK. The current default kernel driver setting is:
1480b57cec5SDimitry Andric// - graphics ring: XNACK disabled
1490b57cec5SDimitry Andric// - compute ring: XNACK enabled
1500b57cec5SDimitry Andric//
1510b57cec5SDimitry Andric// If XNACK is enabled, the VMEM latency can be worse.
1520b57cec5SDimitry Andric// If XNACK is disabled, the 2 SGPRs can be used for general purposes.
1530b57cec5SDimitry Andricdef FeatureXNACK : SubtargetFeature<"xnack",
1540b57cec5SDimitry Andric  "EnableXNACK",
1550b57cec5SDimitry Andric  "true",
1560b57cec5SDimitry Andric  "Enable XNACK support"
1570b57cec5SDimitry Andric>;
1580b57cec5SDimitry Andric
159fe6060f1SDimitry Andricdef FeatureTgSplit : SubtargetFeature<"tgsplit",
160fe6060f1SDimitry Andric  "EnableTgSplit",
161fe6060f1SDimitry Andric  "true",
162fe6060f1SDimitry Andric  "Enable threadgroup split execution"
163fe6060f1SDimitry Andric>;
164fe6060f1SDimitry Andric
1650b57cec5SDimitry Andricdef FeatureCuMode : SubtargetFeature<"cumode",
1660b57cec5SDimitry Andric  "EnableCuMode",
1670b57cec5SDimitry Andric  "true",
1680b57cec5SDimitry Andric  "Enable CU wavefront execution mode"
1690b57cec5SDimitry Andric>;
1700b57cec5SDimitry Andric
1710fca6ea1SDimitry Andricdef FeaturePreciseMemory
1720fca6ea1SDimitry Andric    : SubtargetFeature<"precise-memory", "EnablePreciseMemory",
1730fca6ea1SDimitry Andric                       "true", "Enable precise memory mode">;
1740fca6ea1SDimitry Andric
1750b57cec5SDimitry Andricdef FeatureSGPRInitBug : SubtargetFeature<"sgpr-init-bug",
1760b57cec5SDimitry Andric  "SGPRInitBug",
1770b57cec5SDimitry Andric  "true",
1780b57cec5SDimitry Andric  "VI SGPR initialization bug requiring a fixed SGPR allocation size"
1790b57cec5SDimitry Andric>;
1800b57cec5SDimitry Andric
18181ad6265SDimitry Andricdef FeatureUserSGPRInit16Bug : SubtargetFeature<"user-sgpr-init16-bug",
18281ad6265SDimitry Andric  "UserSGPRInit16Bug",
18381ad6265SDimitry Andric  "true",
18481ad6265SDimitry Andric  "Bug requiring at least 16 user+system SGPRs to be enabled"
18581ad6265SDimitry Andric>;
18681ad6265SDimitry Andric
1870b57cec5SDimitry Andricdef FeatureLdsMisalignedBug : SubtargetFeature<"lds-misaligned-bug",
1880b57cec5SDimitry Andric  "LDSMisalignedBug",
1890b57cec5SDimitry Andric  "true",
190e8d8bef9SDimitry Andric  "Some GFX10 bug with multi-dword LDS and flat access that is not naturally aligned in WGP mode"
1910b57cec5SDimitry Andric>;
1920b57cec5SDimitry Andric
1938bcb0991SDimitry Andricdef FeatureMFMAInlineLiteralBug : SubtargetFeature<"mfma-inline-literal-bug",
1948bcb0991SDimitry Andric  "HasMFMAInlineLiteralBug",
1958bcb0991SDimitry Andric  "true",
1968bcb0991SDimitry Andric  "MFMA cannot use inline literal as SrcC"
1978bcb0991SDimitry Andric>;
1988bcb0991SDimitry Andric
1990b57cec5SDimitry Andricdef FeatureVcmpxPermlaneHazard : SubtargetFeature<"vcmpx-permlane-hazard",
2000b57cec5SDimitry Andric  "HasVcmpxPermlaneHazard",
2010b57cec5SDimitry Andric  "true",
2020b57cec5SDimitry Andric  "TODO: describe me"
2030b57cec5SDimitry Andric>;
2040b57cec5SDimitry Andric
2050b57cec5SDimitry Andricdef FeatureVMEMtoScalarWriteHazard : SubtargetFeature<"vmem-to-scalar-write-hazard",
2060b57cec5SDimitry Andric  "HasVMEMtoScalarWriteHazard",
2070b57cec5SDimitry Andric  "true",
2080b57cec5SDimitry Andric  "VMEM instruction followed by scalar writing to EXEC mask, M0 or SGPR leads to incorrect execution."
2090b57cec5SDimitry Andric>;
2100b57cec5SDimitry Andric
2110b57cec5SDimitry Andricdef FeatureSMEMtoVectorWriteHazard : SubtargetFeature<"smem-to-vector-write-hazard",
2120b57cec5SDimitry Andric  "HasSMEMtoVectorWriteHazard",
2130b57cec5SDimitry Andric  "true",
2140b57cec5SDimitry Andric  "s_load_dword followed by v_cmp page faults"
2150b57cec5SDimitry Andric>;
2160b57cec5SDimitry Andric
2170b57cec5SDimitry Andricdef FeatureInstFwdPrefetchBug : SubtargetFeature<"inst-fwd-prefetch-bug",
2180b57cec5SDimitry Andric  "HasInstFwdPrefetchBug",
2190b57cec5SDimitry Andric  "true",
2200b57cec5SDimitry Andric  "S_INST_PREFETCH instruction causes shader to hang"
2210b57cec5SDimitry Andric>;
2220b57cec5SDimitry Andric
2230b57cec5SDimitry Andricdef FeatureVcmpxExecWARHazard : SubtargetFeature<"vcmpx-exec-war-hazard",
2240b57cec5SDimitry Andric  "HasVcmpxExecWARHazard",
2250b57cec5SDimitry Andric  "true",
2260b57cec5SDimitry Andric  "V_CMPX WAR hazard on EXEC (V_CMPX issue ONLY)"
2270b57cec5SDimitry Andric>;
2280b57cec5SDimitry Andric
2290b57cec5SDimitry Andricdef FeatureLdsBranchVmemWARHazard : SubtargetFeature<"lds-branch-vmem-war-hazard",
2300b57cec5SDimitry Andric  "HasLdsBranchVmemWARHazard",
2310b57cec5SDimitry Andric  "true",
2320b57cec5SDimitry Andric  "Switching between LDS and VMEM-tex not waiting VM_VSRC=0"
2330b57cec5SDimitry Andric>;
2340b57cec5SDimitry Andric
2350fca6ea1SDimitry Andricclass FeatureMaxHardClauseLength<int size> : SubtargetFeature<
2360fca6ea1SDimitry Andric  "max-hard-clause-length-"#size,
2370fca6ea1SDimitry Andric  "MaxHardClauseLength",
2380fca6ea1SDimitry Andric  !cast<string>(size),
2390fca6ea1SDimitry Andric  "Maximum number of instructions in an explicit S_CLAUSE is "#size
2400fca6ea1SDimitry Andric>;
2410fca6ea1SDimitry Andric
2420fca6ea1SDimitry Andric/// Work around a hardware bug on some chips that can be triggered
2430fca6ea1SDimitry Andric/// under certain circumstances when clauses are longer than 32 operations.
2440fca6ea1SDimitry Andricdef FeatureMaxHardClauseLength32 : FeatureMaxHardClauseLength<32>;
2450fca6ea1SDimitry Andric/// While the S_CLAUSE instruction permits encoding clause lengths up to 64,
2460fca6ea1SDimitry Andric/// hardware documentation for gfx10+ indicates that 63 is the maximum
2470fca6ea1SDimitry Andric/// permitted clause length.
2480fca6ea1SDimitry Andricdef FeatureMaxHardClauseLength63 : FeatureMaxHardClauseLength<63>;
2490fca6ea1SDimitry Andric
2500b57cec5SDimitry Andricdef FeatureNSAtoVMEMBug : SubtargetFeature<"nsa-to-vmem-bug",
2510b57cec5SDimitry Andric  "HasNSAtoVMEMBug",
2520b57cec5SDimitry Andric  "true",
2530b57cec5SDimitry Andric  "MIMG-NSA followed by VMEM fail if EXEC_LO or EXEC_HI equals zero"
2540b57cec5SDimitry Andric>;
2550b57cec5SDimitry Andric
256fe6060f1SDimitry Andricdef FeatureNSAClauseBug : SubtargetFeature<"nsa-clause-bug",
257fe6060f1SDimitry Andric  "HasNSAClauseBug",
258fe6060f1SDimitry Andric  "true",
259fe6060f1SDimitry Andric  "MIMG-NSA in a hard clause has unpredictable results on GFX10.1"
260fe6060f1SDimitry Andric>;
261fe6060f1SDimitry Andric
2620b57cec5SDimitry Andricdef FeatureFlatSegmentOffsetBug : SubtargetFeature<"flat-segment-offset-bug",
2630b57cec5SDimitry Andric  "HasFlatSegmentOffsetBug",
2640b57cec5SDimitry Andric  "true",
265fe6060f1SDimitry Andric  "GFX10 bug where inst_offset is ignored when flat instructions access global memory"
266fe6060f1SDimitry Andric>;
267fe6060f1SDimitry Andric
268fe6060f1SDimitry Andricdef FeatureNegativeScratchOffsetBug : SubtargetFeature<"negative-scratch-offset-bug",
269fe6060f1SDimitry Andric  "NegativeScratchOffsetBug",
270fe6060f1SDimitry Andric  "true",
271fe6060f1SDimitry Andric  "Negative immediate offsets in scratch instructions with an SGPR offset page fault on GFX9"
272fe6060f1SDimitry Andric>;
273fe6060f1SDimitry Andric
274fe6060f1SDimitry Andricdef FeatureNegativeUnalignedScratchOffsetBug : SubtargetFeature<"negative-unaligned-scratch-offset-bug",
275fe6060f1SDimitry Andric  "NegativeUnalignedScratchOffsetBug",
276fe6060f1SDimitry Andric  "true",
277fe6060f1SDimitry Andric  "Scratch instructions with a VGPR offset and a negative immediate offset that is not a multiple of 4 read wrong memory on GFX10"
2780b57cec5SDimitry Andric>;
2790b57cec5SDimitry Andric
2800b57cec5SDimitry Andricdef FeatureOffset3fBug : SubtargetFeature<"offset-3f-bug",
2810b57cec5SDimitry Andric  "HasOffset3fBug",
2820b57cec5SDimitry Andric  "true",
2830b57cec5SDimitry Andric  "Branch offset of 3f hardware bug"
2840b57cec5SDimitry Andric>;
2850b57cec5SDimitry Andric
286e8d8bef9SDimitry Andricdef FeatureImageStoreD16Bug : SubtargetFeature<"image-store-d16-bug",
287e8d8bef9SDimitry Andric  "HasImageStoreD16Bug",
288e8d8bef9SDimitry Andric  "true",
289e8d8bef9SDimitry Andric  "Image Store D16 hardware bug"
290e8d8bef9SDimitry Andric>;
291e8d8bef9SDimitry Andric
292e8d8bef9SDimitry Andricdef FeatureImageGather4D16Bug : SubtargetFeature<"image-gather4-d16-bug",
293e8d8bef9SDimitry Andric  "HasImageGather4D16Bug",
294e8d8bef9SDimitry Andric  "true",
295e8d8bef9SDimitry Andric  "Image Gather4 D16 hardware bug"
296e8d8bef9SDimitry Andric>;
297e8d8bef9SDimitry Andric
298bdd1243dSDimitry Andricdef FeatureMADIntraFwdBug : SubtargetFeature<"mad-intra-fwd-bug",
299bdd1243dSDimitry Andric  "HasMADIntraFwdBug",
300bdd1243dSDimitry Andric  "true",
301bdd1243dSDimitry Andric  "MAD_U64/I64 intra instruction forwarding bug"
302bdd1243dSDimitry Andric>;
303bdd1243dSDimitry Andric
3045f757f3fSDimitry Andricdef FeatureMSAALoadDstSelBug : SubtargetFeature<"msaa-load-dst-sel-bug",
3055f757f3fSDimitry Andric  "HasMSAALoadDstSelBug",
3065f757f3fSDimitry Andric  "true",
3075f757f3fSDimitry Andric  "MSAA loads not honoring dst_sel bug"
3085f757f3fSDimitry Andric>;
3095f757f3fSDimitry Andric
3100fca6ea1SDimitry Andricdef FeaturePrivEnabledTrap2NopBug : SubtargetFeature<"priv-enabled-trap2-nop-bug",
3110fca6ea1SDimitry Andric  "HasPrivEnabledTrap2NopBug",
3120fca6ea1SDimitry Andric  "true",
3130fca6ea1SDimitry Andric  "Hardware that runs with PRIV=1 interpreting 's_trap 2' as a nop bug"
3140fca6ea1SDimitry Andric>;
3150fca6ea1SDimitry Andric
3160b57cec5SDimitry Andricclass SubtargetFeatureLDSBankCount <int Value> : SubtargetFeature <
3170b57cec5SDimitry Andric  "ldsbankcount"#Value,
3180b57cec5SDimitry Andric  "LDSBankCount",
3190b57cec5SDimitry Andric  !cast<string>(Value),
3200b57cec5SDimitry Andric  "The number of LDS banks per compute unit."
3210b57cec5SDimitry Andric>;
3220b57cec5SDimitry Andric
3230b57cec5SDimitry Andricdef FeatureLDSBankCount16 : SubtargetFeatureLDSBankCount<16>;
3240b57cec5SDimitry Andricdef FeatureLDSBankCount32 : SubtargetFeatureLDSBankCount<32>;
3250b57cec5SDimitry Andric
3260b57cec5SDimitry Andricdef FeatureGCN3Encoding : SubtargetFeature<"gcn3-encoding",
3270b57cec5SDimitry Andric  "GCN3Encoding",
3280b57cec5SDimitry Andric  "true",
3290b57cec5SDimitry Andric  "Encoding format for VI"
3300b57cec5SDimitry Andric>;
3310b57cec5SDimitry Andric
3320b57cec5SDimitry Andricdef FeatureCIInsts : SubtargetFeature<"ci-insts",
3330b57cec5SDimitry Andric  "CIInsts",
3340b57cec5SDimitry Andric  "true",
3350b57cec5SDimitry Andric  "Additional instructions for CI+"
3360b57cec5SDimitry Andric>;
3370b57cec5SDimitry Andric
3380b57cec5SDimitry Andricdef FeatureGFX8Insts : SubtargetFeature<"gfx8-insts",
3390b57cec5SDimitry Andric  "GFX8Insts",
3400b57cec5SDimitry Andric  "true",
3410b57cec5SDimitry Andric  "Additional instructions for GFX8+"
3420b57cec5SDimitry Andric>;
3430b57cec5SDimitry Andric
3440b57cec5SDimitry Andricdef FeatureGFX9Insts : SubtargetFeature<"gfx9-insts",
3450b57cec5SDimitry Andric  "GFX9Insts",
3460b57cec5SDimitry Andric  "true",
3470b57cec5SDimitry Andric  "Additional instructions for GFX9+"
3480b57cec5SDimitry Andric>;
3490b57cec5SDimitry Andric
350fe6060f1SDimitry Andricdef FeatureGFX90AInsts : SubtargetFeature<"gfx90a-insts",
351fe6060f1SDimitry Andric  "GFX90AInsts",
352fe6060f1SDimitry Andric  "true",
353fe6060f1SDimitry Andric  "Additional instructions for GFX90A+"
3540fca6ea1SDimitry Andric  // [HasAtomicFMinFMaxF64GlobalInsts, HasAtomicFMinFMaxF64FlatInsts] // TODO
355fe6060f1SDimitry Andric>;
356fe6060f1SDimitry Andric
35781ad6265SDimitry Andricdef FeatureGFX940Insts : SubtargetFeature<"gfx940-insts",
35881ad6265SDimitry Andric  "GFX940Insts",
35981ad6265SDimitry Andric  "true",
36081ad6265SDimitry Andric  "Additional instructions for GFX940+"
36181ad6265SDimitry Andric>;
36281ad6265SDimitry Andric
3630b57cec5SDimitry Andricdef FeatureGFX10Insts : SubtargetFeature<"gfx10-insts",
3640b57cec5SDimitry Andric  "GFX10Insts",
3650b57cec5SDimitry Andric  "true",
3660b57cec5SDimitry Andric  "Additional instructions for GFX10+"
3670b57cec5SDimitry Andric>;
3680b57cec5SDimitry Andric
36981ad6265SDimitry Andricdef FeatureGFX11Insts : SubtargetFeature<"gfx11-insts",
37081ad6265SDimitry Andric  "GFX11Insts",
37181ad6265SDimitry Andric  "true",
37281ad6265SDimitry Andric  "Additional instructions for GFX11+"
37381ad6265SDimitry Andric>;
37481ad6265SDimitry Andric
3755f757f3fSDimitry Andricdef FeatureGFX12Insts : SubtargetFeature<"gfx12-insts",
3765f757f3fSDimitry Andric  "GFX12Insts",
3775f757f3fSDimitry Andric  "true",
3785f757f3fSDimitry Andric  "Additional instructions for GFX12+"
3795f757f3fSDimitry Andric>;
3805f757f3fSDimitry Andric
3815ffd83dbSDimitry Andricdef FeatureGFX10_3Insts : SubtargetFeature<"gfx10-3-insts",
3825ffd83dbSDimitry Andric  "GFX10_3Insts",
3835ffd83dbSDimitry Andric  "true",
3845ffd83dbSDimitry Andric  "Additional instructions for GFX10.3"
3855ffd83dbSDimitry Andric>;
3865ffd83dbSDimitry Andric
3870b57cec5SDimitry Andricdef FeatureGFX7GFX8GFX9Insts : SubtargetFeature<"gfx7-gfx8-gfx9-insts",
3880b57cec5SDimitry Andric  "GFX7GFX8GFX9Insts",
3890b57cec5SDimitry Andric  "true",
3900b57cec5SDimitry Andric  "Instructions shared in GFX7, GFX8, GFX9"
3910b57cec5SDimitry Andric>;
3920b57cec5SDimitry Andric
3930b57cec5SDimitry Andricdef FeatureSMemRealTime : SubtargetFeature<"s-memrealtime",
3940b57cec5SDimitry Andric  "HasSMemRealTime",
3950b57cec5SDimitry Andric  "true",
3960b57cec5SDimitry Andric  "Has s_memrealtime instruction"
3970b57cec5SDimitry Andric>;
3980b57cec5SDimitry Andric
3990b57cec5SDimitry Andricdef FeatureInv2PiInlineImm : SubtargetFeature<"inv-2pi-inline-imm",
4000b57cec5SDimitry Andric  "HasInv2PiInlineImm",
4010b57cec5SDimitry Andric  "true",
4020b57cec5SDimitry Andric  "Has 1 / (2 * pi) as inline immediate"
4030b57cec5SDimitry Andric>;
4040b57cec5SDimitry Andric
4050b57cec5SDimitry Andricdef Feature16BitInsts : SubtargetFeature<"16-bit-insts",
4060b57cec5SDimitry Andric  "Has16BitInsts",
4070b57cec5SDimitry Andric  "true",
4080b57cec5SDimitry Andric  "Has i16/f16 instructions"
4090b57cec5SDimitry Andric>;
4100b57cec5SDimitry Andric
41181ad6265SDimitry Andricdef FeatureTrue16BitInsts : SubtargetFeature<"true16",
41281ad6265SDimitry Andric  "HasTrue16BitInsts",
41381ad6265SDimitry Andric  "true",
41481ad6265SDimitry Andric  "True 16-bit operand instructions"
41581ad6265SDimitry Andric>;
41681ad6265SDimitry Andric
4175f757f3fSDimitry Andricdef FeatureRealTrue16Insts : SubtargetFeature<"real-true16",
4185f757f3fSDimitry Andric  "EnableRealTrue16Insts",
4195f757f3fSDimitry Andric  "true",
4205f757f3fSDimitry Andric  "Use true 16-bit registers"
4215f757f3fSDimitry Andric>;
4225f757f3fSDimitry Andric
4230b57cec5SDimitry Andricdef FeatureVOP3P : SubtargetFeature<"vop3p",
4240b57cec5SDimitry Andric  "HasVOP3PInsts",
4250b57cec5SDimitry Andric  "true",
4260b57cec5SDimitry Andric  "Has VOP3P packed instructions"
4270b57cec5SDimitry Andric>;
4280b57cec5SDimitry Andric
4290b57cec5SDimitry Andricdef FeatureMovrel : SubtargetFeature<"movrel",
4300b57cec5SDimitry Andric  "HasMovrel",
4310b57cec5SDimitry Andric  "true",
4320b57cec5SDimitry Andric  "Has v_movrel*_b32 instructions"
4330b57cec5SDimitry Andric>;
4340b57cec5SDimitry Andric
4350b57cec5SDimitry Andricdef FeatureVGPRIndexMode : SubtargetFeature<"vgpr-index-mode",
4360b57cec5SDimitry Andric  "HasVGPRIndexMode",
4370b57cec5SDimitry Andric  "true",
4380b57cec5SDimitry Andric  "Has VGPR mode register indexing"
4390b57cec5SDimitry Andric>;
4400b57cec5SDimitry Andric
4415f757f3fSDimitry Andricdef FeatureScalarDwordx3Loads : SubtargetFeature<"scalar-dwordx3-loads",
4425f757f3fSDimitry Andric  "HasScalarDwordx3Loads",
4435f757f3fSDimitry Andric  "true",
4445f757f3fSDimitry Andric  "Has 96-bit scalar load instructions"
4455f757f3fSDimitry Andric>;
4465f757f3fSDimitry Andric
4470b57cec5SDimitry Andricdef FeatureScalarStores : SubtargetFeature<"scalar-stores",
4480b57cec5SDimitry Andric  "HasScalarStores",
4490b57cec5SDimitry Andric  "true",
4500b57cec5SDimitry Andric  "Has store scalar memory instructions"
4510b57cec5SDimitry Andric>;
4520b57cec5SDimitry Andric
4530b57cec5SDimitry Andricdef FeatureScalarAtomics : SubtargetFeature<"scalar-atomics",
4540b57cec5SDimitry Andric  "HasScalarAtomics",
4550b57cec5SDimitry Andric  "true",
4560b57cec5SDimitry Andric  "Has atomic scalar memory instructions"
4570b57cec5SDimitry Andric>;
4580b57cec5SDimitry Andric
4590b57cec5SDimitry Andricdef FeatureSDWA : SubtargetFeature<"sdwa",
4600b57cec5SDimitry Andric  "HasSDWA",
4610b57cec5SDimitry Andric  "true",
4620b57cec5SDimitry Andric  "Support SDWA (Sub-DWORD Addressing) extension"
4630b57cec5SDimitry Andric>;
4640b57cec5SDimitry Andric
4650b57cec5SDimitry Andricdef FeatureSDWAOmod : SubtargetFeature<"sdwa-omod",
4660b57cec5SDimitry Andric  "HasSDWAOmod",
4670b57cec5SDimitry Andric  "true",
4680b57cec5SDimitry Andric  "Support OMod with SDWA (Sub-DWORD Addressing) extension"
4690b57cec5SDimitry Andric>;
4700b57cec5SDimitry Andric
4710b57cec5SDimitry Andricdef FeatureSDWAScalar : SubtargetFeature<"sdwa-scalar",
4720b57cec5SDimitry Andric  "HasSDWAScalar",
4730b57cec5SDimitry Andric  "true",
4740b57cec5SDimitry Andric  "Support scalar register with SDWA (Sub-DWORD Addressing) extension"
4750b57cec5SDimitry Andric>;
4760b57cec5SDimitry Andric
4770b57cec5SDimitry Andricdef FeatureSDWASdst : SubtargetFeature<"sdwa-sdst",
4780b57cec5SDimitry Andric  "HasSDWASdst",
4790b57cec5SDimitry Andric  "true",
4800b57cec5SDimitry Andric  "Support scalar dst for VOPC with SDWA (Sub-DWORD Addressing) extension"
4810b57cec5SDimitry Andric>;
4820b57cec5SDimitry Andric
4830b57cec5SDimitry Andricdef FeatureSDWAMac : SubtargetFeature<"sdwa-mav",
4840b57cec5SDimitry Andric  "HasSDWAMac",
4850b57cec5SDimitry Andric  "true",
4860b57cec5SDimitry Andric  "Support v_mac_f32/f16 with SDWA (Sub-DWORD Addressing) extension"
4870b57cec5SDimitry Andric>;
4880b57cec5SDimitry Andric
4890b57cec5SDimitry Andricdef FeatureSDWAOutModsVOPC : SubtargetFeature<"sdwa-out-mods-vopc",
4900b57cec5SDimitry Andric  "HasSDWAOutModsVOPC",
4910b57cec5SDimitry Andric  "true",
4920b57cec5SDimitry Andric  "Support clamp for VOPC with SDWA (Sub-DWORD Addressing) extension"
4930b57cec5SDimitry Andric>;
4940b57cec5SDimitry Andric
4950b57cec5SDimitry Andricdef FeatureDPP : SubtargetFeature<"dpp",
4960b57cec5SDimitry Andric  "HasDPP",
4970b57cec5SDimitry Andric  "true",
4980b57cec5SDimitry Andric  "Support DPP (Data Parallel Primitives) extension"
4990b57cec5SDimitry Andric>;
5000b57cec5SDimitry Andric
501349cc55cSDimitry Andric// DPP8 allows arbitrary cross-lane swizzling within groups of 8 lanes.
5020b57cec5SDimitry Andricdef FeatureDPP8 : SubtargetFeature<"dpp8",
5030b57cec5SDimitry Andric  "HasDPP8",
5040b57cec5SDimitry Andric  "true",
5050b57cec5SDimitry Andric  "Support DPP8 (Data Parallel Primitives) extension"
5060b57cec5SDimitry Andric>;
5070b57cec5SDimitry Andric
5085f757f3fSDimitry Andricdef FeatureDPALU_DPP : SubtargetFeature<"dpp-64bit",
5095f757f3fSDimitry Andric  "HasDPALU_DPP",
510fe6060f1SDimitry Andric  "true",
5115f757f3fSDimitry Andric  "Support DPP (Data Parallel Primitives) extension in DP ALU"
5125f757f3fSDimitry Andric>;
5135f757f3fSDimitry Andric
5145f757f3fSDimitry Andricdef FeatureDPPSrc1SGPR : SubtargetFeature<"dpp-src1-sgpr",
5155f757f3fSDimitry Andric  "HasDPPSrc1SGPR",
5165f757f3fSDimitry Andric  "true",
5175f757f3fSDimitry Andric  "Support SGPR for Src1 of DPP instructions"
518fe6060f1SDimitry Andric>;
519fe6060f1SDimitry Andric
520fe6060f1SDimitry Andricdef FeaturePackedFP32Ops : SubtargetFeature<"packed-fp32-ops",
521fe6060f1SDimitry Andric  "HasPackedFP32Ops",
522fe6060f1SDimitry Andric  "true",
523fe6060f1SDimitry Andric  "Support packed fp32 instructions"
524fe6060f1SDimitry Andric>;
525fe6060f1SDimitry Andric
5260b57cec5SDimitry Andricdef FeatureR128A16 : SubtargetFeature<"r128-a16",
5270b57cec5SDimitry Andric  "HasR128A16",
5280b57cec5SDimitry Andric  "true",
5295ffd83dbSDimitry Andric  "Support gfx9-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands, where a16 is aliased with r128"
5305ffd83dbSDimitry Andric>;
5315ffd83dbSDimitry Andric
532bdd1243dSDimitry Andricdef FeatureA16 : SubtargetFeature<"a16",
533bdd1243dSDimitry Andric  "HasA16",
5345ffd83dbSDimitry Andric  "true",
535bdd1243dSDimitry Andric  "Support A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands"
5365ffd83dbSDimitry Andric>;
5375ffd83dbSDimitry Andric
5385ffd83dbSDimitry Andricdef FeatureG16 : SubtargetFeature<"g16",
5395ffd83dbSDimitry Andric  "HasG16",
5405ffd83dbSDimitry Andric  "true",
5415ffd83dbSDimitry Andric  "Support G16 for 16-bit gradient image operands"
5420b57cec5SDimitry Andric>;
5430b57cec5SDimitry Andric
5440b57cec5SDimitry Andricdef FeatureNSAEncoding : SubtargetFeature<"nsa-encoding",
5450b57cec5SDimitry Andric  "HasNSAEncoding",
5460b57cec5SDimitry Andric  "true",
5470b57cec5SDimitry Andric  "Support NSA encoding for image instructions"
5480b57cec5SDimitry Andric>;
5490b57cec5SDimitry Andric
55006c3fb27SDimitry Andricdef FeaturePartialNSAEncoding : SubtargetFeature<"partial-nsa-encoding",
55106c3fb27SDimitry Andric  "HasPartialNSAEncoding",
55206c3fb27SDimitry Andric  "true",
55306c3fb27SDimitry Andric  "Support partial NSA encoding for image instructions"
55406c3fb27SDimitry Andric>;
55506c3fb27SDimitry Andric
55681ad6265SDimitry Andricdef FeatureImageInsts : SubtargetFeature<"image-insts",
55781ad6265SDimitry Andric  "HasImageInsts",
55881ad6265SDimitry Andric  "true",
55981ad6265SDimitry Andric  "Support image instructions"
56081ad6265SDimitry Andric>;
56181ad6265SDimitry Andric
562fe6060f1SDimitry Andricdef FeatureExtendedImageInsts : SubtargetFeature<"extended-image-insts",
563fe6060f1SDimitry Andric  "HasExtendedImageInsts",
564fe6060f1SDimitry Andric  "true",
565fe6060f1SDimitry Andric  "Support mips != 0, lod != 0, gather4, and get_lod"
566fe6060f1SDimitry Andric>;
567fe6060f1SDimitry Andric
568fe6060f1SDimitry Andricdef FeatureGFX10_AEncoding : SubtargetFeature<"gfx10_a-encoding",
569fe6060f1SDimitry Andric  "GFX10_AEncoding",
570fe6060f1SDimitry Andric  "true",
571fe6060f1SDimitry Andric  "Has BVH ray tracing instructions"
572fe6060f1SDimitry Andric>;
573fe6060f1SDimitry Andric
5745ffd83dbSDimitry Andricdef FeatureGFX10_BEncoding : SubtargetFeature<"gfx10_b-encoding",
5755ffd83dbSDimitry Andric  "GFX10_BEncoding",
5765ffd83dbSDimitry Andric  "true",
5775ffd83dbSDimitry Andric  "Encoding format GFX10_B"
5785ffd83dbSDimitry Andric>;
5795ffd83dbSDimitry Andric
5800b57cec5SDimitry Andricdef FeatureIntClamp : SubtargetFeature<"int-clamp-insts",
5810b57cec5SDimitry Andric  "HasIntClamp",
5820b57cec5SDimitry Andric  "true",
5830b57cec5SDimitry Andric  "Support clamp for integer destination"
5840b57cec5SDimitry Andric>;
5850b57cec5SDimitry Andric
5860b57cec5SDimitry Andricdef FeatureUnpackedD16VMem : SubtargetFeature<"unpacked-d16-vmem",
5870b57cec5SDimitry Andric  "HasUnpackedD16VMem",
5880b57cec5SDimitry Andric  "true",
5890b57cec5SDimitry Andric  "Has unpacked d16 vmem instructions"
5900b57cec5SDimitry Andric>;
5910b57cec5SDimitry Andric
5920b57cec5SDimitry Andricdef FeatureDLInsts : SubtargetFeature<"dl-insts",
5930b57cec5SDimitry Andric  "HasDLInsts",
5940b57cec5SDimitry Andric  "true",
5950b57cec5SDimitry Andric  "Has v_fmac_f32 and v_xnor_b32 instructions"
5960b57cec5SDimitry Andric>;
5970b57cec5SDimitry Andric
598bdd1243dSDimitry Andricdef FeatureFmacF64Inst : SubtargetFeature<"fmacf64-inst",
599bdd1243dSDimitry Andric  "HasFmacF64Inst",
600bdd1243dSDimitry Andric  "true",
601bdd1243dSDimitry Andric  "Has v_fmac_f64 instruction"
602bdd1243dSDimitry Andric>;
603bdd1243dSDimitry Andric
6040b57cec5SDimitry Andricdef FeatureDot1Insts : SubtargetFeature<"dot1-insts",
6050b57cec5SDimitry Andric  "HasDot1Insts",
6060b57cec5SDimitry Andric  "true",
6070b57cec5SDimitry Andric  "Has v_dot4_i32_i8 and v_dot8_i32_i4 instructions"
6080b57cec5SDimitry Andric>;
6090b57cec5SDimitry Andric
6100b57cec5SDimitry Andricdef FeatureDot2Insts : SubtargetFeature<"dot2-insts",
6110b57cec5SDimitry Andric  "HasDot2Insts",
6120b57cec5SDimitry Andric  "true",
613fe6060f1SDimitry Andric  "Has v_dot2_i32_i16, v_dot2_u32_u16 instructions"
6140b57cec5SDimitry Andric>;
6150b57cec5SDimitry Andric
6160b57cec5SDimitry Andricdef FeatureDot3Insts : SubtargetFeature<"dot3-insts",
6170b57cec5SDimitry Andric  "HasDot3Insts",
6180b57cec5SDimitry Andric  "true",
6190b57cec5SDimitry Andric  "Has v_dot8c_i32_i4 instruction"
6200b57cec5SDimitry Andric>;
6210b57cec5SDimitry Andric
6220b57cec5SDimitry Andricdef FeatureDot4Insts : SubtargetFeature<"dot4-insts",
6230b57cec5SDimitry Andric  "HasDot4Insts",
6240b57cec5SDimitry Andric  "true",
6250b57cec5SDimitry Andric  "Has v_dot2c_i32_i16 instruction"
6260b57cec5SDimitry Andric>;
6270b57cec5SDimitry Andric
6280b57cec5SDimitry Andricdef FeatureDot5Insts : SubtargetFeature<"dot5-insts",
6290b57cec5SDimitry Andric  "HasDot5Insts",
6300b57cec5SDimitry Andric  "true",
6310b57cec5SDimitry Andric  "Has v_dot2c_f32_f16 instruction"
6320b57cec5SDimitry Andric>;
6330b57cec5SDimitry Andric
6340b57cec5SDimitry Andricdef FeatureDot6Insts : SubtargetFeature<"dot6-insts",
6350b57cec5SDimitry Andric  "HasDot6Insts",
6360b57cec5SDimitry Andric  "true",
6370b57cec5SDimitry Andric  "Has v_dot4c_i32_i8 instruction"
6380b57cec5SDimitry Andric>;
6390b57cec5SDimitry Andric
640fe6060f1SDimitry Andricdef FeatureDot7Insts : SubtargetFeature<"dot7-insts",
641fe6060f1SDimitry Andric  "HasDot7Insts",
642fe6060f1SDimitry Andric  "true",
64306c3fb27SDimitry Andric  "Has v_dot4_u32_u8, v_dot8_u32_u4 instructions"
644fe6060f1SDimitry Andric>;
645fe6060f1SDimitry Andric
64681ad6265SDimitry Andricdef FeatureDot8Insts : SubtargetFeature<"dot8-insts",
64781ad6265SDimitry Andric  "HasDot8Insts",
64881ad6265SDimitry Andric  "true",
649bdd1243dSDimitry Andric  "Has v_dot4_i32_iu8, v_dot8_i32_iu4 instructions"
650bdd1243dSDimitry Andric>;
651bdd1243dSDimitry Andric
652bdd1243dSDimitry Andricdef FeatureDot9Insts : SubtargetFeature<"dot9-insts",
653bdd1243dSDimitry Andric  "HasDot9Insts",
654bdd1243dSDimitry Andric  "true",
655bdd1243dSDimitry Andric  "Has v_dot2_f16_f16, v_dot2_bf16_bf16, v_dot2_f32_bf16 instructions"
65681ad6265SDimitry Andric>;
65781ad6265SDimitry Andric
65806c3fb27SDimitry Andricdef FeatureDot10Insts : SubtargetFeature<"dot10-insts",
65906c3fb27SDimitry Andric  "HasDot10Insts",
66006c3fb27SDimitry Andric  "true",
66106c3fb27SDimitry Andric  "Has v_dot2_f32_f16 instruction"
66206c3fb27SDimitry Andric>;
66306c3fb27SDimitry Andric
6640fca6ea1SDimitry Andricdef FeatureDot11Insts : SubtargetFeature<"dot11-insts",
6650fca6ea1SDimitry Andric  "HasDot11Insts",
6660fca6ea1SDimitry Andric  "true",
6670fca6ea1SDimitry Andric  "Has v_dot4_f32_fp8_fp8, v_dot4_f32_fp8_bf8, v_dot4_f32_bf8_fp8, v_dot4_f32_bf8_bf8 instructions"
6680fca6ea1SDimitry Andric>;
6690fca6ea1SDimitry Andric
6700b57cec5SDimitry Andricdef FeatureMAIInsts : SubtargetFeature<"mai-insts",
6710b57cec5SDimitry Andric  "HasMAIInsts",
6720b57cec5SDimitry Andric  "true",
6730b57cec5SDimitry Andric  "Has mAI instructions"
6740b57cec5SDimitry Andric>;
6750b57cec5SDimitry Andric
676fcaf7f86SDimitry Andricdef FeatureFP8Insts : SubtargetFeature<"fp8-insts",
677fcaf7f86SDimitry Andric  "HasFP8Insts",
678fcaf7f86SDimitry Andric  "true",
679fcaf7f86SDimitry Andric  "Has fp8 and bf8 instructions"
680fcaf7f86SDimitry Andric>;
681fcaf7f86SDimitry Andric
6827a6dacacSDimitry Andricdef FeatureFP8ConversionInsts : SubtargetFeature<"fp8-conversion-insts",
6837a6dacacSDimitry Andric  "HasFP8ConversionInsts",
6847a6dacacSDimitry Andric  "true",
6857a6dacacSDimitry Andric  "Has fp8 and bf8 conversion instructions"
6867a6dacacSDimitry Andric>;
6877a6dacacSDimitry Andric
6880b57cec5SDimitry Andricdef FeaturePkFmacF16Inst : SubtargetFeature<"pk-fmac-f16-inst",
6890b57cec5SDimitry Andric  "HasPkFmacF16Inst",
6900b57cec5SDimitry Andric  "true",
6910b57cec5SDimitry Andric  "Has v_pk_fmac_f16 instruction"
6920b57cec5SDimitry Andric>;
6930b57cec5SDimitry Andric
69406c3fb27SDimitry Andricdef FeatureAtomicDsPkAdd16Insts : SubtargetFeature<"atomic-ds-pk-add-16-insts",
69506c3fb27SDimitry Andric  "HasAtomicDsPkAdd16Insts",
69606c3fb27SDimitry Andric  "true",
69706c3fb27SDimitry Andric  "Has ds_pk_add_bf16, ds_pk_add_f16, ds_pk_add_rtn_bf16, "
69806c3fb27SDimitry Andric  "ds_pk_add_rtn_f16 instructions"
69906c3fb27SDimitry Andric>;
70006c3fb27SDimitry Andric
70106c3fb27SDimitry Andricdef FeatureAtomicFlatPkAdd16Insts : SubtargetFeature<"atomic-flat-pk-add-16-insts",
70206c3fb27SDimitry Andric  "HasAtomicFlatPkAdd16Insts",
70306c3fb27SDimitry Andric  "true",
70406c3fb27SDimitry Andric  "Has flat_atomic_pk_add_f16 and flat_atomic_pk_add_bf16 instructions"
70506c3fb27SDimitry Andric>;
70606c3fb27SDimitry Andric
70781ad6265SDimitry Andricdef FeatureAtomicFaddRtnInsts : SubtargetFeature<"atomic-fadd-rtn-insts",
70881ad6265SDimitry Andric  "HasAtomicFaddRtnInsts",
7090b57cec5SDimitry Andric  "true",
71081ad6265SDimitry Andric  "Has buffer_atomic_add_f32 and global_atomic_add_f32 instructions that "
71181ad6265SDimitry Andric  "return original value",
71281ad6265SDimitry Andric  [FeatureFlatGlobalInsts]
71381ad6265SDimitry Andric>;
71481ad6265SDimitry Andric
7150fca6ea1SDimitry Andricdef FeatureAtomicFMinFMaxF32GlobalInsts : SubtargetFeature<"atomic-fmin-fmax-global-f32",
7160fca6ea1SDimitry Andric  "HasAtomicFMinFMaxF32GlobalInsts",
7170fca6ea1SDimitry Andric  "true",
7180fca6ea1SDimitry Andric  "Has global/buffer instructions for atomicrmw fmin/fmax for float"
7190fca6ea1SDimitry Andric>;
7200fca6ea1SDimitry Andric
7210fca6ea1SDimitry Andricdef FeatureAtomicFMinFMaxF64GlobalInsts : SubtargetFeature<"atomic-fmin-fmax-global-f64",
7220fca6ea1SDimitry Andric  "HasAtomicFMinFMaxF64GlobalInsts",
7230fca6ea1SDimitry Andric  "true",
7240fca6ea1SDimitry Andric  "Has global/buffer instructions for atomicrmw fmin/fmax for float"
7250fca6ea1SDimitry Andric>;
7260fca6ea1SDimitry Andric
7270fca6ea1SDimitry Andricdef FeatureAtomicFMinFMaxF32FlatInsts : SubtargetFeature<"atomic-fmin-fmax-flat-f32",
7280fca6ea1SDimitry Andric  "HasAtomicFMinFMaxF32FlatInsts",
7290fca6ea1SDimitry Andric  "true",
7300fca6ea1SDimitry Andric  "Has flat memory instructions for atomicrmw fmin/fmax for float"
7310fca6ea1SDimitry Andric>;
7320fca6ea1SDimitry Andric
7330fca6ea1SDimitry Andricdef FeatureAtomicFMinFMaxF64FlatInsts : SubtargetFeature<"atomic-fmin-fmax-flat-f64",
7340fca6ea1SDimitry Andric  "HasAtomicFMinFMaxF64FlatInsts",
7350fca6ea1SDimitry Andric  "true",
7360fca6ea1SDimitry Andric  "Has flat memory instructions for atomicrmw fmin/fmax for double"
7370fca6ea1SDimitry Andric>;
7380fca6ea1SDimitry Andric
73981ad6265SDimitry Andricdef FeatureAtomicFaddNoRtnInsts : SubtargetFeature<"atomic-fadd-no-rtn-insts",
74081ad6265SDimitry Andric  "HasAtomicFaddNoRtnInsts",
74181ad6265SDimitry Andric  "true",
74281ad6265SDimitry Andric  "Has buffer_atomic_add_f32 and global_atomic_add_f32 instructions that "
74381ad6265SDimitry Andric  "don't return original value",
74481ad6265SDimitry Andric  [FeatureFlatGlobalInsts]
74581ad6265SDimitry Andric>;
74681ad6265SDimitry Andric
74706c3fb27SDimitry Andricdef FeatureAtomicBufferGlobalPkAddF16NoRtnInsts
74806c3fb27SDimitry Andric  : SubtargetFeature<"atomic-buffer-global-pk-add-f16-no-rtn-insts",
74906c3fb27SDimitry Andric  "HasAtomicBufferGlobalPkAddF16NoRtnInsts",
75081ad6265SDimitry Andric  "true",
75181ad6265SDimitry Andric  "Has buffer_atomic_pk_add_f16 and global_atomic_pk_add_f16 instructions that "
75281ad6265SDimitry Andric  "don't return original value",
7535ffd83dbSDimitry Andric  [FeatureFlatGlobalInsts]
7540b57cec5SDimitry Andric>;
7550b57cec5SDimitry Andric
75606c3fb27SDimitry Andricdef FeatureAtomicBufferGlobalPkAddF16Insts : SubtargetFeature<"atomic-buffer-global-pk-add-f16-insts",
75706c3fb27SDimitry Andric "HasAtomicBufferGlobalPkAddF16Insts",
75806c3fb27SDimitry Andric "true",
75906c3fb27SDimitry Andric "Has buffer_atomic_pk_add_f16 and global_atomic_pk_add_f16 instructions that "
76006c3fb27SDimitry Andric "can return original value",
76106c3fb27SDimitry Andric [FeatureFlatGlobalInsts]
76206c3fb27SDimitry Andric>;
76306c3fb27SDimitry Andric
76406c3fb27SDimitry Andricdef FeatureAtomicGlobalPkAddBF16Inst : SubtargetFeature<"atomic-global-pk-add-bf16-inst",
76506c3fb27SDimitry Andric "HasAtomicGlobalPkAddBF16Inst",
76606c3fb27SDimitry Andric "true",
76706c3fb27SDimitry Andric "Has global_atomic_pk_add_bf16 instruction",
76806c3fb27SDimitry Andric [FeatureFlatGlobalInsts]
76906c3fb27SDimitry Andric>;
77006c3fb27SDimitry Andric
7710fca6ea1SDimitry Andricdef FeatureAtomicBufferPkAddBF16Inst : SubtargetFeature<"atomic-buffer-pk-add-bf16-inst",
7720fca6ea1SDimitry Andric "HasAtomicBufferPkAddBF16Inst",
7730fca6ea1SDimitry Andric "true",
7740fca6ea1SDimitry Andric "Has buffer_atomic_pk_add_bf16 instruction"
7750fca6ea1SDimitry Andric>;
7760fca6ea1SDimitry Andric
7775f757f3fSDimitry Andricdef FeatureAtomicCSubNoRtnInsts : SubtargetFeature<"atomic-csub-no-rtn-insts",
7785f757f3fSDimitry Andric  "HasAtomicCSubNoRtnInsts",
7795f757f3fSDimitry Andric  "true",
7805f757f3fSDimitry Andric  "Has buffer_atomic_csub and global_atomic_csub instructions that don't "
7815f757f3fSDimitry Andric  "return original value"
7825f757f3fSDimitry Andric>;
7835f757f3fSDimitry Andric
784bdd1243dSDimitry Andricdef FeatureFlatAtomicFaddF32Inst
785bdd1243dSDimitry Andric  : SubtargetFeature<"flat-atomic-fadd-f32-inst",
786bdd1243dSDimitry Andric  "HasFlatAtomicFaddF32Inst",
787bdd1243dSDimitry Andric  "true",
788bdd1243dSDimitry Andric  "Has flat_atomic_add_f32 instruction"
789bdd1243dSDimitry Andric>;
790bdd1243dSDimitry Andric
7910fca6ea1SDimitry Andricdef FeatureFlatBufferGlobalAtomicFaddF64Inst
7920fca6ea1SDimitry Andric  : SubtargetFeature<"flat-buffer-global-fadd-f64-inst",
7930fca6ea1SDimitry Andric  "HasFlatBufferGlobalAtomicFaddF64Inst",
7940fca6ea1SDimitry Andric  "true",
7950fca6ea1SDimitry Andric  "Has flat, buffer, and global instructions for f64 atomic fadd"
7960fca6ea1SDimitry Andric>;
7970fca6ea1SDimitry Andric
7980fca6ea1SDimitry Andricdef FeatureMemoryAtomicFAddF32DenormalSupport
7990fca6ea1SDimitry Andric  : SubtargetFeature<"memory-atomic-fadd-f32-denormal-support",
8000fca6ea1SDimitry Andric  "HasMemoryAtomicFaddF32DenormalSupport",
8010fca6ea1SDimitry Andric  "true",
8020fca6ea1SDimitry Andric  "global/flat/buffer atomic fadd for float supports denormal handling"
8030fca6ea1SDimitry Andric>;
8040fca6ea1SDimitry Andric
8050fca6ea1SDimitry Andricdef FeatureAgentScopeFineGrainedRemoteMemoryAtomics
8060fca6ea1SDimitry Andric  : SubtargetFeature<"agent-scope-fine-grained-remote-memory-atomics",
8070fca6ea1SDimitry Andric  "HasAgentScopeFineGrainedRemoteMemoryAtomics",
8080fca6ea1SDimitry Andric  "true",
8090fca6ea1SDimitry Andric  "Agent (device) scoped atomic operations, excluding those directly "
8100fca6ea1SDimitry Andric  "supported by PCIe (i.e. integer atomic add, exchange, and "
8110fca6ea1SDimitry Andric  "compare-and-swap), are functional for allocations in host or peer "
8120fca6ea1SDimitry Andric  "device memory."
8130fca6ea1SDimitry Andric>;
8140fca6ea1SDimitry Andric
8157a6dacacSDimitry Andricdef FeatureDefaultComponentZero : SubtargetFeature<"default-component-zero",
8167a6dacacSDimitry Andric  "HasDefaultComponentZero",
8177a6dacacSDimitry Andric  "true",
8187a6dacacSDimitry Andric  "BUFFER/IMAGE store instructions set unspecified components to zero (before GFX12)"
8197a6dacacSDimitry Andric>;
8207a6dacacSDimitry Andric
8217a6dacacSDimitry Andricdef FeatureDefaultComponentBroadcast : SubtargetFeature<"default-component-broadcast",
8227a6dacacSDimitry Andric  "HasDefaultComponentBroadcast",
8237a6dacacSDimitry Andric  "true",
8247a6dacacSDimitry Andric  "BUFFER/IMAGE store instructions set unspecified components to x component (GFX12)"
8257a6dacacSDimitry Andric>;
8267a6dacacSDimitry Andric
827e8d8bef9SDimitry Andricdef FeatureSupportsSRAMECC : SubtargetFeature<"sramecc-support",
828e8d8bef9SDimitry Andric  "SupportsSRAMECC",
8290b57cec5SDimitry Andric  "true",
830e8d8bef9SDimitry Andric  "Hardware supports SRAMECC"
8310b57cec5SDimitry Andric>;
8320b57cec5SDimitry Andric
833e8d8bef9SDimitry Andricdef FeatureSRAMECC : SubtargetFeature<"sramecc",
8340b57cec5SDimitry Andric  "EnableSRAMECC",
8350b57cec5SDimitry Andric  "true",
8360b57cec5SDimitry Andric  "Enable SRAMECC"
8370b57cec5SDimitry Andric>;
8380b57cec5SDimitry Andric
8390b57cec5SDimitry Andricdef FeatureNoSdstCMPX : SubtargetFeature<"no-sdst-cmpx",
8400b57cec5SDimitry Andric  "HasNoSdstCMPX",
8410b57cec5SDimitry Andric  "true",
8420b57cec5SDimitry Andric  "V_CMPX does not write VCC/SGPR in addition to EXEC"
8430b57cec5SDimitry Andric>;
8440b57cec5SDimitry Andric
8450b57cec5SDimitry Andricdef FeatureVscnt : SubtargetFeature<"vscnt",
8460b57cec5SDimitry Andric  "HasVscnt",
8470b57cec5SDimitry Andric  "true",
8480b57cec5SDimitry Andric  "Has separate store vscnt counter"
8490b57cec5SDimitry Andric>;
8500b57cec5SDimitry Andric
8515ffd83dbSDimitry Andricdef FeatureGetWaveIdInst : SubtargetFeature<"get-wave-id-inst",
8525ffd83dbSDimitry Andric  "HasGetWaveIdInst",
8535ffd83dbSDimitry Andric  "true",
8545ffd83dbSDimitry Andric  "Has s_get_waveid_in_workgroup instruction"
8555ffd83dbSDimitry Andric>;
8565ffd83dbSDimitry Andric
8575ffd83dbSDimitry Andricdef FeatureSMemTimeInst : SubtargetFeature<"s-memtime-inst",
8585ffd83dbSDimitry Andric  "HasSMemTimeInst",
8595ffd83dbSDimitry Andric  "true",
8605ffd83dbSDimitry Andric  "Has s_memtime instruction"
8615ffd83dbSDimitry Andric>;
8625ffd83dbSDimitry Andric
863fe6060f1SDimitry Andricdef FeatureShaderCyclesRegister : SubtargetFeature<"shader-cycles-register",
864fe6060f1SDimitry Andric  "HasShaderCyclesRegister",
865fe6060f1SDimitry Andric  "true",
866fe6060f1SDimitry Andric  "Has SHADER_CYCLES hardware register"
867fe6060f1SDimitry Andric>;
868fe6060f1SDimitry Andric
8691db9f3b2SDimitry Andricdef FeatureShaderCyclesHiLoRegisters : SubtargetFeature<"shader-cycles-hi-lo-registers",
8701db9f3b2SDimitry Andric  "HasShaderCyclesHiLoRegisters",
8711db9f3b2SDimitry Andric  "true",
8721db9f3b2SDimitry Andric  "Has SHADER_CYCLES_HI/LO hardware registers"
8731db9f3b2SDimitry Andric>;
8741db9f3b2SDimitry Andric
8755ffd83dbSDimitry Andricdef FeatureMadMacF32Insts : SubtargetFeature<"mad-mac-f32-insts",
8765ffd83dbSDimitry Andric  "HasMadMacF32Insts",
8775ffd83dbSDimitry Andric  "true",
8785ffd83dbSDimitry Andric  "Has v_mad_f32/v_mac_f32/v_madak_f32/v_madmk_f32 instructions"
8795ffd83dbSDimitry Andric>;
8805ffd83dbSDimitry Andric
8815ffd83dbSDimitry Andricdef FeatureDsSrc2Insts : SubtargetFeature<"ds-src2-insts",
8825ffd83dbSDimitry Andric  "HasDsSrc2Insts",
8835ffd83dbSDimitry Andric  "true",
8845ffd83dbSDimitry Andric  "Has ds_*_src2 instructions"
8855ffd83dbSDimitry Andric>;
8865ffd83dbSDimitry Andric
8870b57cec5SDimitry Andricdef FeatureVOP3Literal : SubtargetFeature<"vop3-literal",
8880b57cec5SDimitry Andric  "HasVOP3Literal",
8890b57cec5SDimitry Andric  "true",
8900b57cec5SDimitry Andric  "Can use one literal in VOP3"
8910b57cec5SDimitry Andric>;
8920b57cec5SDimitry Andric
8930b57cec5SDimitry Andricdef FeatureNoDataDepHazard : SubtargetFeature<"no-data-dep-hazard",
8940b57cec5SDimitry Andric  "HasNoDataDepHazard",
8950b57cec5SDimitry Andric  "true",
8960b57cec5SDimitry Andric  "Does not need SW waitstates"
8970b57cec5SDimitry Andric>;
8980b57cec5SDimitry Andric
8990fca6ea1SDimitry Andric// Allocate 1536 VGPRs for wave32 and 768 VGPRs for wave64
9000fca6ea1SDimitry Andric// with allocation granularity 24 for wave32 and 12 for wave64
9010fca6ea1SDimitry Andricdef Feature1_5xVGPRs : SubtargetFeature<"allocate1_5xvgprs",
9020fca6ea1SDimitry Andric  "Has1_5xVGPRs",
903bdd1243dSDimitry Andric  "true",
9040fca6ea1SDimitry Andric  "Has 50% more physical VGPRs and 50% larger allocation granule"
905bdd1243dSDimitry Andric>;
906bdd1243dSDimitry Andric
907fe6060f1SDimitry Andric
90881ad6265SDimitry Andricdef FeatureVOPD : SubtargetFeature<"vopd",
90981ad6265SDimitry Andric  "HasVOPDInsts",
91081ad6265SDimitry Andric  "true",
91181ad6265SDimitry Andric  "Has VOPD dual issue wave32 instructions"
91281ad6265SDimitry Andric>;
91381ad6265SDimitry Andric
914bdd1243dSDimitry Andricdef FeatureVALUTransUseHazard : SubtargetFeature<"valu-trans-use-hazard",
915bdd1243dSDimitry Andric  "HasVALUTransUseHazard",
916bdd1243dSDimitry Andric  "true",
917bdd1243dSDimitry Andric  "Hazard when TRANS instructions are closely followed by a use of the result"
918bdd1243dSDimitry Andric>;
919bdd1243dSDimitry Andric
92006c3fb27SDimitry Andricdef FeatureForceStoreSC0SC1 : SubtargetFeature<"force-store-sc0-sc1",
92106c3fb27SDimitry Andric  "HasForceStoreSC0SC1",
92206c3fb27SDimitry Andric  "true",
92306c3fb27SDimitry Andric  "Has SC0 and SC1 on stores"
92406c3fb27SDimitry Andric>;
92506c3fb27SDimitry Andric
9265f757f3fSDimitry Andricdef FeatureSALUFloatInsts : SubtargetFeature<"salu-float",
9275f757f3fSDimitry Andric  "HasSALUFloatInsts",
9285f757f3fSDimitry Andric  "true",
9295f757f3fSDimitry Andric  "Has SALU floating point instructions"
9305f757f3fSDimitry Andric>;
9315f757f3fSDimitry Andric
9325f757f3fSDimitry Andricdef FeatureVGPRSingleUseHintInsts : SubtargetFeature<"vgpr-singleuse-hint",
9335f757f3fSDimitry Andric  "HasVGPRSingleUseHintInsts",
9345f757f3fSDimitry Andric  "true",
9355f757f3fSDimitry Andric  "Has single-use VGPR hint instructions"
9365f757f3fSDimitry Andric>;
9375f757f3fSDimitry Andric
9385f757f3fSDimitry Andricdef FeaturePseudoScalarTrans : SubtargetFeature<"pseudo-scalar-trans",
9395f757f3fSDimitry Andric  "HasPseudoScalarTrans",
9405f757f3fSDimitry Andric  "true",
9415f757f3fSDimitry Andric  "Has Pseudo Scalar Transcendental instructions"
9425f757f3fSDimitry Andric>;
9435f757f3fSDimitry Andric
9445f757f3fSDimitry Andricdef FeatureHasRestrictedSOffset : SubtargetFeature<"restricted-soffset",
9455f757f3fSDimitry Andric  "HasRestrictedSOffset",
9465f757f3fSDimitry Andric  "true",
9475f757f3fSDimitry Andric  "Has restricted SOffset (immediate not supported)."
9485f757f3fSDimitry Andric>;
9495f757f3fSDimitry Andric
9500fca6ea1SDimitry Andricdef FeatureRequiredExportPriority : SubtargetFeature<"required-export-priority",
9510fca6ea1SDimitry Andric  "HasRequiredExportPriority",
9520fca6ea1SDimitry Andric  "true",
9530fca6ea1SDimitry Andric  "Export priority must be explicitly manipulated on GFX11.5"
9540fca6ea1SDimitry Andric>;
9550fca6ea1SDimitry Andric
956*6c4b055cSDimitry Andricdef FeatureVmemWriteVgprInOrder : SubtargetFeature<"vmem-write-vgpr-in-order",
957*6c4b055cSDimitry Andric  "HasVmemWriteVgprInOrder",
958*6c4b055cSDimitry Andric  "true",
959*6c4b055cSDimitry Andric  "VMEM instructions of the same type write VGPR results in order"
960*6c4b055cSDimitry Andric>;
961*6c4b055cSDimitry Andric
9620b57cec5SDimitry Andric//===------------------------------------------------------------===//
9630b57cec5SDimitry Andric// Subtarget Features (options and debugging)
9640b57cec5SDimitry Andric//===------------------------------------------------------------===//
9650b57cec5SDimitry Andric
9660b57cec5SDimitry Andricclass FeatureMaxPrivateElementSize<int size> : SubtargetFeature<
9670b57cec5SDimitry Andric  "max-private-element-size-"#size,
9680b57cec5SDimitry Andric  "MaxPrivateElementSize",
9690b57cec5SDimitry Andric  !cast<string>(size),
9700b57cec5SDimitry Andric  "Maximum private access size may be "#size
9710b57cec5SDimitry Andric>;
9720b57cec5SDimitry Andric
9730b57cec5SDimitry Andricdef FeatureMaxPrivateElementSize4 : FeatureMaxPrivateElementSize<4>;
9740b57cec5SDimitry Andricdef FeatureMaxPrivateElementSize8 : FeatureMaxPrivateElementSize<8>;
9750b57cec5SDimitry Andricdef FeatureMaxPrivateElementSize16 : FeatureMaxPrivateElementSize<16>;
9760b57cec5SDimitry Andric
9770b57cec5SDimitry Andricdef FeatureDumpCode : SubtargetFeature <"DumpCode",
9780b57cec5SDimitry Andric  "DumpCode",
9790b57cec5SDimitry Andric  "true",
9800b57cec5SDimitry Andric  "Dump MachineInstrs in the CodeEmitter"
9810b57cec5SDimitry Andric>;
9820b57cec5SDimitry Andric
9830b57cec5SDimitry Andricdef FeatureDumpCodeLower : SubtargetFeature <"dumpcode",
9840b57cec5SDimitry Andric  "DumpCode",
9850b57cec5SDimitry Andric  "true",
9860b57cec5SDimitry Andric  "Dump MachineInstrs in the CodeEmitter"
9870b57cec5SDimitry Andric>;
9880b57cec5SDimitry Andric
9890b57cec5SDimitry Andric// XXX - This should probably be removed once enabled by default
9900b57cec5SDimitry Andricdef FeatureEnableLoadStoreOpt : SubtargetFeature <"load-store-opt",
9910b57cec5SDimitry Andric  "EnableLoadStoreOpt",
9920b57cec5SDimitry Andric  "true",
9930b57cec5SDimitry Andric  "Enable SI load/store optimizer pass"
9940b57cec5SDimitry Andric>;
9950b57cec5SDimitry Andric
9960b57cec5SDimitry Andric// Performance debugging feature. Allow using DS instruction immediate
9970b57cec5SDimitry Andric// offsets even if the base pointer can't be proven to be base. On SI,
9980b57cec5SDimitry Andric// base pointer values that won't give the same result as a 16-bit add
9990b57cec5SDimitry Andric// are not safe to fold, but this will override the conservative test
10000b57cec5SDimitry Andric// for the base pointer.
10010b57cec5SDimitry Andricdef FeatureEnableUnsafeDSOffsetFolding : SubtargetFeature <
10020b57cec5SDimitry Andric  "unsafe-ds-offset-folding",
10030b57cec5SDimitry Andric  "EnableUnsafeDSOffsetFolding",
10040b57cec5SDimitry Andric  "true",
10050b57cec5SDimitry Andric  "Force using DS instruction immediate offsets on SI"
10060b57cec5SDimitry Andric>;
10070b57cec5SDimitry Andric
10080b57cec5SDimitry Andricdef FeatureEnableSIScheduler : SubtargetFeature<"si-scheduler",
10090b57cec5SDimitry Andric  "EnableSIScheduler",
10100b57cec5SDimitry Andric  "true",
10110b57cec5SDimitry Andric  "Enable SI Machine Scheduler"
10120b57cec5SDimitry Andric>;
10130b57cec5SDimitry Andric
10140b57cec5SDimitry Andricdef FeatureEnableDS128 : SubtargetFeature<"enable-ds128",
10150b57cec5SDimitry Andric  "EnableDS128",
10160b57cec5SDimitry Andric  "true",
10170b57cec5SDimitry Andric  "Use ds_{read|write}_b128"
10180b57cec5SDimitry Andric>;
10190b57cec5SDimitry Andric
10200b57cec5SDimitry Andric// Sparse texture support requires that all result registers are zeroed when
10210b57cec5SDimitry Andric// PRTStrictNull is set to true. This feature is turned on for all architectures
10220b57cec5SDimitry Andric// but is enabled as a feature in case there are situations where PRTStrictNull
10230b57cec5SDimitry Andric// is disabled by the driver.
10240b57cec5SDimitry Andricdef FeatureEnablePRTStrictNull : SubtargetFeature<"enable-prt-strict-null",
10250b57cec5SDimitry Andric  "EnablePRTStrictNull",
10260b57cec5SDimitry Andric  "true",
10270b57cec5SDimitry Andric  "Enable zeroing of result registers for sparse texture fetches"
10280b57cec5SDimitry Andric>;
10290b57cec5SDimitry Andric
10300b57cec5SDimitry Andric// Unless +-flat-for-global is specified, turn on FlatForGlobal for
10310b57cec5SDimitry Andric// all OS-es on VI and newer hardware to avoid assertion failures due
10320b57cec5SDimitry Andric// to missing ADDR64 variants of MUBUF instructions.
10330b57cec5SDimitry Andric// FIXME: moveToVALU should be able to handle converting addr64 MUBUF
10340b57cec5SDimitry Andric// instructions.
10350b57cec5SDimitry Andric
10360b57cec5SDimitry Andricdef FeatureFlatForGlobal : SubtargetFeature<"flat-for-global",
10370b57cec5SDimitry Andric  "FlatForGlobal",
10380b57cec5SDimitry Andric  "true",
10390b57cec5SDimitry Andric  "Force to generate flat instruction for global"
10400b57cec5SDimitry Andric>;
10410b57cec5SDimitry Andric
10420b57cec5SDimitry Andricdef FeatureAutoWaitcntBeforeBarrier : SubtargetFeature <
10430b57cec5SDimitry Andric  "auto-waitcnt-before-barrier",
10440b57cec5SDimitry Andric  "AutoWaitcntBeforeBarrier",
10450b57cec5SDimitry Andric  "true",
10460b57cec5SDimitry Andric  "Hardware automatically inserts waitcnt before barrier"
10470b57cec5SDimitry Andric>;
10480b57cec5SDimitry Andric
1049bdd1243dSDimitry Andricdef FeatureBackOffBarrier : SubtargetFeature <"back-off-barrier",
1050bdd1243dSDimitry Andric  "BackOffBarrier",
1051bdd1243dSDimitry Andric  "true",
1052bdd1243dSDimitry Andric  "Hardware supports backing off s_barrier if an exception occurs"
1053bdd1243dSDimitry Andric>;
1054bdd1243dSDimitry Andric
10550b57cec5SDimitry Andricdef FeatureTrigReducedRange : SubtargetFeature<"trig-reduced-range",
10560b57cec5SDimitry Andric  "HasTrigReducedRange",
10570b57cec5SDimitry Andric  "true",
10580b57cec5SDimitry Andric  "Requires use of fract on arguments to trig instructions"
10590b57cec5SDimitry Andric>;
10600b57cec5SDimitry Andric
10615f757f3fSDimitry Andricdef FeatureKernargPreload : SubtargetFeature <"kernarg-preload",
10625f757f3fSDimitry Andric  "KernargPreload",
10635f757f3fSDimitry Andric  "true",
10645f757f3fSDimitry Andric  "Hardware supports preloading of kernel arguments in user SGPRs."
10655f757f3fSDimitry Andric>;
10665f757f3fSDimitry Andric
1067e8d8bef9SDimitry Andric// Alignment enforcement is controlled by a configuration register:
1068e8d8bef9SDimitry Andric// SH_MEM_CONFIG.alignment_mode
1069e8d8bef9SDimitry Andricdef FeatureUnalignedAccessMode : SubtargetFeature<"unaligned-access-mode",
1070e8d8bef9SDimitry Andric  "UnalignedAccessMode",
1071e8d8bef9SDimitry Andric  "true",
1072e8d8bef9SDimitry Andric  "Enable unaligned global, local and region loads and stores if the hardware"
1073e8d8bef9SDimitry Andric  " supports it"
1074e8d8bef9SDimitry Andric>;
1075e8d8bef9SDimitry Andric
1076fe6060f1SDimitry Andricdef FeaturePackedTID : SubtargetFeature<"packed-tid",
1077fe6060f1SDimitry Andric  "HasPackedTID",
1078fe6060f1SDimitry Andric  "true",
1079fe6060f1SDimitry Andric  "Workitem IDs are packed into v0 at kernel launch"
1080fe6060f1SDimitry Andric>;
1081fe6060f1SDimitry Andric
1082fe6060f1SDimitry Andricdef FeatureArchitectedFlatScratch : SubtargetFeature<"architected-flat-scratch",
1083fe6060f1SDimitry Andric  "HasArchitectedFlatScratch",
1084fe6060f1SDimitry Andric  "true",
1085fe6060f1SDimitry Andric  "Flat Scratch register is a readonly SPI initialized architected register"
1086fe6060f1SDimitry Andric>;
1087fe6060f1SDimitry Andric
108806c3fb27SDimitry Andricdef FeatureArchitectedSGPRs : SubtargetFeature<"architected-sgprs",
108906c3fb27SDimitry Andric  "HasArchitectedSGPRs",
109006c3fb27SDimitry Andric  "true",
109106c3fb27SDimitry Andric  "Enable the architected SGPRs"
109206c3fb27SDimitry Andric>;
109306c3fb27SDimitry Andric
10945f757f3fSDimitry Andricdef FeatureGDS : SubtargetFeature<"gds",
10955f757f3fSDimitry Andric  "HasGDS",
10965f757f3fSDimitry Andric  "true",
10975f757f3fSDimitry Andric  "Has Global Data Share"
10985f757f3fSDimitry Andric>;
10995f757f3fSDimitry Andric
11005f757f3fSDimitry Andricdef FeatureGWS : SubtargetFeature<"gws",
11015f757f3fSDimitry Andric  "HasGWS",
11025f757f3fSDimitry Andric  "true",
11035f757f3fSDimitry Andric  "Has Global Wave Sync"
11045f757f3fSDimitry Andric>;
11055f757f3fSDimitry Andric
11060fca6ea1SDimitry Andricdef FeatureRequiresCOV6 : SubtargetFeature<"requires-cov6",
11070fca6ea1SDimitry Andric  "RequiresCOV6",
11080fca6ea1SDimitry Andric  "true",
11090fca6ea1SDimitry Andric  "Target Requires Code Object V6"
11100fca6ea1SDimitry Andric>;
11110fca6ea1SDimitry Andric
11120b57cec5SDimitry Andric// Dummy feature used to disable assembler instructions.
11130b57cec5SDimitry Andricdef FeatureDisable : SubtargetFeature<"",
11140b57cec5SDimitry Andric  "FeatureDisable","true",
11150b57cec5SDimitry Andric  "Dummy feature to disable assembler instructions"
11160b57cec5SDimitry Andric>;
11170b57cec5SDimitry Andric
111806c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
111906c3fb27SDimitry Andric
11200b57cec5SDimitry Andricclass GCNSubtargetFeatureGeneration <string Value,
11210b57cec5SDimitry Andric                                     string FeatureName,
11220b57cec5SDimitry Andric                                     list<SubtargetFeature> Implies> :
11230b57cec5SDimitry Andric        SubtargetFeatureGeneration <Value, FeatureName, "GCNSubtarget", Implies>;
11240b57cec5SDimitry Andric
11250b57cec5SDimitry Andricdef FeatureSouthernIslands : GCNSubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
11260b57cec5SDimitry Andric    "southern-islands",
11270b57cec5SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize32768, FeatureMIMG_R128,
11285ffd83dbSDimitry Andric  FeatureWavefrontSize64, FeatureSMemTimeInst, FeatureMadMacF32Insts,
11295ffd83dbSDimitry Andric  FeatureDsSrc2Insts, FeatureLDSBankCount32, FeatureMovrel,
11305f757f3fSDimitry Andric  FeatureTrigReducedRange, FeatureExtendedImageInsts, FeatureImageInsts,
11310fca6ea1SDimitry Andric  FeatureGDS, FeatureGWS, FeatureDefaultComponentZero,
1132*6c4b055cSDimitry Andric  FeatureAtomicFMinFMaxF32GlobalInsts, FeatureAtomicFMinFMaxF64GlobalInsts,
1133*6c4b055cSDimitry Andric  FeatureVmemWriteVgprInOrder
1134fe6060f1SDimitry Andric  ]
11350b57cec5SDimitry Andric>;
11360b57cec5SDimitry Andric
11370b57cec5SDimitry Andricdef FeatureSeaIslands : GCNSubtargetFeatureGeneration<"SEA_ISLANDS",
11380b57cec5SDimitry Andric    "sea-islands",
11390b57cec5SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
11400b57cec5SDimitry Andric  FeatureWavefrontSize64, FeatureFlatAddressSpace,
11410b57cec5SDimitry Andric  FeatureCIInsts, FeatureMovrel, FeatureTrigReducedRange,
11425ffd83dbSDimitry Andric  FeatureGFX7GFX8GFX9Insts, FeatureSMemTimeInst, FeatureMadMacF32Insts,
114381ad6265SDimitry Andric  FeatureDsSrc2Insts, FeatureExtendedImageInsts, FeatureUnalignedBufferAccess,
11440fca6ea1SDimitry Andric  FeatureImageInsts, FeatureGDS, FeatureGWS, FeatureDefaultComponentZero,
11450fca6ea1SDimitry Andric  FeatureAtomicFMinFMaxF32GlobalInsts, FeatureAtomicFMinFMaxF64GlobalInsts,
1146*6c4b055cSDimitry Andric  FeatureAtomicFMinFMaxF32FlatInsts, FeatureAtomicFMinFMaxF64FlatInsts,
1147*6c4b055cSDimitry Andric  FeatureVmemWriteVgprInOrder
1148fe6060f1SDimitry Andric  ]
11490b57cec5SDimitry Andric>;
11500b57cec5SDimitry Andric
11510b57cec5SDimitry Andricdef FeatureVolcanicIslands : GCNSubtargetFeatureGeneration<"VOLCANIC_ISLANDS",
11520b57cec5SDimitry Andric  "volcanic-islands",
11530b57cec5SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
11540b57cec5SDimitry Andric   FeatureWavefrontSize64, FeatureFlatAddressSpace,
11550b57cec5SDimitry Andric   FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
11560b57cec5SDimitry Andric   FeatureSMemRealTime, FeatureVGPRIndexMode, FeatureMovrel,
11570b57cec5SDimitry Andric   FeatureScalarStores, FeatureInv2PiInlineImm,
11580b57cec5SDimitry Andric   FeatureSDWA, FeatureSDWAOutModsVOPC, FeatureSDWAMac, FeatureDPP,
11595ffd83dbSDimitry Andric   FeatureIntClamp, FeatureTrigReducedRange, FeatureGFX8Insts,
11605ffd83dbSDimitry Andric   FeatureGFX7GFX8GFX9Insts, FeatureSMemTimeInst, FeatureMadMacF32Insts,
1161fe6060f1SDimitry Andric   FeatureDsSrc2Insts, FeatureExtendedImageInsts, FeatureFastDenormalF32,
11627a6dacacSDimitry Andric   FeatureUnalignedBufferAccess, FeatureImageInsts, FeatureGDS, FeatureGWS,
1163*6c4b055cSDimitry Andric   FeatureDefaultComponentZero, FeatureVmemWriteVgprInOrder
1164fe6060f1SDimitry Andric  ]
11650b57cec5SDimitry Andric>;
11660b57cec5SDimitry Andric
11670b57cec5SDimitry Andricdef FeatureGFX9 : GCNSubtargetFeatureGeneration<"GFX9",
11680b57cec5SDimitry Andric  "gfx9",
11690b57cec5SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize65536,
11700b57cec5SDimitry Andric   FeatureWavefrontSize64, FeatureFlatAddressSpace,
11710b57cec5SDimitry Andric   FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
11720b57cec5SDimitry Andric   FeatureSMemRealTime, FeatureScalarStores, FeatureInv2PiInlineImm,
11730b57cec5SDimitry Andric   FeatureApertureRegs, FeatureGFX9Insts, FeatureVOP3P, FeatureVGPRIndexMode,
11740b57cec5SDimitry Andric   FeatureFastFMAF32, FeatureDPP, FeatureIntClamp,
11750b57cec5SDimitry Andric   FeatureSDWA, FeatureSDWAOmod, FeatureSDWAScalar, FeatureSDWASdst,
11760b57cec5SDimitry Andric   FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
11770b57cec5SDimitry Andric   FeatureAddNoCarryInsts, FeatureGFX8Insts, FeatureGFX7GFX8GFX9Insts,
11785ffd83dbSDimitry Andric   FeatureScalarFlatScratchInsts, FeatureScalarAtomics, FeatureR128A16,
1179bdd1243dSDimitry Andric   FeatureA16, FeatureSMemTimeInst, FeatureFastDenormalF32, FeatureSupportsXNACK,
1180fe6060f1SDimitry Andric   FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess,
1181*6c4b055cSDimitry Andric   FeatureNegativeScratchOffsetBug, FeatureGWS, FeatureDefaultComponentZero,
1182*6c4b055cSDimitry Andric   FeatureVmemWriteVgprInOrder
1183fe6060f1SDimitry Andric  ]
11840b57cec5SDimitry Andric>;
11850b57cec5SDimitry Andric
11860b57cec5SDimitry Andricdef FeatureGFX10 : GCNSubtargetFeatureGeneration<"GFX10",
11870b57cec5SDimitry Andric  "gfx10",
11880b57cec5SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
11890b57cec5SDimitry Andric   FeatureFlatAddressSpace,
11900b57cec5SDimitry Andric   FeatureCIInsts, Feature16BitInsts,
11910b57cec5SDimitry Andric   FeatureSMemRealTime, FeatureInv2PiInlineImm,
11920b57cec5SDimitry Andric   FeatureApertureRegs, FeatureGFX9Insts, FeatureGFX10Insts, FeatureVOP3P,
11930b57cec5SDimitry Andric   FeatureMovrel, FeatureFastFMAF32, FeatureDPP, FeatureIntClamp,
11940b57cec5SDimitry Andric   FeatureSDWA, FeatureSDWAOmod, FeatureSDWAScalar, FeatureSDWASdst,
11950b57cec5SDimitry Andric   FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
11960b57cec5SDimitry Andric   FeatureAddNoCarryInsts, FeatureFmaMixInsts, FeatureGFX8Insts,
119704eeddc0SDimitry Andric   FeatureNoSdstCMPX, FeatureVscnt,
1198fe6060f1SDimitry Andric   FeatureVOP3Literal, FeatureDPP8, FeatureExtendedImageInsts,
1199e8d8bef9SDimitry Andric   FeatureNoDataDepHazard, FeaturePkFmacF16Inst,
1200bdd1243dSDimitry Andric   FeatureA16, FeatureSMemTimeInst, FeatureFastDenormalF32, FeatureG16,
12015f757f3fSDimitry Andric   FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess, FeatureImageInsts,
12020fca6ea1SDimitry Andric   FeatureGDS, FeatureGWS, FeatureDefaultComponentZero,
12030fca6ea1SDimitry Andric   FeatureMaxHardClauseLength63,
12040fca6ea1SDimitry Andric   FeatureAtomicFMinFMaxF32GlobalInsts, FeatureAtomicFMinFMaxF64GlobalInsts,
1205*6c4b055cSDimitry Andric   FeatureAtomicFMinFMaxF32FlatInsts, FeatureAtomicFMinFMaxF64FlatInsts,
1206*6c4b055cSDimitry Andric   FeatureVmemWriteVgprInOrder
120781ad6265SDimitry Andric  ]
120881ad6265SDimitry Andric>;
120981ad6265SDimitry Andric
121081ad6265SDimitry Andricdef FeatureGFX11 : GCNSubtargetFeatureGeneration<"GFX11",
121181ad6265SDimitry Andric  "gfx11",
121281ad6265SDimitry Andric  [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
121381ad6265SDimitry Andric   FeatureFlatAddressSpace, Feature16BitInsts,
121481ad6265SDimitry Andric   FeatureInv2PiInlineImm, FeatureApertureRegs,
121581ad6265SDimitry Andric   FeatureCIInsts, FeatureGFX8Insts, FeatureGFX9Insts, FeatureGFX10Insts,
121681ad6265SDimitry Andric   FeatureGFX10_AEncoding, FeatureGFX10_BEncoding, FeatureGFX10_3Insts,
121781ad6265SDimitry Andric   FeatureGFX11Insts, FeatureVOP3P, FeatureVOPD, FeatureTrue16BitInsts,
121881ad6265SDimitry Andric   FeatureMovrel, FeatureFastFMAF32, FeatureDPP, FeatureIntClamp,
121981ad6265SDimitry Andric   FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
122081ad6265SDimitry Andric   FeatureAddNoCarryInsts, FeatureFmaMixInsts,
122181ad6265SDimitry Andric   FeatureNoSdstCMPX, FeatureVscnt,
122281ad6265SDimitry Andric   FeatureVOP3Literal, FeatureDPP8, FeatureExtendedImageInsts,
122381ad6265SDimitry Andric   FeatureNoDataDepHazard, FeaturePkFmacF16Inst,
1224bdd1243dSDimitry Andric   FeatureA16, FeatureFastDenormalF32, FeatureG16,
12255f757f3fSDimitry Andric   FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess, FeatureGDS,
12260fca6ea1SDimitry Andric   FeatureGWS, FeatureDefaultComponentZero,
12270fca6ea1SDimitry Andric   FeatureMaxHardClauseLength32,
1228*6c4b055cSDimitry Andric   FeatureAtomicFMinFMaxF32GlobalInsts, FeatureAtomicFMinFMaxF32FlatInsts,
1229*6c4b055cSDimitry Andric   FeatureVmemWriteVgprInOrder
12305f757f3fSDimitry Andric  ]
12315f757f3fSDimitry Andric>;
12325f757f3fSDimitry Andric
12335f757f3fSDimitry Andricdef FeatureGFX12 : GCNSubtargetFeatureGeneration<"GFX12",
12345f757f3fSDimitry Andric  "gfx12",
12355f757f3fSDimitry Andric  [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
12365f757f3fSDimitry Andric   FeatureFlatAddressSpace, Feature16BitInsts,
12375f757f3fSDimitry Andric   FeatureInv2PiInlineImm, FeatureApertureRegs,
12385f757f3fSDimitry Andric   FeatureCIInsts, FeatureGFX8Insts, FeatureGFX9Insts, FeatureGFX10Insts,
12395f757f3fSDimitry Andric   FeatureGFX10_AEncoding, FeatureGFX10_BEncoding, FeatureGFX10_3Insts,
12405f757f3fSDimitry Andric   FeatureGFX11Insts, FeatureGFX12Insts, FeatureVOP3P, FeatureVOPD,
12415f757f3fSDimitry Andric   FeatureMovrel, FeatureFastFMAF32, FeatureDPP, FeatureIntClamp,
12425f757f3fSDimitry Andric   FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
12435f757f3fSDimitry Andric   FeatureAddNoCarryInsts, FeatureFmaMixInsts,
12445f757f3fSDimitry Andric   FeatureNoSdstCMPX, FeatureVscnt,
12455f757f3fSDimitry Andric   FeatureVOP3Literal, FeatureDPP8,
12465f757f3fSDimitry Andric   FeatureNoDataDepHazard, FeaturePkFmacF16Inst,
12475f757f3fSDimitry Andric   FeatureA16, FeatureFastDenormalF32, FeatureG16,
1248cb14a3feSDimitry Andric   FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess,
12490fca6ea1SDimitry Andric   FeatureTrue16BitInsts, FeatureDefaultComponentBroadcast,
12500fca6ea1SDimitry Andric   FeatureMaxHardClauseLength32,
12510fca6ea1SDimitry Andric   FeatureAtomicFMinFMaxF32GlobalInsts, FeatureAtomicFMinFMaxF32FlatInsts,
12520fca6ea1SDimitry Andric   FeatureAgentScopeFineGrainedRemoteMemoryAtomics
12530b57cec5SDimitry Andric  ]
12540b57cec5SDimitry Andric>;
12550b57cec5SDimitry Andric
125606c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
125706c3fb27SDimitry Andric
12580b57cec5SDimitry Andricclass FeatureSet<list<SubtargetFeature> Features_> {
12590b57cec5SDimitry Andric  list<SubtargetFeature> Features = Features_;
12600b57cec5SDimitry Andric}
12610b57cec5SDimitry Andric
12620b57cec5SDimitry Andricdef FeatureISAVersion6_0_0 : FeatureSet<[FeatureSouthernIslands,
12630b57cec5SDimitry Andric   FeatureFastFMAF32,
12640b57cec5SDimitry Andric   HalfRate64Ops,
1265e8d8bef9SDimitry Andric   FeatureLDSBankCount32]>;
12660b57cec5SDimitry Andric
12670b57cec5SDimitry Andricdef FeatureISAVersion6_0_1 : FeatureSet<
12680b57cec5SDimitry Andric  [FeatureSouthernIslands,
1269e8d8bef9SDimitry Andric   FeatureLDSBankCount32]>;
1270e8d8bef9SDimitry Andric
1271e8d8bef9SDimitry Andricdef FeatureISAVersion6_0_2 : FeatureSet<
1272e8d8bef9SDimitry Andric  [FeatureSouthernIslands,
1273e8d8bef9SDimitry Andric   FeatureLDSBankCount32]>;
12740b57cec5SDimitry Andric
12750b57cec5SDimitry Andricdef FeatureISAVersion7_0_0 : FeatureSet<
12760b57cec5SDimitry Andric  [FeatureSeaIslands,
1277e8d8bef9SDimitry Andric   FeatureLDSBankCount32]>;
12780b57cec5SDimitry Andric
12790b57cec5SDimitry Andricdef FeatureISAVersion7_0_1 : FeatureSet<
12800b57cec5SDimitry Andric  [FeatureSeaIslands,
12810b57cec5SDimitry Andric   HalfRate64Ops,
12820b57cec5SDimitry Andric   FeatureLDSBankCount32,
1283e8d8bef9SDimitry Andric   FeatureFastFMAF32]>;
12840b57cec5SDimitry Andric
12850b57cec5SDimitry Andricdef FeatureISAVersion7_0_2 : FeatureSet<
12860b57cec5SDimitry Andric  [FeatureSeaIslands,
12870b57cec5SDimitry Andric   FeatureLDSBankCount16,
1288e8d8bef9SDimitry Andric   FeatureFastFMAF32]>;
12890b57cec5SDimitry Andric
12900b57cec5SDimitry Andricdef FeatureISAVersion7_0_3 : FeatureSet<
12910b57cec5SDimitry Andric  [FeatureSeaIslands,
1292e8d8bef9SDimitry Andric   FeatureLDSBankCount16]>;
12930b57cec5SDimitry Andric
12940b57cec5SDimitry Andricdef FeatureISAVersion7_0_4 : FeatureSet<
12950b57cec5SDimitry Andric  [FeatureSeaIslands,
1296e8d8bef9SDimitry Andric   FeatureLDSBankCount32]>;
1297e8d8bef9SDimitry Andric
1298e8d8bef9SDimitry Andricdef FeatureISAVersion7_0_5 : FeatureSet<
1299e8d8bef9SDimitry Andric  [FeatureSeaIslands,
1300e8d8bef9SDimitry Andric   FeatureLDSBankCount16]>;
13010b57cec5SDimitry Andric
130206c3fb27SDimitry Andricdef FeatureISAVersion8_0_Common : FeatureSet<
13030b57cec5SDimitry Andric  [FeatureVolcanicIslands,
13040b57cec5SDimitry Andric   FeatureLDSBankCount32,
1305e8d8bef9SDimitry Andric   FeatureUnpackedD16VMem]>;
13060b57cec5SDimitry Andric
130706c3fb27SDimitry Andricdef FeatureISAVersion8_0_1 : FeatureSet<
130806c3fb27SDimitry Andric  !listconcat(FeatureISAVersion8_0_Common.Features,
130906c3fb27SDimitry Andric    [FeatureFastFMAF32,
131006c3fb27SDimitry Andric     HalfRate64Ops,
131106c3fb27SDimitry Andric     FeatureSupportsXNACK])>;
131206c3fb27SDimitry Andric
13130b57cec5SDimitry Andricdef FeatureISAVersion8_0_2 : FeatureSet<
131406c3fb27SDimitry Andric  !listconcat(FeatureISAVersion8_0_Common.Features,
131506c3fb27SDimitry Andric    [FeatureSGPRInitBug])>;
13160b57cec5SDimitry Andric
13170b57cec5SDimitry Andricdef FeatureISAVersion8_0_3 : FeatureSet<
131806c3fb27SDimitry Andric  !listconcat(FeatureISAVersion8_0_Common.Features,
131906c3fb27SDimitry Andric    [])>;
1320e8d8bef9SDimitry Andric
1321e8d8bef9SDimitry Andricdef FeatureISAVersion8_0_5 : FeatureSet<
132206c3fb27SDimitry Andric  !listconcat(FeatureISAVersion8_0_Common.Features,
132306c3fb27SDimitry Andric    [FeatureSGPRInitBug])>;
13240b57cec5SDimitry Andric
13250b57cec5SDimitry Andricdef FeatureISAVersion8_1_0 : FeatureSet<
13260b57cec5SDimitry Andric  [FeatureVolcanicIslands,
13270b57cec5SDimitry Andric   FeatureLDSBankCount16,
1328e8d8bef9SDimitry Andric   FeatureSupportsXNACK,
1329e8d8bef9SDimitry Andric   FeatureImageStoreD16Bug,
1330e8d8bef9SDimitry Andric   FeatureImageGather4D16Bug]>;
13310b57cec5SDimitry Andric
133206c3fb27SDimitry Andricdef FeatureISAVersion9_0_Common : FeatureSet<
13330b57cec5SDimitry Andric  [FeatureGFX9,
13340b57cec5SDimitry Andric   FeatureLDSBankCount32,
133506c3fb27SDimitry Andric   FeatureImageInsts,
133606c3fb27SDimitry Andric   FeatureMadMacF32Insts]>;
133706c3fb27SDimitry Andric
13380fca6ea1SDimitry Andricdef FeatureISAVersion9_0_Consumer_Common : FeatureSet<
13390fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion9_0_Common.Features,
13400fca6ea1SDimitry Andric    [FeatureImageGather4D16Bug,
13410fca6ea1SDimitry Andric     FeatureDsSrc2Insts,
13420fca6ea1SDimitry Andric     FeatureExtendedImageInsts,
13430fca6ea1SDimitry Andric     FeatureGDS])>;
13440fca6ea1SDimitry Andric
13450fca6ea1SDimitry Andricdef FeatureISAVersion9_Generic : FeatureSet<
13460fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion9_0_Consumer_Common.Features,
13470fca6ea1SDimitry Andric    [FeatureRequiresCOV6])>;
13480fca6ea1SDimitry Andric
134906c3fb27SDimitry Andricdef FeatureISAVersion9_0_MI_Common : FeatureSet<
135006c3fb27SDimitry Andric  !listconcat(FeatureISAVersion9_0_Common.Features,
135106c3fb27SDimitry Andric    [FeatureFmaMixInsts,
135206c3fb27SDimitry Andric     FeatureDLInsts,
135306c3fb27SDimitry Andric     FeatureDot1Insts,
135406c3fb27SDimitry Andric     FeatureDot2Insts,
135506c3fb27SDimitry Andric     FeatureDot3Insts,
135606c3fb27SDimitry Andric     FeatureDot4Insts,
135706c3fb27SDimitry Andric     FeatureDot5Insts,
135806c3fb27SDimitry Andric     FeatureDot6Insts,
135906c3fb27SDimitry Andric     FeatureDot7Insts,
136006c3fb27SDimitry Andric     FeatureDot10Insts,
136106c3fb27SDimitry Andric     FeatureMAIInsts,
136206c3fb27SDimitry Andric     FeaturePkFmacF16Inst,
136306c3fb27SDimitry Andric     FeatureAtomicFaddNoRtnInsts,
136406c3fb27SDimitry Andric     FeatureSupportsSRAMECC])>;
136506c3fb27SDimitry Andric
136606c3fb27SDimitry Andricdef FeatureISAVersion9_0_0 : FeatureSet<
13670fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion9_0_Consumer_Common.Features,
13680fca6ea1SDimitry Andric    [FeatureMadMixInsts])>;
13690b57cec5SDimitry Andric
13700b57cec5SDimitry Andricdef FeatureISAVersion9_0_2 : FeatureSet<
13710fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion9_0_Consumer_Common.Features,
13720fca6ea1SDimitry Andric    [FeatureMadMixInsts])>;
13730b57cec5SDimitry Andric
13740b57cec5SDimitry Andricdef FeatureISAVersion9_0_4 : FeatureSet<
13750fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion9_0_Consumer_Common.Features,
13760fca6ea1SDimitry Andric    [FeatureFmaMixInsts])>;
13770b57cec5SDimitry Andric
13780b57cec5SDimitry Andricdef FeatureISAVersion9_0_6 : FeatureSet<
13790fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion9_0_Consumer_Common.Features,
13800fca6ea1SDimitry Andric    [HalfRate64Ops,
13810b57cec5SDimitry Andric     FeatureFmaMixInsts,
13820b57cec5SDimitry Andric     FeatureDLInsts,
13830b57cec5SDimitry Andric     FeatureDot1Insts,
13840b57cec5SDimitry Andric     FeatureDot2Insts,
1385fe6060f1SDimitry Andric     FeatureDot7Insts,
138606c3fb27SDimitry Andric     FeatureDot10Insts,
13870fca6ea1SDimitry Andric     FeatureSupportsSRAMECC])>;
13880b57cec5SDimitry Andric
13890b57cec5SDimitry Andricdef FeatureISAVersion9_0_8 : FeatureSet<
139006c3fb27SDimitry Andric  !listconcat(FeatureISAVersion9_0_MI_Common.Features,
13915f757f3fSDimitry Andric    [FeatureGDS,
13925f757f3fSDimitry Andric     HalfRate64Ops,
1393fe6060f1SDimitry Andric     FeatureDsSrc2Insts,
1394fe6060f1SDimitry Andric     FeatureExtendedImageInsts,
139506c3fb27SDimitry Andric     FeatureAtomicBufferGlobalPkAddF16NoRtnInsts,
13968bcb0991SDimitry Andric     FeatureMFMAInlineLiteralBug,
139706c3fb27SDimitry Andric     FeatureImageGather4D16Bug])>;
13980b57cec5SDimitry Andric
13990b57cec5SDimitry Andricdef FeatureISAVersion9_0_9 : FeatureSet<
14000fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion9_0_Consumer_Common.Features,
14010fca6ea1SDimitry Andric    [FeatureMadMixInsts,
14020fca6ea1SDimitry Andric     FeatureImageInsts])>;
1403e8d8bef9SDimitry Andric
1404fe6060f1SDimitry Andricdef FeatureISAVersion9_0_A : FeatureSet<
140506c3fb27SDimitry Andric  !listconcat(FeatureISAVersion9_0_MI_Common.Features,
140606c3fb27SDimitry Andric    [FeatureGFX90AInsts,
1407bdd1243dSDimitry Andric     FeatureFmacF64Inst,
14085f757f3fSDimitry Andric     FeatureDPALU_DPP,
1409fe6060f1SDimitry Andric     FeaturePackedFP32Ops,
141081ad6265SDimitry Andric     FeatureAtomicFaddRtnInsts,
141106c3fb27SDimitry Andric     FeatureAtomicBufferGlobalPkAddF16Insts,
1412fe6060f1SDimitry Andric     FeaturePackedTID,
1413bdd1243dSDimitry Andric     FullRate64Ops,
14145f757f3fSDimitry Andric     FeatureBackOffBarrier,
14150fca6ea1SDimitry Andric     FeatureKernargPreload,
14160fca6ea1SDimitry Andric     FeatureAtomicFMinFMaxF64GlobalInsts,
14170fca6ea1SDimitry Andric     FeatureAtomicFMinFMaxF64FlatInsts,
14180fca6ea1SDimitry Andric     FeatureFlatBufferGlobalAtomicFaddF64Inst
14190fca6ea1SDimitry Andric     ])>;
1420fe6060f1SDimitry Andric
1421e8d8bef9SDimitry Andricdef FeatureISAVersion9_0_C : FeatureSet<
14220fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion9_0_Consumer_Common.Features,
14230fca6ea1SDimitry Andric    [FeatureMadMixInsts])>;
14240b57cec5SDimitry Andric
142506c3fb27SDimitry Andricdef FeatureISAVersion9_4_Common : FeatureSet<
142681ad6265SDimitry Andric  [FeatureGFX9,
142781ad6265SDimitry Andric   FeatureGFX90AInsts,
142881ad6265SDimitry Andric   FeatureGFX940Insts,
142981ad6265SDimitry Andric   FeatureFmaMixInsts,
143081ad6265SDimitry Andric   FeatureLDSBankCount32,
143181ad6265SDimitry Andric   FeatureDLInsts,
1432bdd1243dSDimitry Andric   FeatureFmacF64Inst,
143381ad6265SDimitry Andric   FeatureDot1Insts,
143481ad6265SDimitry Andric   FeatureDot2Insts,
143581ad6265SDimitry Andric   FeatureDot3Insts,
143681ad6265SDimitry Andric   FeatureDot4Insts,
143781ad6265SDimitry Andric   FeatureDot5Insts,
143881ad6265SDimitry Andric   FeatureDot6Insts,
143981ad6265SDimitry Andric   FeatureDot7Insts,
144006c3fb27SDimitry Andric   FeatureDot10Insts,
144106c3fb27SDimitry Andric   FeatureAtomicDsPkAdd16Insts,
144206c3fb27SDimitry Andric   FeatureAtomicFlatPkAdd16Insts,
14435f757f3fSDimitry Andric   FeatureDPALU_DPP,
144481ad6265SDimitry Andric   FeaturePackedFP32Ops,
144581ad6265SDimitry Andric   FeatureMAIInsts,
1446fcaf7f86SDimitry Andric   FeatureFP8Insts,
14477a6dacacSDimitry Andric   FeatureFP8ConversionInsts,
144881ad6265SDimitry Andric   FeaturePkFmacF16Inst,
144981ad6265SDimitry Andric   FeatureAtomicFaddRtnInsts,
145081ad6265SDimitry Andric   FeatureAtomicFaddNoRtnInsts,
145106c3fb27SDimitry Andric   FeatureAtomicBufferGlobalPkAddF16Insts,
145206c3fb27SDimitry Andric   FeatureAtomicGlobalPkAddBF16Inst,
1453bdd1243dSDimitry Andric   FeatureFlatAtomicFaddF32Inst,
145481ad6265SDimitry Andric   FeatureSupportsSRAMECC,
145581ad6265SDimitry Andric   FeaturePackedTID,
145681ad6265SDimitry Andric   FeatureArchitectedFlatScratch,
1457bdd1243dSDimitry Andric   FullRate64Ops,
14585f757f3fSDimitry Andric   FeatureBackOffBarrier,
14590fca6ea1SDimitry Andric   FeatureKernargPreload,
14600fca6ea1SDimitry Andric   FeatureAtomicFMinFMaxF64GlobalInsts,
14610fca6ea1SDimitry Andric   FeatureAtomicFMinFMaxF64FlatInsts,
14620fca6ea1SDimitry Andric   FeatureAgentScopeFineGrainedRemoteMemoryAtomics,
14630fca6ea1SDimitry Andric   FeatureMemoryAtomicFAddF32DenormalSupport,
14640fca6ea1SDimitry Andric   FeatureFlatBufferGlobalAtomicFaddF64Inst
14650fca6ea1SDimitry Andric   ]>;
146681ad6265SDimitry Andric
146706c3fb27SDimitry Andricdef FeatureISAVersion9_4_0 : FeatureSet<
146806c3fb27SDimitry Andric  !listconcat(FeatureISAVersion9_4_Common.Features,
146906c3fb27SDimitry Andric    [FeatureForceStoreSC0SC1])>;
147006c3fb27SDimitry Andric
147106c3fb27SDimitry Andricdef FeatureISAVersion9_4_1 : FeatureSet<
147206c3fb27SDimitry Andric  !listconcat(FeatureISAVersion9_4_Common.Features,
147306c3fb27SDimitry Andric    [FeatureForceStoreSC0SC1])>;
147406c3fb27SDimitry Andric
147506c3fb27SDimitry Andricdef FeatureISAVersion9_4_2 : FeatureSet<
147606c3fb27SDimitry Andric  !listconcat(FeatureISAVersion9_4_Common.Features,
147706c3fb27SDimitry Andric    [])>;
147806c3fb27SDimitry Andric
147906c3fb27SDimitry Andricdef FeatureISAVersion10_Common : FeatureSet<
148006c3fb27SDimitry Andric  [FeatureGFX10,
148106c3fb27SDimitry Andric   FeatureLDSBankCount32,
148206c3fb27SDimitry Andric   FeatureDLInsts,
148306c3fb27SDimitry Andric   FeatureNSAEncoding,
148406c3fb27SDimitry Andric   FeatureBackOffBarrier]>;
148506c3fb27SDimitry Andric
148606c3fb27SDimitry Andricdef FeatureISAVersion10_1_Common : FeatureSet<
148706c3fb27SDimitry Andric  !listconcat(FeatureISAVersion10_Common.Features,
148806c3fb27SDimitry Andric    [FeatureScalarStores,
148906c3fb27SDimitry Andric     FeatureScalarAtomics,
149006c3fb27SDimitry Andric     FeatureScalarFlatScratchInsts,
149106c3fb27SDimitry Andric     FeatureGetWaveIdInst,
149206c3fb27SDimitry Andric     FeatureMadMacF32Insts,
149306c3fb27SDimitry Andric     FeatureDsSrc2Insts,
149406c3fb27SDimitry Andric     FeatureLdsMisalignedBug,
149506c3fb27SDimitry Andric     FeatureSupportsXNACK,
149606c3fb27SDimitry Andric     // gfx101x bugs
14970b57cec5SDimitry Andric     FeatureVcmpxPermlaneHazard,
14980b57cec5SDimitry Andric     FeatureVMEMtoScalarWriteHazard,
14990b57cec5SDimitry Andric     FeatureSMEMtoVectorWriteHazard,
15000b57cec5SDimitry Andric     FeatureInstFwdPrefetchBug,
15010b57cec5SDimitry Andric     FeatureVcmpxExecWARHazard,
15020b57cec5SDimitry Andric     FeatureLdsBranchVmemWARHazard,
15030b57cec5SDimitry Andric     FeatureNSAtoVMEMBug,
1504fe6060f1SDimitry Andric     FeatureNSAClauseBug,
15050b57cec5SDimitry Andric     FeatureOffset3fBug,
1506fe6060f1SDimitry Andric     FeatureFlatSegmentOffsetBug,
150706c3fb27SDimitry Andric     FeatureNegativeUnalignedScratchOffsetBug])>;
15080b57cec5SDimitry Andric
15090fca6ea1SDimitry Andricdef FeatureISAVersion10_1_Generic : FeatureSet<
15100fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion10_1_Common.Features,
15110fca6ea1SDimitry Andric    [FeatureRequiresCOV6])>;
15120fca6ea1SDimitry Andric
15130b57cec5SDimitry Andricdef FeatureISAVersion10_1_0 : FeatureSet<
151406c3fb27SDimitry Andric  !listconcat(FeatureISAVersion10_1_Common.Features,
151506c3fb27SDimitry Andric    [])>;
15160b57cec5SDimitry Andric
15170b57cec5SDimitry Andricdef FeatureISAVersion10_1_1 : FeatureSet<
151806c3fb27SDimitry Andric  !listconcat(FeatureISAVersion10_1_Common.Features,
151906c3fb27SDimitry Andric    [FeatureDot1Insts,
15200b57cec5SDimitry Andric     FeatureDot2Insts,
15210b57cec5SDimitry Andric     FeatureDot5Insts,
15220b57cec5SDimitry Andric     FeatureDot6Insts,
1523fe6060f1SDimitry Andric     FeatureDot7Insts,
152406c3fb27SDimitry Andric     FeatureDot10Insts])>;
15250b57cec5SDimitry Andric
15260b57cec5SDimitry Andricdef FeatureISAVersion10_1_2 : FeatureSet<
152706c3fb27SDimitry Andric  !listconcat(FeatureISAVersion10_1_Common.Features,
152806c3fb27SDimitry Andric    [FeatureDot1Insts,
15290b57cec5SDimitry Andric     FeatureDot2Insts,
15300b57cec5SDimitry Andric     FeatureDot5Insts,
15310b57cec5SDimitry Andric     FeatureDot6Insts,
1532fe6060f1SDimitry Andric     FeatureDot7Insts,
153306c3fb27SDimitry Andric     FeatureDot10Insts])>;
1534fe6060f1SDimitry Andric
1535fe6060f1SDimitry Andricdef FeatureISAVersion10_1_3 : FeatureSet<
153606c3fb27SDimitry Andric  !listconcat(FeatureISAVersion10_1_Common.Features,
153706c3fb27SDimitry Andric    [FeatureGFX10_AEncoding])>;
15380b57cec5SDimitry Andric
15395ffd83dbSDimitry Andricdef FeatureISAVersion10_3_0 : FeatureSet<
154006c3fb27SDimitry Andric  !listconcat(FeatureISAVersion10_Common.Features,
154106c3fb27SDimitry Andric    [FeatureGFX10_AEncoding,
15425ffd83dbSDimitry Andric     FeatureGFX10_BEncoding,
15435ffd83dbSDimitry Andric     FeatureGFX10_3Insts,
15445ffd83dbSDimitry Andric     FeatureDot1Insts,
15455ffd83dbSDimitry Andric     FeatureDot2Insts,
15465ffd83dbSDimitry Andric     FeatureDot5Insts,
15475ffd83dbSDimitry Andric     FeatureDot6Insts,
1548fe6060f1SDimitry Andric     FeatureDot7Insts,
154906c3fb27SDimitry Andric     FeatureDot10Insts,
155006c3fb27SDimitry Andric     FeatureShaderCyclesRegister])>;
15515ffd83dbSDimitry Andric
15520fca6ea1SDimitry Andricdef FeatureISAVersion10_3_Generic: FeatureSet<
15530fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion10_3_0.Features,
15540fca6ea1SDimitry Andric    [FeatureRequiresCOV6])>;
15550fca6ea1SDimitry Andric
155681ad6265SDimitry Andricdef FeatureISAVersion11_Common : FeatureSet<
155781ad6265SDimitry Andric  [FeatureGFX11,
155881ad6265SDimitry Andric   FeatureLDSBankCount32,
155981ad6265SDimitry Andric   FeatureDLInsts,
156081ad6265SDimitry Andric   FeatureDot5Insts,
156181ad6265SDimitry Andric   FeatureDot7Insts,
156281ad6265SDimitry Andric   FeatureDot8Insts,
1563bdd1243dSDimitry Andric   FeatureDot9Insts,
156406c3fb27SDimitry Andric   FeatureDot10Insts,
156581ad6265SDimitry Andric   FeatureNSAEncoding,
156606c3fb27SDimitry Andric   FeaturePartialNSAEncoding,
156781ad6265SDimitry Andric   FeatureShaderCyclesRegister,
156881ad6265SDimitry Andric   FeatureArchitectedFlatScratch,
156981ad6265SDimitry Andric   FeatureAtomicFaddRtnInsts,
157081ad6265SDimitry Andric   FeatureAtomicFaddNoRtnInsts,
1571bdd1243dSDimitry Andric   FeatureFlatAtomicFaddF32Inst,
157281ad6265SDimitry Andric   FeatureImageInsts,
157381ad6265SDimitry Andric   FeaturePackedTID,
1574bdd1243dSDimitry Andric   FeatureVcmpxPermlaneHazard,
15750fca6ea1SDimitry Andric   FeatureMemoryAtomicFAddF32DenormalSupport]>;
15760fca6ea1SDimitry Andric
15770fca6ea1SDimitry Andric// There are few workarounds that need to be
15780fca6ea1SDimitry Andric// added to all targets. This pessimizes codegen
15790fca6ea1SDimitry Andric// a bit on the generic GFX11 target.
15800fca6ea1SDimitry Andricdef FeatureISAVersion11_Generic: FeatureSet<
15810fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion11_Common.Features,
15820fca6ea1SDimitry Andric    [FeatureMSAALoadDstSelBug,
15830fca6ea1SDimitry Andric     FeatureVALUTransUseHazard,
15840fca6ea1SDimitry Andric     FeatureUserSGPRInit16Bug,
15850fca6ea1SDimitry Andric     FeatureMADIntraFwdBug,
15860fca6ea1SDimitry Andric     FeaturePrivEnabledTrap2NopBug,
15870fca6ea1SDimitry Andric     FeatureRequiresCOV6,
15880fca6ea1SDimitry Andric     FeatureRequiredExportPriority])>;
158981ad6265SDimitry Andric
159006c3fb27SDimitry Andricdef FeatureISAVersion11_0_Common : FeatureSet<
159181ad6265SDimitry Andric  !listconcat(FeatureISAVersion11_Common.Features,
15925f757f3fSDimitry Andric    [FeatureMSAALoadDstSelBug,
15930fca6ea1SDimitry Andric     FeatureVALUTransUseHazard,
15940fca6ea1SDimitry Andric     FeatureMADIntraFwdBug,
15950fca6ea1SDimitry Andric     FeaturePrivEnabledTrap2NopBug])>;
159606c3fb27SDimitry Andric
159706c3fb27SDimitry Andricdef FeatureISAVersion11_0_0 : FeatureSet<
159806c3fb27SDimitry Andric  !listconcat(FeatureISAVersion11_0_Common.Features,
15990fca6ea1SDimitry Andric    [Feature1_5xVGPRs,
1600bdd1243dSDimitry Andric     FeatureUserSGPRInit16Bug])>;
160181ad6265SDimitry Andric
1602fcaf7f86SDimitry Andricdef FeatureISAVersion11_0_1 : FeatureSet<
160306c3fb27SDimitry Andric  !listconcat(FeatureISAVersion11_0_Common.Features,
16040fca6ea1SDimitry Andric    [Feature1_5xVGPRs])>;
1605fcaf7f86SDimitry Andric
160681ad6265SDimitry Andricdef FeatureISAVersion11_0_2 : FeatureSet<
160706c3fb27SDimitry Andric  !listconcat(FeatureISAVersion11_0_Common.Features,
160881ad6265SDimitry Andric    [FeatureUserSGPRInit16Bug])>;
160981ad6265SDimitry Andric
1610bdd1243dSDimitry Andricdef FeatureISAVersion11_0_3 : FeatureSet<
161106c3fb27SDimitry Andric  !listconcat(FeatureISAVersion11_0_Common.Features,
161206c3fb27SDimitry Andric    [])>;
161306c3fb27SDimitry Andric
161406c3fb27SDimitry Andricdef FeatureISAVersion11_5_0 : FeatureSet<
1615bdd1243dSDimitry Andric  !listconcat(FeatureISAVersion11_Common.Features,
16165f757f3fSDimitry Andric    [FeatureSALUFloatInsts,
16175f757f3fSDimitry Andric     FeatureDPPSrc1SGPR,
16180fca6ea1SDimitry Andric     FeatureVGPRSingleUseHintInsts,
16190fca6ea1SDimitry Andric     FeatureRequiredExportPriority])>;
1620bdd1243dSDimitry Andric
162106c3fb27SDimitry Andricdef FeatureISAVersion11_5_1 : FeatureSet<
162206c3fb27SDimitry Andric  !listconcat(FeatureISAVersion11_Common.Features,
16235f757f3fSDimitry Andric    [FeatureSALUFloatInsts,
16245f757f3fSDimitry Andric     FeatureDPPSrc1SGPR,
16255f757f3fSDimitry Andric     FeatureVGPRSingleUseHintInsts,
16260fca6ea1SDimitry Andric     Feature1_5xVGPRs,
16270fca6ea1SDimitry Andric     FeatureRequiredExportPriority])>;
16280fca6ea1SDimitry Andric
16290fca6ea1SDimitry Andricdef FeatureISAVersion11_5_2 : FeatureSet<
16300fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion11_Common.Features,
16310fca6ea1SDimitry Andric    [FeatureSALUFloatInsts,
16320fca6ea1SDimitry Andric     FeatureDPPSrc1SGPR,
16330fca6ea1SDimitry Andric     FeatureVGPRSingleUseHintInsts,
16340fca6ea1SDimitry Andric     FeatureRequiredExportPriority])>;
16355f757f3fSDimitry Andric
16365f757f3fSDimitry Andricdef FeatureISAVersion12 : FeatureSet<
16375f757f3fSDimitry Andric  [FeatureGFX12,
16385f757f3fSDimitry Andric   FeatureLDSBankCount32,
16395f757f3fSDimitry Andric   FeatureDLInsts,
16405f757f3fSDimitry Andric   FeatureDot7Insts,
16415f757f3fSDimitry Andric   FeatureDot8Insts,
16425f757f3fSDimitry Andric   FeatureDot9Insts,
16435f757f3fSDimitry Andric   FeatureDot10Insts,
16440fca6ea1SDimitry Andric   FeatureDot11Insts,
16455f757f3fSDimitry Andric   FeatureNSAEncoding,
16465f757f3fSDimitry Andric   FeaturePartialNSAEncoding,
16471db9f3b2SDimitry Andric   FeatureShaderCyclesHiLoRegisters,
16485f757f3fSDimitry Andric   FeatureArchitectedFlatScratch,
16497a6dacacSDimitry Andric   FeatureArchitectedSGPRs,
16505f757f3fSDimitry Andric   FeatureAtomicFaddRtnInsts,
16515f757f3fSDimitry Andric   FeatureAtomicFaddNoRtnInsts,
16527a6dacacSDimitry Andric   FeatureAtomicDsPkAdd16Insts,
16537a6dacacSDimitry Andric   FeatureAtomicFlatPkAdd16Insts,
16547a6dacacSDimitry Andric   FeatureAtomicBufferGlobalPkAddF16Insts,
16557a6dacacSDimitry Andric   FeatureAtomicGlobalPkAddBF16Inst,
16560fca6ea1SDimitry Andric   FeatureAtomicBufferPkAddBF16Inst,
16575f757f3fSDimitry Andric   FeatureFlatAtomicFaddF32Inst,
16585f757f3fSDimitry Andric   FeatureImageInsts,
16595f757f3fSDimitry Andric   FeatureExtendedImageInsts,
1660b3edf446SDimitry Andric   FeatureFP8ConversionInsts,
16615f757f3fSDimitry Andric   FeaturePackedTID,
16625f757f3fSDimitry Andric   FeatureVcmpxPermlaneHazard,
16635f757f3fSDimitry Andric   FeatureSALUFloatInsts,
16645f757f3fSDimitry Andric   FeaturePseudoScalarTrans,
16655f757f3fSDimitry Andric   FeatureHasRestrictedSOffset,
16665f757f3fSDimitry Andric   FeatureVGPRSingleUseHintInsts,
16677a6dacacSDimitry Andric   FeatureScalarDwordx3Loads,
16680fca6ea1SDimitry Andric   FeatureDPPSrc1SGPR,
16690fca6ea1SDimitry Andric   FeatureMaxHardClauseLength32,
16700fca6ea1SDimitry Andric   Feature1_5xVGPRs,
16710fca6ea1SDimitry Andric   FeatureMemoryAtomicFAddF32DenormalSupport
16720fca6ea1SDimitry Andric   ]>;
16730fca6ea1SDimitry Andric
16740fca6ea1SDimitry Andricdef FeatureISAVersion12_Generic: FeatureSet<
16750fca6ea1SDimitry Andric  !listconcat(FeatureISAVersion12.Features,
16760fca6ea1SDimitry Andric    [FeatureRequiresCOV6])>;
167706c3fb27SDimitry Andric
16780b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
16790b57cec5SDimitry Andric
16800b57cec5SDimitry Andricdef AMDGPUInstrInfo : InstrInfo {
16810b57cec5SDimitry Andric  let guessInstructionProperties = 1;
16820b57cec5SDimitry Andric}
16830b57cec5SDimitry Andric
16840b57cec5SDimitry Andricdef AMDGPUAsmParser : AsmParser {
16850b57cec5SDimitry Andric  // Some of the R600 registers have the same name, so this crashes.
16860b57cec5SDimitry Andric  // For example T0_XYZW and T0_XY both have the asm name T0.
16870b57cec5SDimitry Andric  let ShouldEmitMatchRegisterName = 0;
1688bdd1243dSDimitry Andric
1689bdd1243dSDimitry Andric  // Call the custom operand parser for all operands.
1690bdd1243dSDimitry Andric  let OperandParserMethod = "parseCustomOperand";
1691bdd1243dSDimitry Andric  let CallCustomParserForAllOperands = true;
16920b57cec5SDimitry Andric}
16930b57cec5SDimitry Andric
16940b57cec5SDimitry Andricdef AMDGPUAsmWriter : AsmWriter {
16950b57cec5SDimitry Andric  int PassSubtarget = 1;
16960b57cec5SDimitry Andric}
16970b57cec5SDimitry Andric
16980b57cec5SDimitry Andricdef AMDGPUAsmVariants {
16990b57cec5SDimitry Andric  string Default = "Default";
17000b57cec5SDimitry Andric  int Default_ID = 0;
17010b57cec5SDimitry Andric  string VOP3 = "VOP3";
17020b57cec5SDimitry Andric  int VOP3_ID = 1;
17030b57cec5SDimitry Andric  string SDWA = "SDWA";
17040b57cec5SDimitry Andric  int SDWA_ID = 2;
17050b57cec5SDimitry Andric  string SDWA9 = "SDWA9";
17060b57cec5SDimitry Andric  int SDWA9_ID = 3;
17070b57cec5SDimitry Andric  string DPP = "DPP";
17080b57cec5SDimitry Andric  int DPP_ID = 4;
170981ad6265SDimitry Andric  string VOP3_DPP = "VOP3_DPP";
171081ad6265SDimitry Andric  int VOP3_DPP_ID = 5;
17110b57cec5SDimitry Andric  string Disable = "Disable";
171281ad6265SDimitry Andric  int Disable_ID = 6;
17130b57cec5SDimitry Andric}
17140b57cec5SDimitry Andric
17150b57cec5SDimitry Andricdef DefaultAMDGPUAsmParserVariant : AsmParserVariant {
17160b57cec5SDimitry Andric  let Variant = AMDGPUAsmVariants.Default_ID;
17170b57cec5SDimitry Andric  let Name = AMDGPUAsmVariants.Default;
17180b57cec5SDimitry Andric}
17190b57cec5SDimitry Andric
17200b57cec5SDimitry Andricdef VOP3AsmParserVariant : AsmParserVariant {
17210b57cec5SDimitry Andric  let Variant = AMDGPUAsmVariants.VOP3_ID;
17220b57cec5SDimitry Andric  let Name = AMDGPUAsmVariants.VOP3;
17230b57cec5SDimitry Andric}
17240b57cec5SDimitry Andric
17250b57cec5SDimitry Andricdef SDWAAsmParserVariant : AsmParserVariant {
17260b57cec5SDimitry Andric  let Variant = AMDGPUAsmVariants.SDWA_ID;
17270b57cec5SDimitry Andric  let Name = AMDGPUAsmVariants.SDWA;
17280b57cec5SDimitry Andric}
17290b57cec5SDimitry Andric
17300b57cec5SDimitry Andricdef SDWA9AsmParserVariant : AsmParserVariant {
17310b57cec5SDimitry Andric  let Variant = AMDGPUAsmVariants.SDWA9_ID;
17320b57cec5SDimitry Andric  let Name = AMDGPUAsmVariants.SDWA9;
17330b57cec5SDimitry Andric}
17340b57cec5SDimitry Andric
17350b57cec5SDimitry Andricdef DPPAsmParserVariant : AsmParserVariant {
17360b57cec5SDimitry Andric  let Variant = AMDGPUAsmVariants.DPP_ID;
17370b57cec5SDimitry Andric  let Name = AMDGPUAsmVariants.DPP;
17380b57cec5SDimitry Andric}
17390b57cec5SDimitry Andric
174081ad6265SDimitry Andricdef VOP3_DPPAsmParserVariant : AsmParserVariant {
174181ad6265SDimitry Andric  let Variant = AMDGPUAsmVariants.VOP3_DPP_ID;
174281ad6265SDimitry Andric  let Name = AMDGPUAsmVariants.VOP3_DPP;
174381ad6265SDimitry Andric}
174481ad6265SDimitry Andric
17450b57cec5SDimitry Andricdef AMDGPU : Target {
17460b57cec5SDimitry Andric  // Pull in Instruction Info:
17470b57cec5SDimitry Andric  let InstructionSet = AMDGPUInstrInfo;
17480b57cec5SDimitry Andric  let AssemblyParsers = [AMDGPUAsmParser];
17490b57cec5SDimitry Andric  let AssemblyParserVariants = [DefaultAMDGPUAsmParserVariant,
17500b57cec5SDimitry Andric                                VOP3AsmParserVariant,
17510b57cec5SDimitry Andric                                SDWAAsmParserVariant,
17520b57cec5SDimitry Andric                                SDWA9AsmParserVariant,
175381ad6265SDimitry Andric                                DPPAsmParserVariant,
175481ad6265SDimitry Andric                                VOP3_DPPAsmParserVariant];
17550b57cec5SDimitry Andric  let AssemblyWriters = [AMDGPUAsmWriter];
17560b57cec5SDimitry Andric  let AllowRegisterRenaming = 1;
17570b57cec5SDimitry Andric}
17580b57cec5SDimitry Andric
17590b57cec5SDimitry Andric// Dummy Instruction itineraries for pseudo instructions
17600b57cec5SDimitry Andricdef ALU_NULL : FuncUnit;
17610b57cec5SDimitry Andricdef NullALU : InstrItinClass;
17620b57cec5SDimitry Andric
17630b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
17640b57cec5SDimitry Andric// Predicate helper class
17650b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
17660b57cec5SDimitry Andric
17670b57cec5SDimitry Andricdef isGFX6 :
17680b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS">,
17695ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureSouthernIslands)>;
17700b57cec5SDimitry Andric
17710b57cec5SDimitry Andricdef isGFX6GFX7 :
17720b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
17730b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS">,
17745ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), (not FeatureGFX10Insts))>;
17750b57cec5SDimitry Andric
17760b57cec5SDimitry Andricdef isGFX6GFX7GFX10 :
17770b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
17780b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
17790b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
178081ad6265SDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), (not FeatureGFX11Insts))>;
178181ad6265SDimitry Andric
178281ad6265SDimitry Andricdef isGFX6GFX7GFX10Plus :
178381ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
178481ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
178581ad6265SDimitry Andric            "Subtarget->getGeneration() >= AMDGPUSubtarget::GFX10">,
17865ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding))>;
17870b57cec5SDimitry Andric
17880b57cec5SDimitry Andricdef isGFX7Only :
17890b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS">,
17905ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureCIInsts, (not FeatureGFX10Insts))>;
17910b57cec5SDimitry Andric
17920b57cec5SDimitry Andricdef isGFX7GFX10 :
17930b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
17940b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
179581ad6265SDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureCIInsts, (not FeatureGFX11Insts))>;
179681ad6265SDimitry Andric
179781ad6265SDimitry Andricdef isGFX7GFX10GFX11 :
179881ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
179981ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10 ||"
180081ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX11">,
18015ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureCIInsts)>;
18020b57cec5SDimitry Andric
18030b57cec5SDimitry Andricdef isGFX7GFX8GFX9 :
18040b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
18050b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
18060b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
18075ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX7GFX8GFX9Insts)>;
18080b57cec5SDimitry Andric
18090b57cec5SDimitry Andricdef isGFX6GFX7GFX8GFX9 :
18100b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
18110b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
18120b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
18130b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
18145ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGFX10Insts))>;
18150b57cec5SDimitry Andric
1816fe6060f1SDimitry Andricdef isGFX6GFX7GFX8GFX9NotGFX90A :
1817fe6060f1SDimitry Andric  Predicate<"!Subtarget->hasGFX90AInsts() &&"
1818fe6060f1SDimitry Andric            "(Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
1819fe6060f1SDimitry Andric            " Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
1820fe6060f1SDimitry Andric            " Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1821fe6060f1SDimitry Andric            " Subtarget->getGeneration() == AMDGPUSubtarget::GFX9)">,
1822fe6060f1SDimitry Andric  AssemblerPredicate<(all_of (not FeatureGFX10Insts), (not FeatureGFX90AInsts))>;
1823fe6060f1SDimitry Andric
182481ad6265SDimitry Andricdef isGFX6GFX7GFX8GFX9GFX10 :
182581ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
182681ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
182781ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
182881ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9 ||"
182981ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
183081ad6265SDimitry Andric  AssemblerPredicate<(all_of (not FeatureGFX11Insts))>;
183181ad6265SDimitry Andric
18325f757f3fSDimitry Andricdef isNotGFX12Plus :
18335f757f3fSDimitry Andric  Predicate<"Subtarget->getGeneration() <= AMDGPUSubtarget::GFX11">,
18345f757f3fSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGFX12Insts))>;
18355f757f3fSDimitry Andric
183681ad6265SDimitry Andricdef isGFX7GFX8GFX9GFX10 :
183781ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
183881ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
183981ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9 ||"
184081ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
184181ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureCIInsts, (not FeatureGFX11Insts))>;
184281ad6265SDimitry Andric
18435f757f3fSDimitry Andricdef isGFX8GFX9GFX10GFX11 :
18445f757f3fSDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
18455f757f3fSDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9 ||"
18465f757f3fSDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10 ||"
18475f757f3fSDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX11">,
18485f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts, (not FeatureGFX12Insts))>;
18495f757f3fSDimitry Andric
18500b57cec5SDimitry Andricdef isGFX7Plus :
18510b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::SEA_ISLANDS">,
18525ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureCIInsts)>;
18530b57cec5SDimitry Andric
18540b57cec5SDimitry Andricdef isGFX8Plus :
18550b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS">,
18565ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts)>;
18570b57cec5SDimitry Andric
18580b57cec5SDimitry Andricdef isGFX8Only : Predicate<"Subtarget->getGeneration() =="
18590b57cec5SDimitry Andric                           "AMDGPUSubtarget::VOLCANIC_ISLANDS">,
18605ffd83dbSDimitry Andric  AssemblerPredicate <(all_of FeatureVolcanicIslands)>;
18610b57cec5SDimitry Andric
18620b57cec5SDimitry Andricdef isGFX9Plus :
18630b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
18645ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX9Insts)>;
18650b57cec5SDimitry Andric
186606c3fb27SDimitry Andricdef isNotGFX9Plus :
186706c3fb27SDimitry Andric  Predicate<"Subtarget->getGeneration() < AMDGPUSubtarget::GFX9">;
186806c3fb27SDimitry Andric
18690b57cec5SDimitry Andricdef isGFX9Only : Predicate <
18700b57cec5SDimitry Andric  "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
18715ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGCN3Encoding, FeatureGFX9Insts)>;
18720b57cec5SDimitry Andric
1873fe6060f1SDimitry Andricdef isGCN3ExcludingGFX90A :
1874fe6060f1SDimitry Andric  Predicate<"Subtarget->isGCN3Encoding() && !Subtarget->hasGFX90AInsts()">,
1875fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureGCN3Encoding, (not FeatureGFX90AInsts))>;
1876fe6060f1SDimitry Andric
1877fe6060f1SDimitry Andricdef isGFX90APlus :
1878fe6060f1SDimitry Andric  Predicate<"Subtarget->hasGFX90AInsts()">,
1879fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX90AInsts)>;
1880fe6060f1SDimitry Andric
1881fe6060f1SDimitry Andricdef isNotGFX90APlus :
1882fe6060f1SDimitry Andric  Predicate<"!Subtarget->hasGFX90AInsts()">,
1883fe6060f1SDimitry Andric  AssemblerPredicate<(all_of (not FeatureGFX90AInsts))>;
1884fe6060f1SDimitry Andric
1885fe6060f1SDimitry Andricdef isGFX8GFX9NotGFX90A :
1886fe6060f1SDimitry Andric  Predicate<"!Subtarget->hasGFX90AInsts() &&"
1887fe6060f1SDimitry Andric            "(Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1888fe6060f1SDimitry Andric            " Subtarget->getGeneration() == AMDGPUSubtarget::GFX9)">,
1889fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts, FeatureGCN3Encoding, (not FeatureGFX90AInsts))>;
1890fe6060f1SDimitry Andric
1891fe6060f1SDimitry Andricdef isGFX90AOnly :
189281ad6265SDimitry Andric  Predicate<"Subtarget->hasGFX90AInsts() && !Subtarget->hasGFX940Insts()">,
189381ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX90AInsts, (not FeatureGFX940Insts))>;
1894fe6060f1SDimitry Andric
1895fe6060f1SDimitry Andricdef isGFX908orGFX90A :
189681ad6265SDimitry Andric  Predicate<"Subtarget->hasMAIInsts() && !Subtarget->hasGFX940Insts()">,
189781ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureMAIInsts, (not FeatureGFX940Insts))>;
189881ad6265SDimitry Andric
189981ad6265SDimitry Andricdef isGFX940Plus :
190081ad6265SDimitry Andric  Predicate<"Subtarget->hasGFX940Insts()">,
190181ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX940Insts)>;
190281ad6265SDimitry Andric
190381ad6265SDimitry Andricdef isGFX8GFX9NotGFX940 :
190481ad6265SDimitry Andric  Predicate<"!Subtarget->hasGFX940Insts() &&"
190581ad6265SDimitry Andric            "(Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
190681ad6265SDimitry Andric            " Subtarget->getGeneration() == AMDGPUSubtarget::GFX9)">,
190781ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts, FeatureGCN3Encoding, (not FeatureGFX940Insts))>;
1908fe6060f1SDimitry Andric
19090b57cec5SDimitry Andricdef isGFX8GFX9 :
19100b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
19110b57cec5SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
19125ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts, FeatureGCN3Encoding)>;
19130b57cec5SDimitry Andric
191481ad6265SDimitry Andricdef isGFX10Only :
191581ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
191681ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10Insts, (not FeatureGFX11Insts))>;
191781ad6265SDimitry Andric
19180b57cec5SDimitry Andricdef isGFX10Plus :
19190b57cec5SDimitry Andric  Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX10">,
19205ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10Insts)>;
19210b57cec5SDimitry Andric
19225f757f3fSDimitry Andricdef isGFX10GFX11 :
19235f757f3fSDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::GFX10 ||"
19245f757f3fSDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX11">,
19255f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10Insts, (not FeatureGFX12Insts))>;
19265f757f3fSDimitry Andric
1927e8d8bef9SDimitry Andricdef isGFX10Before1030 :
1928e8d8bef9SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::GFX10 &&"
1929e8d8bef9SDimitry Andric            "!Subtarget->hasGFX10_3Insts()">,
1930e8d8bef9SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10Insts,(not FeatureGFX10_3Insts))>;
1931e8d8bef9SDimitry Andric
193281ad6265SDimitry Andricdef isGFX9GFX10 :
193381ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::GFX9 ||"
193481ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
193581ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX9Insts, (not FeatureGFX11Insts))>;
193681ad6265SDimitry Andric
193781ad6265SDimitry Andricdef isGFX8GFX9GFX10 :
193881ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
193981ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9 ||"
194081ad6265SDimitry Andric            "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
194181ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts, (not FeatureGFX11Insts))>;
194281ad6265SDimitry Andric
194381ad6265SDimitry Andricdef isGFX11Only :
194481ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::GFX11">,
19455f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX11Insts, (not FeatureGFX12Insts))>;
194681ad6265SDimitry Andric
194781ad6265SDimitry Andricdef isGFX11Plus :
194881ad6265SDimitry Andric  Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX11">,
194981ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX11Insts)>;
195081ad6265SDimitry Andric
19515f757f3fSDimitry Andricdef isGFX12Only :
19525f757f3fSDimitry Andric  Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::GFX12">,
19535f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX12Insts)>;
19545f757f3fSDimitry Andric
19555f757f3fSDimitry Andricdef isGFX12Plus :
19565f757f3fSDimitry Andric  Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX12">,
19575f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX12Insts)>;
19585f757f3fSDimitry Andric
19590b57cec5SDimitry Andricdef HasFlatAddressSpace : Predicate<"Subtarget->hasFlatAddressSpace()">,
19605ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureFlatAddressSpace)>;
19610b57cec5SDimitry Andric
19620fca6ea1SDimitry Andricdef HasFlatBufferGlobalAtomicFaddF64Inst :
19630fca6ea1SDimitry Andric  Predicate<"Subtarget->hasFlatBufferGlobalAtomicFaddF64Inst()">,
19640fca6ea1SDimitry Andric  AssemblerPredicate<(any_of FeatureFlatBufferGlobalAtomicFaddF64Inst)>;
19650fca6ea1SDimitry Andric
19660fca6ea1SDimitry Andricdef HasAtomicFMinFMaxF32GlobalInsts :
19670fca6ea1SDimitry Andric  Predicate<"Subtarget->hasAtomicFMinFMaxF32GlobalInsts()">,
19680fca6ea1SDimitry Andric  AssemblerPredicate<(any_of FeatureAtomicFMinFMaxF32GlobalInsts)>;
19690fca6ea1SDimitry Andric
19700fca6ea1SDimitry Andricdef HasAtomicFMinFMaxF64GlobalInsts :
19710fca6ea1SDimitry Andric  Predicate<"Subtarget->hasAtomicFMinFMaxF64GlobalInsts()">,
19720fca6ea1SDimitry Andric  AssemblerPredicate<(any_of FeatureAtomicFMinFMaxF64GlobalInsts)>;
19730fca6ea1SDimitry Andric
19740fca6ea1SDimitry Andricdef HasAtomicFMinFMaxF32FlatInsts :
19750fca6ea1SDimitry Andric  Predicate<"Subtarget->hasAtomicFMinFMaxF32FlatInsts()">,
19760fca6ea1SDimitry Andric  AssemblerPredicate<(any_of FeatureAtomicFMinFMaxF32FlatInsts)>;
19770fca6ea1SDimitry Andric
19780fca6ea1SDimitry Andricdef HasAtomicFMinFMaxF64FlatInsts :
19790fca6ea1SDimitry Andric  Predicate<"Subtarget->hasAtomicFMinFMaxF64FlatInsts()">,
19800fca6ea1SDimitry Andric  AssemblerPredicate<(any_of FeatureAtomicFMinFMaxF64FlatInsts)>;
19810fca6ea1SDimitry Andric
19820fca6ea1SDimitry Andricdef HasLdsAtomicAddF64 :
19830fca6ea1SDimitry Andric  Predicate<"Subtarget->hasLdsAtomicAddF64()">,
19840fca6ea1SDimitry Andric  AssemblerPredicate<(any_of FeatureGFX90AInsts)>;
19850fca6ea1SDimitry Andric
19860b57cec5SDimitry Andricdef HasFlatGlobalInsts : Predicate<"Subtarget->hasFlatGlobalInsts()">,
19875ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureFlatGlobalInsts)>;
19880b57cec5SDimitry Andricdef HasFlatScratchInsts : Predicate<"Subtarget->hasFlatScratchInsts()">,
19895ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureFlatScratchInsts)>;
19900b57cec5SDimitry Andricdef HasScalarFlatScratchInsts : Predicate<"Subtarget->hasScalarFlatScratchInsts()">,
19915ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureScalarFlatScratchInsts)>;
19920b57cec5SDimitry Andricdef HasD16LoadStore : Predicate<"Subtarget->hasD16LoadStore()">,
19935ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX9Insts)>;
19945ffd83dbSDimitry Andric
1995e8d8bef9SDimitry Andricdef HasFlatScratchSTMode : Predicate<"Subtarget->hasFlatScratchSTMode()">,
199681ad6265SDimitry Andric  AssemblerPredicate<(any_of FeatureGFX10_3Insts, FeatureGFX940Insts)>;
199781ad6265SDimitry Andricdef HasFlatScratchSVSMode : Predicate<"Subtarget->hasFlatScratchSVSMode()">,
199881ad6265SDimitry Andric  AssemblerPredicate<(any_of FeatureGFX940Insts, FeatureGFX11Insts)>;
1999e8d8bef9SDimitry Andric
2000fe6060f1SDimitry Andricdef HasGFX10_AEncoding : Predicate<"Subtarget->hasGFX10_AEncoding()">,
2001fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10_AEncoding)>;
2002fe6060f1SDimitry Andric
20035ffd83dbSDimitry Andricdef HasGFX10_BEncoding : Predicate<"Subtarget->hasGFX10_BEncoding()">,
20045ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX10_BEncoding)>;
20050b57cec5SDimitry Andric
20060b57cec5SDimitry Andricdef HasUnpackedD16VMem : Predicate<"Subtarget->hasUnpackedD16VMem()">,
20075ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureUnpackedD16VMem)>;
20080b57cec5SDimitry Andricdef HasPackedD16VMem : Predicate<"!Subtarget->hasUnpackedD16VMem()">,
20095ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureUnpackedD16VMem))>;
20100b57cec5SDimitry Andric
20115f757f3fSDimitry Andricdef HasRestrictedSOffset : Predicate<"Subtarget->hasRestrictedSOffset()">,
20125f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeatureHasRestrictedSOffset)>;
20135f757f3fSDimitry Andricdef HasUnrestrictedSOffset : Predicate<"!Subtarget->hasRestrictedSOffset()">,
20145f757f3fSDimitry Andric  AssemblerPredicate<(all_of (not FeatureHasRestrictedSOffset))>;
20155f757f3fSDimitry Andric
20160b57cec5SDimitry Andricdef D16PreservesUnusedBits :
20170b57cec5SDimitry Andric  Predicate<"Subtarget->d16PreservesUnusedBits()">,
20185ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX9Insts, (not FeatureSRAMECC))>;
20190b57cec5SDimitry Andric
20200b57cec5SDimitry Andricdef LDSRequiresM0Init : Predicate<"Subtarget->ldsRequiresM0Init()">;
20210b57cec5SDimitry Andricdef NotLDSRequiresM0Init : Predicate<"!Subtarget->ldsRequiresM0Init()">;
20220b57cec5SDimitry Andric
20230fca6ea1SDimitry Andricdef HasExportInsts : Predicate<"Subtarget->hasExportInsts()">,
20240fca6ea1SDimitry Andric  AssemblerPredicate<(all_of (not FeatureGFX90AInsts))>;
20250fca6ea1SDimitry Andric
20260fca6ea1SDimitry Andricdef HasVINTERPEncoding : Predicate<"Subtarget->hasVINTERPEncoding()">,
20270fca6ea1SDimitry Andric  AssemblerPredicate<(all_of FeatureGFX11Insts)>;
20280fca6ea1SDimitry Andric
20290b57cec5SDimitry Andricdef HasDSAddTid : Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
20305ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX9Insts)>;
20315ffd83dbSDimitry Andric
20320fca6ea1SDimitry Andricdef HasLDSFPAtomicAddF32 : Predicate<"Subtarget->hasLDSFPAtomicAddF32()">,
20335ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX8Insts)>;
20340b57cec5SDimitry Andric
20350b57cec5SDimitry Andricdef HasAddNoCarryInsts : Predicate<"Subtarget->hasAddNoCarry()">,
20365ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureAddNoCarryInsts)>;
20370b57cec5SDimitry Andric
20380b57cec5SDimitry Andricdef NotHasAddNoCarryInsts : Predicate<"!Subtarget->hasAddNoCarry()">;
20390b57cec5SDimitry Andric
20400fca6ea1SDimitry Andricdef HasXNACKEnabled : Predicate<"Subtarget->isXNACKEnabled()">;
20410fca6ea1SDimitry Andric
20420b57cec5SDimitry Andricdef Has16BitInsts : Predicate<"Subtarget->has16BitInsts()">,
20435ffd83dbSDimitry Andric  AssemblerPredicate<(all_of Feature16BitInsts)>;
204481ad6265SDimitry Andric
204581ad6265SDimitry Andricdef HasTrue16BitInsts : Predicate<"Subtarget->hasTrue16BitInsts()">,
204681ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureTrue16BitInsts)>;
20470fca6ea1SDimitry Andricdef NotHasTrue16BitInsts : True16PredicateClass<"!Subtarget->hasTrue16BitInsts()">,
20480fca6ea1SDimitry Andric  AssemblerPredicate<(all_of (not FeatureTrue16BitInsts))>;
204981ad6265SDimitry Andric
20505f757f3fSDimitry Andric// Control use of True16 instructions. The real True16 instructions are
20515f757f3fSDimitry Andric// True16 instructions as they are defined in the ISA. Fake True16
20525f757f3fSDimitry Andric// instructions have the same encoding as real ones but syntactically
20535f757f3fSDimitry Andric// only allow 32-bit registers in operands and use low halves thereof.
20540fca6ea1SDimitry Andricdef UseRealTrue16Insts : True16PredicateClass<"Subtarget->useRealTrue16Insts()">,
20555f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeatureTrue16BitInsts, FeatureRealTrue16Insts)>;
20560fca6ea1SDimitry Andricdef UseFakeTrue16Insts : True16PredicateClass<"Subtarget->hasTrue16BitInsts() && "
20570fca6ea1SDimitry Andric                                              "!Subtarget->useRealTrue16Insts()">,
20580fca6ea1SDimitry Andric  AssemblerPredicate<(all_of FeatureTrue16BitInsts)>;
20590fca6ea1SDimitry Andric  // FIXME When we default to RealTrue16 instead of Fake, change the line as follows.
20600fca6ea1SDimitry Andric  // AssemblerPredicate<(all_of FeatureTrue16BitInsts, (not FeatureRealTrue16Insts))>;
20615f757f3fSDimitry Andric
20620b57cec5SDimitry Andricdef HasVOP3PInsts : Predicate<"Subtarget->hasVOP3PInsts()">,
20635ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureVOP3P)>;
20645ffd83dbSDimitry Andric
206506c3fb27SDimitry Andricdef NotHasMed3_16 : Predicate<"!Subtarget->hasMed3_16()">;
20660fca6ea1SDimitry Andricdef HasMed3_16 : Predicate<"Subtarget->hasMed3_16()">;
206706c3fb27SDimitry Andric
20685ffd83dbSDimitry Andricdef HasMinMaxDenormModes : Predicate<"Subtarget->supportsMinMaxDenormModes()">;
20695ffd83dbSDimitry Andricdef NotHasMinMaxDenormModes : Predicate<"!Subtarget->supportsMinMaxDenormModes()">;
20700b57cec5SDimitry Andric
2071bdd1243dSDimitry Andricdef HasFminFmaxLegacy : Predicate<"Subtarget->hasFminFmaxLegacy()">;
2072bdd1243dSDimitry Andric
20730b57cec5SDimitry Andricdef HasSDWA : Predicate<"Subtarget->hasSDWA()">,
20745ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureSDWA, FeatureVolcanicIslands)>;
20750b57cec5SDimitry Andric
20760b57cec5SDimitry Andricdef HasSDWA9 :
20770b57cec5SDimitry Andric  Predicate<"Subtarget->hasSDWA()">,
20785ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGCN3Encoding, FeatureGFX9Insts,FeatureSDWA)>;
20790b57cec5SDimitry Andric
20800b57cec5SDimitry Andricdef HasSDWA10 :
20810b57cec5SDimitry Andric  Predicate<"Subtarget->hasSDWA()">,
20825ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureGFX10Insts, FeatureSDWA)>;
20830b57cec5SDimitry Andric
20840b57cec5SDimitry Andricdef HasDPP : Predicate<"Subtarget->hasDPP()">,
20855ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGCN3Encoding, FeatureDPP)>;
20860b57cec5SDimitry Andric
20870b57cec5SDimitry Andricdef HasDPP8 : Predicate<"Subtarget->hasDPP8()">,
20885ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureGFX10Insts, FeatureDPP8)>;
20890b57cec5SDimitry Andric
20905f757f3fSDimitry Andricdef HasDPALU_DPP : Predicate<"Subtarget->hasDPALU_DPP()">,
20915f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeatureDPALU_DPP)>;
2092fe6060f1SDimitry Andric
2093fe6060f1SDimitry Andricdef HasPackedFP32Ops : Predicate<"Subtarget->hasPackedFP32Ops()">,
2094fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeaturePackedFP32Ops)>;
2095fe6060f1SDimitry Andric
20965f757f3fSDimitry Andricdef HasPkMovB32 : Predicate<"Subtarget->hasPkMovB32()">,
20975f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeatureGFX90AInsts)>;
20985f757f3fSDimitry Andric
2099fe6060f1SDimitry Andricdef HasFmaakFmamkF32Insts :
2100fe6060f1SDimitry Andric  Predicate<"Subtarget->hasFmaakFmamkF32Insts()">,
210181ad6265SDimitry Andric  AssemblerPredicate<(any_of FeatureGFX10Insts, FeatureGFX940Insts)>;
210281ad6265SDimitry Andric
210381ad6265SDimitry Andricdef HasImageInsts : Predicate<"Subtarget->hasImageInsts()">,
210481ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureImageInsts)>;
2105fe6060f1SDimitry Andric
2106fe6060f1SDimitry Andricdef HasExtendedImageInsts : Predicate<"Subtarget->hasExtendedImageInsts()">,
2107fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureExtendedImageInsts)>;
2108fe6060f1SDimitry Andric
21090b57cec5SDimitry Andricdef HasR128A16 : Predicate<"Subtarget->hasR128A16()">,
21105ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureR128A16)>;
21115ffd83dbSDimitry Andric
2112bdd1243dSDimitry Andricdef HasA16 : Predicate<"Subtarget->hasA16()">,
2113bdd1243dSDimitry Andric  AssemblerPredicate<(all_of FeatureA16)>;
21145ffd83dbSDimitry Andric
21155ffd83dbSDimitry Andricdef HasG16 : Predicate<"Subtarget->hasG16()">,
21165ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureG16)>;
21170b57cec5SDimitry Andric
21180b57cec5SDimitry Andricdef HasDPP16 : Predicate<"Subtarget->hasDPP()">,
21195ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureGFX10Insts, FeatureDPP)>;
21200b57cec5SDimitry Andric
21210b57cec5SDimitry Andricdef HasIntClamp : Predicate<"Subtarget->hasIntClamp()">,
21225ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureIntClamp)>;
21230b57cec5SDimitry Andric
21240b57cec5SDimitry Andricdef HasMadMixInsts : Predicate<"Subtarget->hasMadMixInsts()">,
21255ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureMadMixInsts)>;
21260b57cec5SDimitry Andric
21270b57cec5SDimitry Andricdef HasScalarStores : Predicate<"Subtarget->hasScalarStores()">,
21285ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureScalarStores)>;
21290b57cec5SDimitry Andric
21300b57cec5SDimitry Andricdef HasScalarAtomics : Predicate<"Subtarget->hasScalarAtomics()">,
21315ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureScalarAtomics)>;
21320b57cec5SDimitry Andric
21330b57cec5SDimitry Andricdef HasNoSdstCMPX : Predicate<"Subtarget->hasNoSdstCMPX()">,
21345ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureNoSdstCMPX)>;
21350b57cec5SDimitry Andric
21360b57cec5SDimitry Andricdef HasSdstCMPX : Predicate<"!Subtarget->hasNoSdstCMPX()">,
21375ffd83dbSDimitry Andric  AssemblerPredicate<(all_of (not FeatureNoSdstCMPX))>;
21380b57cec5SDimitry Andric
21390b57cec5SDimitry Andricdef has16BankLDS : Predicate<"Subtarget->getLDSBankCount() == 16">;
21400b57cec5SDimitry Andricdef has32BankLDS : Predicate<"Subtarget->getLDSBankCount() == 32">;
21410b57cec5SDimitry Andricdef HasVGPRIndexMode : Predicate<"Subtarget->hasVGPRIndexMode()">,
21425ffd83dbSDimitry Andric                      AssemblerPredicate<(all_of FeatureVGPRIndexMode)>;
21430b57cec5SDimitry Andricdef HasMovrel : Predicate<"Subtarget->hasMovrel()">,
21445ffd83dbSDimitry Andric                AssemblerPredicate<(all_of FeatureMovrel)>;
21450b57cec5SDimitry Andric
21460b57cec5SDimitry Andricdef HasFmaMixInsts : Predicate<"Subtarget->hasFmaMixInsts()">,
21475ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureFmaMixInsts)>;
21480b57cec5SDimitry Andric
21490b57cec5SDimitry Andricdef HasDLInsts : Predicate<"Subtarget->hasDLInsts()">,
21505ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDLInsts)>;
21510b57cec5SDimitry Andric
2152bdd1243dSDimitry Andricdef HasFmacF64Inst : Predicate<"Subtarget->hasFmacF64Inst()">,
2153bdd1243dSDimitry Andric  AssemblerPredicate<(all_of FeatureFmacF64Inst)>;
2154bdd1243dSDimitry Andric
21550b57cec5SDimitry Andricdef HasDot1Insts : Predicate<"Subtarget->hasDot1Insts()">,
21565ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot1Insts)>;
21570b57cec5SDimitry Andric
21580b57cec5SDimitry Andricdef HasDot2Insts : Predicate<"Subtarget->hasDot2Insts()">,
21595ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot2Insts)>;
21600b57cec5SDimitry Andric
21610b57cec5SDimitry Andricdef HasDot3Insts : Predicate<"Subtarget->hasDot3Insts()">,
21625ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot3Insts)>;
21630b57cec5SDimitry Andric
21640b57cec5SDimitry Andricdef HasDot4Insts : Predicate<"Subtarget->hasDot4Insts()">,
21655ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot4Insts)>;
21660b57cec5SDimitry Andric
21670b57cec5SDimitry Andricdef HasDot5Insts : Predicate<"Subtarget->hasDot5Insts()">,
21685ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot5Insts)>;
21690b57cec5SDimitry Andric
21700b57cec5SDimitry Andricdef HasDot6Insts : Predicate<"Subtarget->hasDot6Insts()">,
21715ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDot6Insts)>;
21725ffd83dbSDimitry Andric
2173fe6060f1SDimitry Andricdef HasDot7Insts : Predicate<"Subtarget->hasDot7Insts()">,
2174fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureDot7Insts)>;
2175fe6060f1SDimitry Andric
217681ad6265SDimitry Andricdef HasDot8Insts : Predicate<"Subtarget->hasDot8Insts()">,
217781ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureDot8Insts)>;
217881ad6265SDimitry Andric
2179bdd1243dSDimitry Andricdef HasDot9Insts : Predicate<"Subtarget->hasDot9Insts()">,
2180bdd1243dSDimitry Andric  AssemblerPredicate<(all_of FeatureDot9Insts)>;
2181bdd1243dSDimitry Andric
218206c3fb27SDimitry Andricdef HasDot10Insts : Predicate<"Subtarget->hasDot10Insts()">,
218306c3fb27SDimitry Andric  AssemblerPredicate<(all_of FeatureDot10Insts)>;
218406c3fb27SDimitry Andric
21850fca6ea1SDimitry Andricdef HasDot11Insts : Predicate<"Subtarget->hasDot11Insts()">,
21860fca6ea1SDimitry Andric  AssemblerPredicate<(all_of FeatureDot11Insts)>;
21870fca6ea1SDimitry Andric
21885ffd83dbSDimitry Andricdef HasGetWaveIdInst : Predicate<"Subtarget->hasGetWaveIdInst()">,
21895ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureGetWaveIdInst)>;
21900b57cec5SDimitry Andric
21910b57cec5SDimitry Andricdef HasMAIInsts : Predicate<"Subtarget->hasMAIInsts()">,
21925ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureMAIInsts)>;
21935ffd83dbSDimitry Andric
2194e8d8bef9SDimitry Andricdef HasSMemRealTime : Predicate<"Subtarget->hasSMemRealTime()">,
2195e8d8bef9SDimitry Andric  AssemblerPredicate<(all_of FeatureSMemRealTime)>;
2196e8d8bef9SDimitry Andric
21975ffd83dbSDimitry Andricdef HasSMemTimeInst : Predicate<"Subtarget->hasSMemTimeInst()">,
21985ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureSMemTimeInst)>;
21995ffd83dbSDimitry Andric
2200fe6060f1SDimitry Andricdef HasShaderCyclesRegister : Predicate<"Subtarget->hasShaderCyclesRegister()">,
2201fe6060f1SDimitry Andric  AssemblerPredicate<(all_of FeatureShaderCyclesRegister)>;
22020b57cec5SDimitry Andric
22031db9f3b2SDimitry Andricdef HasShaderCyclesHiLoRegisters : Predicate<"Subtarget->hasShaderCyclesHiLoRegisters()">;
22041db9f3b2SDimitry Andric
2205fcaf7f86SDimitry Andricdef HasFP8Insts : Predicate<"Subtarget->hasFP8Insts()">,
2206fcaf7f86SDimitry Andric  AssemblerPredicate<(all_of FeatureFP8Insts)>;
2207fcaf7f86SDimitry Andric
22087a6dacacSDimitry Andricdef HasFP8ConversionInsts : Predicate<"Subtarget->hasFP8ConversionInsts()">,
22097a6dacacSDimitry Andric  AssemblerPredicate<(all_of FeatureFP8ConversionInsts)>;
22107a6dacacSDimitry Andric
22110b57cec5SDimitry Andricdef HasPkFmacF16Inst : Predicate<"Subtarget->hasPkFmacF16Inst()">,
22125ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeaturePkFmacF16Inst)>;
22135ffd83dbSDimitry Andric
22145ffd83dbSDimitry Andricdef HasMadMacF32Insts : Predicate<"Subtarget->hasMadMacF32Insts()">,
22155ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureMadMacF32Insts)>;
22160b57cec5SDimitry Andric
2217e8d8bef9SDimitry Andricdef HasFmaLegacy32 : Predicate<"Subtarget->hasGFX10_3Insts()">,
2218e8d8bef9SDimitry Andric  AssemblerPredicate<(any_of FeatureGFX10_3Insts)>;
2219e8d8bef9SDimitry Andric
222006c3fb27SDimitry Andricdef HasAtomicDsPkAdd16Insts : Predicate<"Subtarget->hasAtomicDsPkAdd16Insts()">,
222106c3fb27SDimitry Andric  AssemblerPredicate<(any_of FeatureAtomicDsPkAdd16Insts)>;
222206c3fb27SDimitry Andric
222306c3fb27SDimitry Andricdef HasAtomicFlatPkAdd16Insts : Predicate<"Subtarget->hasAtomicFlatPkAdd16Insts()">,
222406c3fb27SDimitry Andric  AssemblerPredicate<(any_of FeatureAtomicFlatPkAdd16Insts)>;
222506c3fb27SDimitry Andric
222681ad6265SDimitry Andricdef HasAtomicFaddRtnInsts : Predicate<"Subtarget->hasAtomicFaddRtnInsts()">,
222781ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureAtomicFaddRtnInsts)>;
222881ad6265SDimitry Andricdef HasAtomicFaddNoRtnInsts : Predicate<"Subtarget->hasAtomicFaddNoRtnInsts()">,
222981ad6265SDimitry Andric  AssemblerPredicate<(all_of FeatureAtomicFaddNoRtnInsts)>;
223006c3fb27SDimitry Andricdef HasAtomicBufferGlobalPkAddF16NoRtnInsts
223106c3fb27SDimitry Andric  : Predicate<"Subtarget->hasAtomicBufferGlobalPkAddF16NoRtnInsts() || Subtarget->hasAtomicBufferGlobalPkAddF16Insts()">,
223206c3fb27SDimitry Andric  AssemblerPredicate<(any_of FeatureAtomicBufferGlobalPkAddF16NoRtnInsts, FeatureAtomicBufferGlobalPkAddF16Insts)>;
223306c3fb27SDimitry Andricdef HasAtomicBufferGlobalPkAddF16Insts
223406c3fb27SDimitry Andric  : Predicate<"Subtarget->hasAtomicBufferGlobalPkAddF16Insts()">,
223506c3fb27SDimitry Andric  AssemblerPredicate<(all_of FeatureAtomicBufferGlobalPkAddF16Insts)>;
223606c3fb27SDimitry Andricdef HasAtomicGlobalPkAddBF16Inst
223706c3fb27SDimitry Andric  : Predicate<"Subtarget->hasAtomicGlobalPkAddBF16Inst()">,
223806c3fb27SDimitry Andric    AssemblerPredicate<(all_of FeatureAtomicGlobalPkAddBF16Inst)>;
22390fca6ea1SDimitry Andricdef HasAtomicBufferPkAddBF16Inst
22400fca6ea1SDimitry Andric  : Predicate<"Subtarget->hasAtomicBufferPkAddBF16Inst()">,
22410fca6ea1SDimitry Andric    AssemblerPredicate<(all_of FeatureAtomicBufferPkAddBF16Inst)>;
2242bdd1243dSDimitry Andricdef HasFlatAtomicFaddF32Inst
2243bdd1243dSDimitry Andric  : Predicate<"Subtarget->hasFlatAtomicFaddF32Inst()">,
2244bdd1243dSDimitry Andric  AssemblerPredicate<(all_of FeatureFlatAtomicFaddF32Inst)>;
22455ffd83dbSDimitry Andric
22467a6dacacSDimitry Andricdef HasDefaultComponentZero
22477a6dacacSDimitry Andric  : Predicate<"Subtarget->hasDefaultComponentZero()">,
22487a6dacacSDimitry Andric  AssemblerPredicate<(all_of FeatureDefaultComponentZero)>;
22497a6dacacSDimitry Andricdef HasDefaultComponentBroadcast
22507a6dacacSDimitry Andric  : Predicate<"Subtarget->hasDefaultComponentBroadcast()">,
22517a6dacacSDimitry Andric  AssemblerPredicate<(all_of FeatureDefaultComponentBroadcast)>;
22527a6dacacSDimitry Andric
22535ffd83dbSDimitry Andricdef HasDsSrc2Insts : Predicate<"!Subtarget->hasDsSrc2Insts()">,
22545ffd83dbSDimitry Andric  AssemblerPredicate<(all_of FeatureDsSrc2Insts)>;
22550b57cec5SDimitry Andric
22560b57cec5SDimitry Andricdef EnableLateCFGStructurize : Predicate<
22570b57cec5SDimitry Andric  "EnableLateStructurizeCFG">;
22580b57cec5SDimitry Andric
2259e8d8bef9SDimitry Andricdef EnableFlatScratch : Predicate<"Subtarget->enableFlatScratch()">;
2260e8d8bef9SDimitry Andric
2261e8d8bef9SDimitry Andricdef DisableFlatScratch : Predicate<"!Subtarget->enableFlatScratch()">;
2262e8d8bef9SDimitry Andric
2263e8d8bef9SDimitry Andricdef HasUnalignedAccessMode : Predicate<"Subtarget->hasUnalignedAccessMode()">,
2264e8d8bef9SDimitry Andric  AssemblerPredicate<(all_of FeatureUnalignedAccessMode)>;
2265e8d8bef9SDimitry Andric
2266bdd1243dSDimitry Andricdef HasMADIntraFwdBug : Predicate<"Subtarget->hasMADIntraFwdBug()">;
2267bdd1243dSDimitry Andric
2268bdd1243dSDimitry Andricdef HasNotMADIntraFwdBug : Predicate<"!Subtarget->hasMADIntraFwdBug()">;
2269bdd1243dSDimitry Andric
22705f757f3fSDimitry Andricdef HasSALUFloatInsts : Predicate<"Subtarget->hasSALUFloatInsts()">,
22715f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeatureSALUFloatInsts)>;
22725f757f3fSDimitry Andric
22735f757f3fSDimitry Andricdef HasVGPRSingleUseHintInsts : Predicate<"Subtarget->hasVGPRSingleUseHintInsts()">,
22745f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeatureVGPRSingleUseHintInsts)>;
22755f757f3fSDimitry Andric
22765f757f3fSDimitry Andricdef HasPseudoScalarTrans : Predicate<"Subtarget->hasPseudoScalarTrans()">,
22775f757f3fSDimitry Andric  AssemblerPredicate<(all_of FeaturePseudoScalarTrans)>;
22785f757f3fSDimitry Andric
22795f757f3fSDimitry Andricdef HasGDS : Predicate<"Subtarget->hasGDS()">;
22805f757f3fSDimitry Andric
22815f757f3fSDimitry Andricdef HasGWS : Predicate<"Subtarget->hasGWS()">;
22825f757f3fSDimitry Andric
22835f757f3fSDimitry Andricdef HasCvtFP8VOP1Bug : Predicate<"Subtarget->hasCvtFP8VOP1Bug()">;
22845f757f3fSDimitry Andricdef HasNoCvtFP8VOP1Bug : Predicate<"!Subtarget->hasCvtFP8VOP1Bug()">;
22855f757f3fSDimitry Andric
22865f757f3fSDimitry Andricdef HasAtomicCSubNoRtnInsts : Predicate<"Subtarget->hasAtomicCSubNoRtnInsts()">;
22875f757f3fSDimitry Andric
22885f757f3fSDimitry Andricdef HasScalarDwordx3Loads : Predicate<"Subtarget->hasScalarDwordx3Loads()">;
22895f757f3fSDimitry Andric
22900b57cec5SDimitry Andric// Include AMDGPU TD files
22910b57cec5SDimitry Andricinclude "SISchedule.td"
22920b57cec5SDimitry Andricinclude "GCNProcessors.td"
22930b57cec5SDimitry Andricinclude "AMDGPUInstrInfo.td"
22945ffd83dbSDimitry Andricinclude "SIRegisterInfo.td"
22950b57cec5SDimitry Andricinclude "AMDGPURegisterBanks.td"
22960b57cec5SDimitry Andricinclude "AMDGPUInstructions.td"
22970b57cec5SDimitry Andricinclude "SIInstrInfo.td"
22980b57cec5SDimitry Andricinclude "AMDGPUCallingConv.td"
22990b57cec5SDimitry Andricinclude "AMDGPUSearchableTables.td"
2300