1 //===-- AMDGPU.td - AMDGPU Tablegen files --------*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===------------------------------------------------------------===//
9 include "llvm/TableGen/SearchableTable.td"
10 include "llvm/Target/Target.td"
11 include "AMDGPUFeatures.td"
13 def p0 : PtrValueType<i64, 0>;
14 def p1 : PtrValueType<i64, 1>;
15 def p2 : PtrValueType<i32, 2>;
16 def p3 : PtrValueType<i32, 3>;
17 def p4 : PtrValueType<i64, 4>;
18 def p5 : PtrValueType<i32, 5>;
19 def p6 : PtrValueType<i32, 6>;
22 class BoolToList<bit Value> {
23 list<int> ret = !if(Value, [1]<int>, []<int>);
26 //===------------------------------------------------------------===//
27 // Subtarget Features (device properties)
28 //===------------------------------------------------------------===//
30 def FeatureFastFMAF32 : SubtargetFeature<"fast-fmaf",
33 "Assuming f32 fma is at least as fast as mul + add"
36 def FeatureFastDenormalF32 : SubtargetFeature<"fast-denormal-f32",
39 "Enabling denormals does not cause f32 instructions to run at f64 rates"
42 def FeatureMIMG_R128 : SubtargetFeature<"mimg-r128",
45 "Support 128-bit texture resources"
48 def HalfRate64Ops : SubtargetFeature<"half-rate-64-ops",
51 "Most fp64 instructions are half rate instead of quarter"
54 def FullRate64Ops : SubtargetFeature<"full-rate-64-ops",
57 "Most fp64 instructions are full rate"
60 def FeatureFlatAddressSpace : SubtargetFeature<"flat-address-space",
63 "Support flat address space"
66 def FeatureFlatInstOffsets : SubtargetFeature<"flat-inst-offsets",
69 "Flat instructions have immediate offset addressing mode"
72 def FeatureFlatGlobalInsts : SubtargetFeature<"flat-global-insts",
75 "Have global_* flat memory instructions"
78 def FeatureFlatScratchInsts : SubtargetFeature<"flat-scratch-insts",
81 "Have scratch_* flat memory instructions"
84 def FeatureScalarFlatScratchInsts : SubtargetFeature<"scalar-flat-scratch-insts",
85 "ScalarFlatScratchInsts",
87 "Have s_scratch_* flat memory instructions"
90 def FeatureAddNoCarryInsts : SubtargetFeature<"add-no-carry-insts",
93 "Have VALU add/sub instructions without carry out"
96 def FeatureUnalignedBufferAccess : SubtargetFeature<"unaligned-buffer-access",
97 "UnalignedBufferAccess",
99 "Hardware supports unaligned global loads and stores"
102 def FeatureTrapHandler: SubtargetFeature<"trap-handler",
105 "Trap handler support"
108 def FeatureUnalignedScratchAccess : SubtargetFeature<"unaligned-scratch-access",
109 "UnalignedScratchAccess",
111 "Support unaligned scratch loads and stores"
114 def FeatureUnalignedDSAccess : SubtargetFeature<"unaligned-ds-access",
117 "Hardware supports unaligned local and region loads and stores"
120 def FeatureApertureRegs : SubtargetFeature<"aperture-regs",
123 "Has Memory Aperture Base and Size Registers"
126 def FeatureMadMixInsts : SubtargetFeature<"mad-mix-insts",
129 "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions"
132 def FeatureFmaMixInsts : SubtargetFeature<"fma-mix-insts",
135 "Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions"
138 def FeatureSupportsXNACK : SubtargetFeature<"xnack-support",
141 "Hardware supports XNACK"
144 // XNACK is disabled if SH_MEM_CONFIG.ADDRESS_MODE = GPUVM on chips that support
145 // XNACK. The current default kernel driver setting is:
146 // - graphics ring: XNACK disabled
147 // - compute ring: XNACK enabled
149 // If XNACK is enabled, the VMEM latency can be worse.
150 // If XNACK is disabled, the 2 SGPRs can be used for general purposes.
151 def FeatureXNACK : SubtargetFeature<"xnack",
154 "Enable XNACK support"
157 def FeatureTgSplit : SubtargetFeature<"tgsplit",
160 "Enable threadgroup split execution"
163 def FeatureCuMode : SubtargetFeature<"cumode",
166 "Enable CU wavefront execution mode"
169 def FeatureSGPRInitBug : SubtargetFeature<"sgpr-init-bug",
172 "VI SGPR initialization bug requiring a fixed SGPR allocation size"
175 def FeatureLdsMisalignedBug : SubtargetFeature<"lds-misaligned-bug",
178 "Some GFX10 bug with multi-dword LDS and flat access that is not naturally aligned in WGP mode"
181 def FeatureMFMAInlineLiteralBug : SubtargetFeature<"mfma-inline-literal-bug",
182 "HasMFMAInlineLiteralBug",
184 "MFMA cannot use inline literal as SrcC"
187 def FeatureVcmpxPermlaneHazard : SubtargetFeature<"vcmpx-permlane-hazard",
188 "HasVcmpxPermlaneHazard",
193 def FeatureVMEMtoScalarWriteHazard : SubtargetFeature<"vmem-to-scalar-write-hazard",
194 "HasVMEMtoScalarWriteHazard",
196 "VMEM instruction followed by scalar writing to EXEC mask, M0 or SGPR leads to incorrect execution."
199 def FeatureSMEMtoVectorWriteHazard : SubtargetFeature<"smem-to-vector-write-hazard",
200 "HasSMEMtoVectorWriteHazard",
202 "s_load_dword followed by v_cmp page faults"
205 def FeatureInstFwdPrefetchBug : SubtargetFeature<"inst-fwd-prefetch-bug",
206 "HasInstFwdPrefetchBug",
208 "S_INST_PREFETCH instruction causes shader to hang"
211 def FeatureVcmpxExecWARHazard : SubtargetFeature<"vcmpx-exec-war-hazard",
212 "HasVcmpxExecWARHazard",
214 "V_CMPX WAR hazard on EXEC (V_CMPX issue ONLY)"
217 def FeatureLdsBranchVmemWARHazard : SubtargetFeature<"lds-branch-vmem-war-hazard",
218 "HasLdsBranchVmemWARHazard",
220 "Switching between LDS and VMEM-tex not waiting VM_VSRC=0"
223 def FeatureNSAtoVMEMBug : SubtargetFeature<"nsa-to-vmem-bug",
226 "MIMG-NSA followed by VMEM fail if EXEC_LO or EXEC_HI equals zero"
229 def FeatureNSAClauseBug : SubtargetFeature<"nsa-clause-bug",
232 "MIMG-NSA in a hard clause has unpredictable results on GFX10.1"
235 def FeatureFlatSegmentOffsetBug : SubtargetFeature<"flat-segment-offset-bug",
236 "HasFlatSegmentOffsetBug",
238 "GFX10 bug where inst_offset is ignored when flat instructions access global memory"
241 def FeatureNegativeScratchOffsetBug : SubtargetFeature<"negative-scratch-offset-bug",
242 "NegativeScratchOffsetBug",
244 "Negative immediate offsets in scratch instructions with an SGPR offset page fault on GFX9"
247 def FeatureNegativeUnalignedScratchOffsetBug : SubtargetFeature<"negative-unaligned-scratch-offset-bug",
248 "NegativeUnalignedScratchOffsetBug",
250 "Scratch instructions with a VGPR offset and a negative immediate offset that is not a multiple of 4 read wrong memory on GFX10"
253 def FeatureOffset3fBug : SubtargetFeature<"offset-3f-bug",
256 "Branch offset of 3f hardware bug"
259 def FeatureImageStoreD16Bug : SubtargetFeature<"image-store-d16-bug",
260 "HasImageStoreD16Bug",
262 "Image Store D16 hardware bug"
265 def FeatureImageGather4D16Bug : SubtargetFeature<"image-gather4-d16-bug",
266 "HasImageGather4D16Bug",
268 "Image Gather4 D16 hardware bug"
271 class SubtargetFeatureLDSBankCount <int Value> : SubtargetFeature <
272 "ldsbankcount"#Value,
274 !cast<string>(Value),
275 "The number of LDS banks per compute unit."
278 def FeatureLDSBankCount16 : SubtargetFeatureLDSBankCount<16>;
279 def FeatureLDSBankCount32 : SubtargetFeatureLDSBankCount<32>;
281 def FeatureGCN3Encoding : SubtargetFeature<"gcn3-encoding",
284 "Encoding format for VI"
287 def FeatureCIInsts : SubtargetFeature<"ci-insts",
290 "Additional instructions for CI+"
293 def FeatureGFX8Insts : SubtargetFeature<"gfx8-insts",
296 "Additional instructions for GFX8+"
299 def FeatureGFX9Insts : SubtargetFeature<"gfx9-insts",
302 "Additional instructions for GFX9+"
305 def FeatureGFX90AInsts : SubtargetFeature<"gfx90a-insts",
308 "Additional instructions for GFX90A+"
311 def FeatureGFX10Insts : SubtargetFeature<"gfx10-insts",
314 "Additional instructions for GFX10+"
317 def FeatureGFX10_3Insts : SubtargetFeature<"gfx10-3-insts",
320 "Additional instructions for GFX10.3"
323 def FeatureGFX7GFX8GFX9Insts : SubtargetFeature<"gfx7-gfx8-gfx9-insts",
326 "Instructions shared in GFX7, GFX8, GFX9"
329 def FeatureSMemRealTime : SubtargetFeature<"s-memrealtime",
332 "Has s_memrealtime instruction"
335 def FeatureInv2PiInlineImm : SubtargetFeature<"inv-2pi-inline-imm",
336 "HasInv2PiInlineImm",
338 "Has 1 / (2 * pi) as inline immediate"
341 def Feature16BitInsts : SubtargetFeature<"16-bit-insts",
344 "Has i16/f16 instructions"
347 def FeatureVOP3P : SubtargetFeature<"vop3p",
350 "Has VOP3P packed instructions"
353 def FeatureMovrel : SubtargetFeature<"movrel",
356 "Has v_movrel*_b32 instructions"
359 def FeatureVGPRIndexMode : SubtargetFeature<"vgpr-index-mode",
362 "Has VGPR mode register indexing"
365 def FeatureScalarStores : SubtargetFeature<"scalar-stores",
368 "Has store scalar memory instructions"
371 def FeatureScalarAtomics : SubtargetFeature<"scalar-atomics",
374 "Has atomic scalar memory instructions"
377 def FeatureSDWA : SubtargetFeature<"sdwa",
380 "Support SDWA (Sub-DWORD Addressing) extension"
383 def FeatureSDWAOmod : SubtargetFeature<"sdwa-omod",
386 "Support OMod with SDWA (Sub-DWORD Addressing) extension"
389 def FeatureSDWAScalar : SubtargetFeature<"sdwa-scalar",
392 "Support scalar register with SDWA (Sub-DWORD Addressing) extension"
395 def FeatureSDWASdst : SubtargetFeature<"sdwa-sdst",
398 "Support scalar dst for VOPC with SDWA (Sub-DWORD Addressing) extension"
401 def FeatureSDWAMac : SubtargetFeature<"sdwa-mav",
404 "Support v_mac_f32/f16 with SDWA (Sub-DWORD Addressing) extension"
407 def FeatureSDWAOutModsVOPC : SubtargetFeature<"sdwa-out-mods-vopc",
408 "HasSDWAOutModsVOPC",
410 "Support clamp for VOPC with SDWA (Sub-DWORD Addressing) extension"
413 def FeatureDPP : SubtargetFeature<"dpp",
416 "Support DPP (Data Parallel Primitives) extension"
419 // DPP8 allows arbitrary cross-lane swizzling withing groups of 8 lanes.
420 def FeatureDPP8 : SubtargetFeature<"dpp8",
423 "Support DPP8 (Data Parallel Primitives) extension"
426 def Feature64BitDPP : SubtargetFeature<"dpp-64bit",
429 "Support DPP (Data Parallel Primitives) extension"
432 def FeaturePackedFP32Ops : SubtargetFeature<"packed-fp32-ops",
435 "Support packed fp32 instructions"
438 def FeatureR128A16 : SubtargetFeature<"r128-a16",
441 "Support gfx9-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands, where a16 is aliased with r128"
444 def FeatureGFX10A16 : SubtargetFeature<"a16",
447 "Support gfx10-style A16 for 16-bit coordinates/gradients/lod/clamp/mip image operands"
450 def FeatureG16 : SubtargetFeature<"g16",
453 "Support G16 for 16-bit gradient image operands"
456 def FeatureNSAEncoding : SubtargetFeature<"nsa-encoding",
459 "Support NSA encoding for image instructions"
462 def FeatureExtendedImageInsts : SubtargetFeature<"extended-image-insts",
463 "HasExtendedImageInsts",
465 "Support mips != 0, lod != 0, gather4, and get_lod"
468 def FeatureGFX10_AEncoding : SubtargetFeature<"gfx10_a-encoding",
471 "Has BVH ray tracing instructions"
474 def FeatureGFX10_BEncoding : SubtargetFeature<"gfx10_b-encoding",
477 "Encoding format GFX10_B"
480 def FeatureIntClamp : SubtargetFeature<"int-clamp-insts",
483 "Support clamp for integer destination"
486 def FeatureUnpackedD16VMem : SubtargetFeature<"unpacked-d16-vmem",
487 "HasUnpackedD16VMem",
489 "Has unpacked d16 vmem instructions"
492 def FeatureDLInsts : SubtargetFeature<"dl-insts",
495 "Has v_fmac_f32 and v_xnor_b32 instructions"
498 def FeatureDot1Insts : SubtargetFeature<"dot1-insts",
501 "Has v_dot4_i32_i8 and v_dot8_i32_i4 instructions"
504 def FeatureDot2Insts : SubtargetFeature<"dot2-insts",
507 "Has v_dot2_i32_i16, v_dot2_u32_u16 instructions"
510 def FeatureDot3Insts : SubtargetFeature<"dot3-insts",
513 "Has v_dot8c_i32_i4 instruction"
516 def FeatureDot4Insts : SubtargetFeature<"dot4-insts",
519 "Has v_dot2c_i32_i16 instruction"
522 def FeatureDot5Insts : SubtargetFeature<"dot5-insts",
525 "Has v_dot2c_f32_f16 instruction"
528 def FeatureDot6Insts : SubtargetFeature<"dot6-insts",
531 "Has v_dot4c_i32_i8 instruction"
534 def FeatureDot7Insts : SubtargetFeature<"dot7-insts",
537 "Has v_dot2_f32_f16, v_dot4_u32_u8, v_dot8_u32_u4 instructions"
540 def FeatureMAIInsts : SubtargetFeature<"mai-insts",
543 "Has mAI instructions"
546 def FeaturePkFmacF16Inst : SubtargetFeature<"pk-fmac-f16-inst",
549 "Has v_pk_fmac_f16 instruction"
552 def FeatureAtomicFaddInsts : SubtargetFeature<"atomic-fadd-insts",
553 "HasAtomicFaddInsts",
555 "Has buffer_atomic_add_f32, buffer_atomic_pk_add_f16, global_atomic_add_f32, "
556 "global_atomic_pk_add_f16 instructions",
557 [FeatureFlatGlobalInsts]
560 def FeatureSupportsSRAMECC : SubtargetFeature<"sramecc-support",
563 "Hardware supports SRAMECC"
566 def FeatureSRAMECC : SubtargetFeature<"sramecc",
572 def FeatureNoSdstCMPX : SubtargetFeature<"no-sdst-cmpx",
575 "V_CMPX does not write VCC/SGPR in addition to EXEC"
578 def FeatureVscnt : SubtargetFeature<"vscnt",
581 "Has separate store vscnt counter"
584 def FeatureGetWaveIdInst : SubtargetFeature<"get-wave-id-inst",
587 "Has s_get_waveid_in_workgroup instruction"
590 def FeatureSMemTimeInst : SubtargetFeature<"s-memtime-inst",
593 "Has s_memtime instruction"
596 def FeatureShaderCyclesRegister : SubtargetFeature<"shader-cycles-register",
597 "HasShaderCyclesRegister",
599 "Has SHADER_CYCLES hardware register"
602 def FeatureMadMacF32Insts : SubtargetFeature<"mad-mac-f32-insts",
605 "Has v_mad_f32/v_mac_f32/v_madak_f32/v_madmk_f32 instructions"
608 def FeatureDsSrc2Insts : SubtargetFeature<"ds-src2-insts",
611 "Has ds_*_src2 instructions"
614 def FeatureRegisterBanking : SubtargetFeature<"register-banking",
615 "HasRegisterBanking",
617 "Has register banking"
620 def FeatureVOP3Literal : SubtargetFeature<"vop3-literal",
623 "Can use one literal in VOP3"
626 def FeatureNoDataDepHazard : SubtargetFeature<"no-data-dep-hazard",
627 "HasNoDataDepHazard",
629 "Does not need SW waitstates"
632 class SubtargetFeatureNSAMaxSize <int Value> : SubtargetFeature <
633 "nsa-max-size-"#Value,
635 !cast<string>(Value),
636 "The maximum non-sequential address size in VGPRs."
639 def FeatureNSAMaxSize5 : SubtargetFeatureNSAMaxSize<5>;
640 def FeatureNSAMaxSize13 : SubtargetFeatureNSAMaxSize<13>;
642 //===------------------------------------------------------------===//
643 // Subtarget Features (options and debugging)
644 //===------------------------------------------------------------===//
646 class FeatureMaxPrivateElementSize<int size> : SubtargetFeature<
647 "max-private-element-size-"#size,
648 "MaxPrivateElementSize",
650 "Maximum private access size may be "#size
653 def FeatureMaxPrivateElementSize4 : FeatureMaxPrivateElementSize<4>;
654 def FeatureMaxPrivateElementSize8 : FeatureMaxPrivateElementSize<8>;
655 def FeatureMaxPrivateElementSize16 : FeatureMaxPrivateElementSize<16>;
657 def FeatureDumpCode : SubtargetFeature <"DumpCode",
660 "Dump MachineInstrs in the CodeEmitter"
663 def FeatureDumpCodeLower : SubtargetFeature <"dumpcode",
666 "Dump MachineInstrs in the CodeEmitter"
669 // XXX - This should probably be removed once enabled by default
670 def FeatureEnableLoadStoreOpt : SubtargetFeature <"load-store-opt",
671 "EnableLoadStoreOpt",
673 "Enable SI load/store optimizer pass"
676 // Performance debugging feature. Allow using DS instruction immediate
677 // offsets even if the base pointer can't be proven to be base. On SI,
678 // base pointer values that won't give the same result as a 16-bit add
679 // are not safe to fold, but this will override the conservative test
680 // for the base pointer.
681 def FeatureEnableUnsafeDSOffsetFolding : SubtargetFeature <
682 "unsafe-ds-offset-folding",
683 "EnableUnsafeDSOffsetFolding",
685 "Force using DS instruction immediate offsets on SI"
688 def FeatureEnableSIScheduler : SubtargetFeature<"si-scheduler",
691 "Enable SI Machine Scheduler"
694 def FeatureEnableDS128 : SubtargetFeature<"enable-ds128",
697 "Use ds_{read|write}_b128"
700 // Sparse texture support requires that all result registers are zeroed when
701 // PRTStrictNull is set to true. This feature is turned on for all architectures
702 // but is enabled as a feature in case there are situations where PRTStrictNull
703 // is disabled by the driver.
704 def FeatureEnablePRTStrictNull : SubtargetFeature<"enable-prt-strict-null",
705 "EnablePRTStrictNull",
707 "Enable zeroing of result registers for sparse texture fetches"
710 // Unless +-flat-for-global is specified, turn on FlatForGlobal for
711 // all OS-es on VI and newer hardware to avoid assertion failures due
712 // to missing ADDR64 variants of MUBUF instructions.
713 // FIXME: moveToVALU should be able to handle converting addr64 MUBUF
716 def FeatureFlatForGlobal : SubtargetFeature<"flat-for-global",
719 "Force to generate flat instruction for global"
722 def FeatureAutoWaitcntBeforeBarrier : SubtargetFeature <
723 "auto-waitcnt-before-barrier",
724 "AutoWaitcntBeforeBarrier",
726 "Hardware automatically inserts waitcnt before barrier"
729 def FeatureTrigReducedRange : SubtargetFeature<"trig-reduced-range",
730 "HasTrigReducedRange",
732 "Requires use of fract on arguments to trig instructions"
735 // Alignment enforcement is controlled by a configuration register:
736 // SH_MEM_CONFIG.alignment_mode
737 def FeatureUnalignedAccessMode : SubtargetFeature<"unaligned-access-mode",
738 "UnalignedAccessMode",
740 "Enable unaligned global, local and region loads and stores if the hardware"
744 def FeaturePackedTID : SubtargetFeature<"packed-tid",
747 "Workitem IDs are packed into v0 at kernel launch"
750 def FeatureArchitectedFlatScratch : SubtargetFeature<"architected-flat-scratch",
751 "HasArchitectedFlatScratch",
753 "Flat Scratch register is a readonly SPI initialized architected register"
756 // Dummy feature used to disable assembler instructions.
757 def FeatureDisable : SubtargetFeature<"",
758 "FeatureDisable","true",
759 "Dummy feature to disable assembler instructions"
762 class GCNSubtargetFeatureGeneration <string Value,
764 list<SubtargetFeature> Implies> :
765 SubtargetFeatureGeneration <Value, FeatureName, "GCNSubtarget", Implies>;
767 def FeatureSouthernIslands : GCNSubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
769 [FeatureFP64, FeatureLocalMemorySize32768, FeatureMIMG_R128,
770 FeatureWavefrontSize64, FeatureSMemTimeInst, FeatureMadMacF32Insts,
771 FeatureDsSrc2Insts, FeatureLDSBankCount32, FeatureMovrel,
772 FeatureTrigReducedRange, FeatureExtendedImageInsts
776 def FeatureSeaIslands : GCNSubtargetFeatureGeneration<"SEA_ISLANDS",
778 [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
779 FeatureWavefrontSize64, FeatureFlatAddressSpace,
780 FeatureCIInsts, FeatureMovrel, FeatureTrigReducedRange,
781 FeatureGFX7GFX8GFX9Insts, FeatureSMemTimeInst, FeatureMadMacF32Insts,
782 FeatureDsSrc2Insts, FeatureExtendedImageInsts, FeatureUnalignedBufferAccess
786 def FeatureVolcanicIslands : GCNSubtargetFeatureGeneration<"VOLCANIC_ISLANDS",
788 [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
789 FeatureWavefrontSize64, FeatureFlatAddressSpace,
790 FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
791 FeatureSMemRealTime, FeatureVGPRIndexMode, FeatureMovrel,
792 FeatureScalarStores, FeatureInv2PiInlineImm,
793 FeatureSDWA, FeatureSDWAOutModsVOPC, FeatureSDWAMac, FeatureDPP,
794 FeatureIntClamp, FeatureTrigReducedRange, FeatureGFX8Insts,
795 FeatureGFX7GFX8GFX9Insts, FeatureSMemTimeInst, FeatureMadMacF32Insts,
796 FeatureDsSrc2Insts, FeatureExtendedImageInsts, FeatureFastDenormalF32,
797 FeatureUnalignedBufferAccess
801 def FeatureGFX9 : GCNSubtargetFeatureGeneration<"GFX9",
803 [FeatureFP64, FeatureLocalMemorySize65536,
804 FeatureWavefrontSize64, FeatureFlatAddressSpace,
805 FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
806 FeatureSMemRealTime, FeatureScalarStores, FeatureInv2PiInlineImm,
807 FeatureApertureRegs, FeatureGFX9Insts, FeatureVOP3P, FeatureVGPRIndexMode,
808 FeatureFastFMAF32, FeatureDPP, FeatureIntClamp,
809 FeatureSDWA, FeatureSDWAOmod, FeatureSDWAScalar, FeatureSDWASdst,
810 FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
811 FeatureAddNoCarryInsts, FeatureGFX8Insts, FeatureGFX7GFX8GFX9Insts,
812 FeatureScalarFlatScratchInsts, FeatureScalarAtomics, FeatureR128A16,
813 FeatureSMemTimeInst, FeatureFastDenormalF32, FeatureSupportsXNACK,
814 FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess,
815 FeatureNegativeScratchOffsetBug
819 def FeatureGFX10 : GCNSubtargetFeatureGeneration<"GFX10",
821 [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
822 FeatureFlatAddressSpace,
823 FeatureCIInsts, Feature16BitInsts,
824 FeatureSMemRealTime, FeatureInv2PiInlineImm,
825 FeatureApertureRegs, FeatureGFX9Insts, FeatureGFX10Insts, FeatureVOP3P,
826 FeatureMovrel, FeatureFastFMAF32, FeatureDPP, FeatureIntClamp,
827 FeatureSDWA, FeatureSDWAOmod, FeatureSDWAScalar, FeatureSDWASdst,
828 FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
829 FeatureAddNoCarryInsts, FeatureFmaMixInsts, FeatureGFX8Insts,
830 FeatureNoSdstCMPX, FeatureVscnt, FeatureRegisterBanking,
831 FeatureVOP3Literal, FeatureDPP8, FeatureExtendedImageInsts,
832 FeatureNoDataDepHazard, FeaturePkFmacF16Inst,
833 FeatureGFX10A16, FeatureSMemTimeInst, FeatureFastDenormalF32, FeatureG16,
834 FeatureUnalignedBufferAccess, FeatureUnalignedDSAccess
838 class FeatureSet<list<SubtargetFeature> Features_> {
839 list<SubtargetFeature> Features = Features_;
842 def FeatureISAVersion6_0_0 : FeatureSet<[FeatureSouthernIslands,
845 FeatureLDSBankCount32]>;
847 def FeatureISAVersion6_0_1 : FeatureSet<
848 [FeatureSouthernIslands,
849 FeatureLDSBankCount32]>;
851 def FeatureISAVersion6_0_2 : FeatureSet<
852 [FeatureSouthernIslands,
853 FeatureLDSBankCount32]>;
855 def FeatureISAVersion7_0_0 : FeatureSet<
857 FeatureLDSBankCount32]>;
859 def FeatureISAVersion7_0_1 : FeatureSet<
862 FeatureLDSBankCount32,
865 def FeatureISAVersion7_0_2 : FeatureSet<
867 FeatureLDSBankCount16,
870 def FeatureISAVersion7_0_3 : FeatureSet<
872 FeatureLDSBankCount16]>;
874 def FeatureISAVersion7_0_4 : FeatureSet<
876 FeatureLDSBankCount32]>;
878 def FeatureISAVersion7_0_5 : FeatureSet<
880 FeatureLDSBankCount16]>;
882 def FeatureISAVersion8_0_1 : FeatureSet<
883 [FeatureVolcanicIslands,
886 FeatureLDSBankCount32,
887 FeatureSupportsXNACK,
888 FeatureUnpackedD16VMem]>;
890 def FeatureISAVersion8_0_2 : FeatureSet<
891 [FeatureVolcanicIslands,
892 FeatureLDSBankCount32,
894 FeatureUnpackedD16VMem]>;
896 def FeatureISAVersion8_0_3 : FeatureSet<
897 [FeatureVolcanicIslands,
898 FeatureLDSBankCount32,
899 FeatureUnpackedD16VMem]>;
901 def FeatureISAVersion8_0_5 : FeatureSet<
902 [FeatureVolcanicIslands,
903 FeatureLDSBankCount32,
905 FeatureUnpackedD16VMem]>;
907 def FeatureISAVersion8_1_0 : FeatureSet<
908 [FeatureVolcanicIslands,
909 FeatureLDSBankCount16,
910 FeatureSupportsXNACK,
911 FeatureImageStoreD16Bug,
912 FeatureImageGather4D16Bug]>;
914 def FeatureISAVersion9_0_0 : FeatureSet<
917 FeatureLDSBankCount32,
919 FeatureExtendedImageInsts,
920 FeatureMadMacF32Insts,
921 FeatureImageGather4D16Bug]>;
923 def FeatureISAVersion9_0_2 : FeatureSet<
926 FeatureLDSBankCount32,
928 FeatureExtendedImageInsts,
929 FeatureMadMacF32Insts,
930 FeatureImageGather4D16Bug]>;
932 def FeatureISAVersion9_0_4 : FeatureSet<
934 FeatureLDSBankCount32,
936 FeatureExtendedImageInsts,
937 FeatureMadMacF32Insts,
939 FeatureImageGather4D16Bug]>;
941 def FeatureISAVersion9_0_6 : FeatureSet<
945 FeatureLDSBankCount32,
947 FeatureExtendedImageInsts,
948 FeatureMadMacF32Insts,
953 FeatureSupportsSRAMECC,
954 FeatureImageGather4D16Bug]>;
956 def FeatureISAVersion9_0_8 : FeatureSet<
960 FeatureLDSBankCount32,
962 FeatureExtendedImageInsts,
963 FeatureMadMacF32Insts,
973 FeaturePkFmacF16Inst,
974 FeatureAtomicFaddInsts,
975 FeatureSupportsSRAMECC,
976 FeatureMFMAInlineLiteralBug,
977 FeatureImageGather4D16Bug]>;
979 def FeatureISAVersion9_0_9 : FeatureSet<
982 FeatureLDSBankCount32,
984 FeatureExtendedImageInsts,
985 FeatureMadMacF32Insts,
986 FeatureImageGather4D16Bug]>;
988 def FeatureISAVersion9_0_A : FeatureSet<
992 FeatureLDSBankCount32,
1002 FeaturePackedFP32Ops,
1004 FeaturePkFmacF16Inst,
1005 FeatureAtomicFaddInsts,
1006 FeatureMadMacF32Insts,
1007 FeatureSupportsSRAMECC,
1011 def FeatureISAVersion9_0_C : FeatureSet<
1014 FeatureLDSBankCount32,
1016 FeatureExtendedImageInsts,
1017 FeatureMadMacF32Insts,
1018 FeatureImageGather4D16Bug]>;
1020 // TODO: Organize more features into groups.
1022 // Bugs present on gfx10.1.
1023 list<SubtargetFeature> GFX10_1_Bugs = [
1024 FeatureVcmpxPermlaneHazard,
1025 FeatureVMEMtoScalarWriteHazard,
1026 FeatureSMEMtoVectorWriteHazard,
1027 FeatureInstFwdPrefetchBug,
1028 FeatureVcmpxExecWARHazard,
1029 FeatureLdsBranchVmemWARHazard,
1030 FeatureNSAtoVMEMBug,
1031 FeatureNSAClauseBug,
1033 FeatureFlatSegmentOffsetBug,
1034 FeatureNegativeUnalignedScratchOffsetBug
1038 def FeatureISAVersion10_1_0 : FeatureSet<
1039 !listconcat(FeatureGroup.GFX10_1_Bugs,
1041 FeatureLDSBankCount32,
1045 FeatureWavefrontSize32,
1046 FeatureScalarStores,
1047 FeatureScalarAtomics,
1048 FeatureScalarFlatScratchInsts,
1049 FeatureGetWaveIdInst,
1050 FeatureMadMacF32Insts,
1052 FeatureLdsMisalignedBug,
1053 FeatureSupportsXNACK])>;
1055 def FeatureISAVersion10_1_1 : FeatureSet<
1056 !listconcat(FeatureGroup.GFX10_1_Bugs,
1058 FeatureLDSBankCount32,
1067 FeatureWavefrontSize32,
1068 FeatureScalarStores,
1069 FeatureScalarAtomics,
1070 FeatureScalarFlatScratchInsts,
1071 FeatureGetWaveIdInst,
1072 FeatureMadMacF32Insts,
1074 FeatureLdsMisalignedBug,
1075 FeatureSupportsXNACK])>;
1077 def FeatureISAVersion10_1_2 : FeatureSet<
1078 !listconcat(FeatureGroup.GFX10_1_Bugs,
1080 FeatureLDSBankCount32,
1089 FeatureWavefrontSize32,
1090 FeatureScalarStores,
1091 FeatureScalarAtomics,
1092 FeatureScalarFlatScratchInsts,
1093 FeatureGetWaveIdInst,
1094 FeatureMadMacF32Insts,
1096 FeatureLdsMisalignedBug,
1097 FeatureSupportsXNACK])>;
1099 def FeatureISAVersion10_1_3 : FeatureSet<
1100 !listconcat(FeatureGroup.GFX10_1_Bugs,
1102 FeatureGFX10_AEncoding,
1103 FeatureLDSBankCount32,
1107 FeatureWavefrontSize32,
1108 FeatureScalarStores,
1109 FeatureScalarAtomics,
1110 FeatureScalarFlatScratchInsts,
1111 FeatureGetWaveIdInst,
1112 FeatureMadMacF32Insts,
1114 FeatureLdsMisalignedBug,
1115 FeatureSupportsXNACK])>;
1117 def FeatureISAVersion10_3_0 : FeatureSet<
1119 FeatureGFX10_AEncoding,
1120 FeatureGFX10_BEncoding,
1121 FeatureGFX10_3Insts,
1122 FeatureLDSBankCount32,
1130 FeatureNSAMaxSize13,
1131 FeatureWavefrontSize32,
1132 FeatureShaderCyclesRegister]>;
1134 //===----------------------------------------------------------------------===//
1136 def AMDGPUInstrInfo : InstrInfo {
1137 let guessInstructionProperties = 1;
1138 let noNamedPositionallyEncodedOperands = 1;
1141 def AMDGPUAsmParser : AsmParser {
1142 // Some of the R600 registers have the same name, so this crashes.
1143 // For example T0_XYZW and T0_XY both have the asm name T0.
1144 let ShouldEmitMatchRegisterName = 0;
1147 def AMDGPUAsmWriter : AsmWriter {
1148 int PassSubtarget = 1;
1151 def AMDGPUAsmVariants {
1152 string Default = "Default";
1154 string VOP3 = "VOP3";
1156 string SDWA = "SDWA";
1158 string SDWA9 = "SDWA9";
1162 string Disable = "Disable";
1166 def DefaultAMDGPUAsmParserVariant : AsmParserVariant {
1167 let Variant = AMDGPUAsmVariants.Default_ID;
1168 let Name = AMDGPUAsmVariants.Default;
1171 def VOP3AsmParserVariant : AsmParserVariant {
1172 let Variant = AMDGPUAsmVariants.VOP3_ID;
1173 let Name = AMDGPUAsmVariants.VOP3;
1176 def SDWAAsmParserVariant : AsmParserVariant {
1177 let Variant = AMDGPUAsmVariants.SDWA_ID;
1178 let Name = AMDGPUAsmVariants.SDWA;
1181 def SDWA9AsmParserVariant : AsmParserVariant {
1182 let Variant = AMDGPUAsmVariants.SDWA9_ID;
1183 let Name = AMDGPUAsmVariants.SDWA9;
1187 def DPPAsmParserVariant : AsmParserVariant {
1188 let Variant = AMDGPUAsmVariants.DPP_ID;
1189 let Name = AMDGPUAsmVariants.DPP;
1192 def AMDGPU : Target {
1193 // Pull in Instruction Info:
1194 let InstructionSet = AMDGPUInstrInfo;
1195 let AssemblyParsers = [AMDGPUAsmParser];
1196 let AssemblyParserVariants = [DefaultAMDGPUAsmParserVariant,
1197 VOP3AsmParserVariant,
1198 SDWAAsmParserVariant,
1199 SDWA9AsmParserVariant,
1200 DPPAsmParserVariant];
1201 let AssemblyWriters = [AMDGPUAsmWriter];
1202 let AllowRegisterRenaming = 1;
1205 // Dummy Instruction itineraries for pseudo instructions
1206 def ALU_NULL : FuncUnit;
1207 def NullALU : InstrItinClass;
1209 //===----------------------------------------------------------------------===//
1210 // Predicate helper class
1211 //===----------------------------------------------------------------------===//
1214 Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS">,
1215 AssemblerPredicate<(all_of FeatureSouthernIslands)>;
1218 Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
1219 "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS">,
1220 AssemblerPredicate<(all_of (not FeatureGCN3Encoding), (not FeatureGFX10Insts))>;
1222 def isGFX6GFX7GFX10 :
1223 Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
1224 "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
1225 "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
1226 AssemblerPredicate<(all_of (not FeatureGCN3Encoding))>;
1229 Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS">,
1230 AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureCIInsts, (not FeatureGFX10Insts))>;
1233 Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
1234 "Subtarget->getGeneration() == AMDGPUSubtarget::GFX10">,
1235 AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureCIInsts)>;
1237 def isGFX7GFX8GFX9 :
1238 Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
1239 "Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1240 "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
1241 AssemblerPredicate<(all_of FeatureGFX7GFX8GFX9Insts)>;
1243 def isGFX6GFX7GFX8GFX9 :
1244 Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
1245 "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
1246 "Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1247 "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
1248 AssemblerPredicate<(all_of (not FeatureGFX10Insts))>;
1250 def isGFX6GFX7GFX8GFX9NotGFX90A :
1251 Predicate<"!Subtarget->hasGFX90AInsts() &&"
1252 "(Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
1253 " Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS ||"
1254 " Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1255 " Subtarget->getGeneration() == AMDGPUSubtarget::GFX9)">,
1256 AssemblerPredicate<(all_of (not FeatureGFX10Insts), (not FeatureGFX90AInsts))>;
1259 Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::SEA_ISLANDS">,
1260 AssemblerPredicate<(all_of FeatureCIInsts)>;
1263 Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS">,
1264 AssemblerPredicate<(all_of FeatureGFX8Insts)>;
1266 def isGFX8Only : Predicate<"Subtarget->getGeneration() =="
1267 "AMDGPUSubtarget::VOLCANIC_ISLANDS">,
1268 AssemblerPredicate <(all_of FeatureVolcanicIslands)>;
1271 Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
1272 AssemblerPredicate<(all_of FeatureGFX9Insts)>;
1274 def isGFX9Only : Predicate <
1275 "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
1276 AssemblerPredicate<(all_of FeatureGCN3Encoding, FeatureGFX9Insts)>;
1278 def isGCN3ExcludingGFX90A :
1279 Predicate<"Subtarget->isGCN3Encoding() && !Subtarget->hasGFX90AInsts()">,
1280 AssemblerPredicate<(all_of FeatureGCN3Encoding, (not FeatureGFX90AInsts))>;
1283 Predicate<"Subtarget->hasGFX90AInsts()">,
1284 AssemblerPredicate<(all_of FeatureGFX90AInsts)>;
1286 def isNotGFX90APlus :
1287 Predicate<"!Subtarget->hasGFX90AInsts()">,
1288 AssemblerPredicate<(all_of (not FeatureGFX90AInsts))>;
1290 def isGFX8GFX9NotGFX90A :
1291 Predicate<"!Subtarget->hasGFX90AInsts() &&"
1292 "(Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1293 " Subtarget->getGeneration() == AMDGPUSubtarget::GFX9)">,
1294 AssemblerPredicate<(all_of FeatureGFX8Insts, FeatureGCN3Encoding, (not FeatureGFX90AInsts))>;
1297 Predicate<"Subtarget->hasGFX90AInsts()">,
1298 AssemblerPredicate<(all_of FeatureGFX90AInsts)>;
1300 def isGFX908orGFX90A :
1301 Predicate<"Subtarget->hasMAIInsts()">,
1302 AssemblerPredicate<(all_of FeatureMAIInsts)>;
1305 Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS ||"
1306 "Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
1307 AssemblerPredicate<(all_of FeatureGFX8Insts, FeatureGCN3Encoding)>;
1310 Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX10">,
1311 AssemblerPredicate<(all_of FeatureGFX10Insts)>;
1313 def isGFX10Before1030 :
1314 Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::GFX10 &&"
1315 "!Subtarget->hasGFX10_3Insts()">,
1316 AssemblerPredicate<(all_of FeatureGFX10Insts,(not FeatureGFX10_3Insts))>;
1318 def HasFlatAddressSpace : Predicate<"Subtarget->hasFlatAddressSpace()">,
1319 AssemblerPredicate<(all_of FeatureFlatAddressSpace)>;
1321 def HasFlatGlobalInsts : Predicate<"Subtarget->hasFlatGlobalInsts()">,
1322 AssemblerPredicate<(all_of FeatureFlatGlobalInsts)>;
1323 def HasFlatScratchInsts : Predicate<"Subtarget->hasFlatScratchInsts()">,
1324 AssemblerPredicate<(all_of FeatureFlatScratchInsts)>;
1325 def HasScalarFlatScratchInsts : Predicate<"Subtarget->hasScalarFlatScratchInsts()">,
1326 AssemblerPredicate<(all_of FeatureScalarFlatScratchInsts)>;
1327 def HasD16LoadStore : Predicate<"Subtarget->hasD16LoadStore()">,
1328 AssemblerPredicate<(all_of FeatureGFX9Insts)>;
1330 def HasFlatScratchSTMode : Predicate<"Subtarget->hasFlatScratchSTMode()">,
1331 AssemblerPredicate<(any_of FeatureGFX10_3Insts)>;
1333 def HasGFX10_AEncoding : Predicate<"Subtarget->hasGFX10_AEncoding()">,
1334 AssemblerPredicate<(all_of FeatureGFX10_AEncoding)>;
1336 def HasGFX10_BEncoding : Predicate<"Subtarget->hasGFX10_BEncoding()">,
1337 AssemblerPredicate<(all_of FeatureGFX10_BEncoding)>;
1339 def HasUnpackedD16VMem : Predicate<"Subtarget->hasUnpackedD16VMem()">,
1340 AssemblerPredicate<(all_of FeatureUnpackedD16VMem)>;
1341 def HasPackedD16VMem : Predicate<"!Subtarget->hasUnpackedD16VMem()">,
1342 AssemblerPredicate<(all_of (not FeatureUnpackedD16VMem))>;
1344 def D16PreservesUnusedBits :
1345 Predicate<"Subtarget->d16PreservesUnusedBits()">,
1346 AssemblerPredicate<(all_of FeatureGFX9Insts, (not FeatureSRAMECC))>;
1348 def LDSRequiresM0Init : Predicate<"Subtarget->ldsRequiresM0Init()">;
1349 def NotLDSRequiresM0Init : Predicate<"!Subtarget->ldsRequiresM0Init()">;
1351 def HasDSAddTid : Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
1352 AssemblerPredicate<(all_of FeatureGFX9Insts)>;
1354 def HasLDSFPAtomics : Predicate<"Subtarget->hasLDSFPAtomics()">,
1355 AssemblerPredicate<(all_of FeatureGFX8Insts)>;
1357 def HasAddNoCarryInsts : Predicate<"Subtarget->hasAddNoCarry()">,
1358 AssemblerPredicate<(all_of FeatureAddNoCarryInsts)>;
1360 def NotHasAddNoCarryInsts : Predicate<"!Subtarget->hasAddNoCarry()">;
1362 def Has16BitInsts : Predicate<"Subtarget->has16BitInsts()">,
1363 AssemblerPredicate<(all_of Feature16BitInsts)>;
1364 def HasVOP3PInsts : Predicate<"Subtarget->hasVOP3PInsts()">,
1365 AssemblerPredicate<(all_of FeatureVOP3P)>;
1367 def HasMinMaxDenormModes : Predicate<"Subtarget->supportsMinMaxDenormModes()">;
1368 def NotHasMinMaxDenormModes : Predicate<"!Subtarget->supportsMinMaxDenormModes()">;
1370 def HasSDWA : Predicate<"Subtarget->hasSDWA()">,
1371 AssemblerPredicate<(all_of FeatureSDWA, FeatureVolcanicIslands)>;
1374 Predicate<"Subtarget->hasSDWA()">,
1375 AssemblerPredicate<(all_of FeatureGCN3Encoding, FeatureGFX9Insts,FeatureSDWA)>;
1378 Predicate<"Subtarget->hasSDWA()">,
1379 AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureGFX10Insts, FeatureSDWA)>;
1381 def HasDPP : Predicate<"Subtarget->hasDPP()">,
1382 AssemblerPredicate<(all_of FeatureGCN3Encoding, FeatureDPP)>;
1384 def HasDPP8 : Predicate<"Subtarget->hasDPP8()">,
1385 AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureGFX10Insts, FeatureDPP8)>;
1387 def Has64BitDPP : Predicate<"Subtarget->has64BitDPP()">,
1388 AssemblerPredicate<(all_of Feature64BitDPP)>;
1390 def HasPackedFP32Ops : Predicate<"Subtarget->hasPackedFP32Ops()">,
1391 AssemblerPredicate<(all_of FeaturePackedFP32Ops)>;
1393 def HasFmaakFmamkF32Insts :
1394 Predicate<"Subtarget->hasFmaakFmamkF32Insts()">,
1395 AssemblerPredicate<(any_of FeatureGFX10Insts)>;
1397 def HasExtendedImageInsts : Predicate<"Subtarget->hasExtendedImageInsts()">,
1398 AssemblerPredicate<(all_of FeatureExtendedImageInsts)>;
1400 def HasR128A16 : Predicate<"Subtarget->hasR128A16()">,
1401 AssemblerPredicate<(all_of FeatureR128A16)>;
1403 def HasGFX10A16 : Predicate<"Subtarget->hasGFX10A16()">,
1404 AssemblerPredicate<(all_of FeatureGFX10A16)>;
1406 def HasG16 : Predicate<"Subtarget->hasG16()">,
1407 AssemblerPredicate<(all_of FeatureG16)>;
1409 def HasDPP16 : Predicate<"Subtarget->hasDPP()">,
1410 AssemblerPredicate<(all_of (not FeatureGCN3Encoding), FeatureGFX10Insts, FeatureDPP)>;
1412 def HasIntClamp : Predicate<"Subtarget->hasIntClamp()">,
1413 AssemblerPredicate<(all_of FeatureIntClamp)>;
1415 def HasMadMixInsts : Predicate<"Subtarget->hasMadMixInsts()">,
1416 AssemblerPredicate<(all_of FeatureMadMixInsts)>;
1418 def HasScalarStores : Predicate<"Subtarget->hasScalarStores()">,
1419 AssemblerPredicate<(all_of FeatureScalarStores)>;
1421 def HasScalarAtomics : Predicate<"Subtarget->hasScalarAtomics()">,
1422 AssemblerPredicate<(all_of FeatureScalarAtomics)>;
1424 def HasNoSdstCMPX : Predicate<"Subtarget->hasNoSdstCMPX()">,
1425 AssemblerPredicate<(all_of FeatureNoSdstCMPX)>;
1427 def HasSdstCMPX : Predicate<"!Subtarget->hasNoSdstCMPX()">,
1428 AssemblerPredicate<(all_of (not FeatureNoSdstCMPX))>;
1430 def has16BankLDS : Predicate<"Subtarget->getLDSBankCount() == 16">;
1431 def has32BankLDS : Predicate<"Subtarget->getLDSBankCount() == 32">;
1432 def HasVGPRIndexMode : Predicate<"Subtarget->hasVGPRIndexMode()">,
1433 AssemblerPredicate<(all_of FeatureVGPRIndexMode)>;
1434 def HasMovrel : Predicate<"Subtarget->hasMovrel()">,
1435 AssemblerPredicate<(all_of FeatureMovrel)>;
1437 def HasFmaMixInsts : Predicate<"Subtarget->hasFmaMixInsts()">,
1438 AssemblerPredicate<(all_of FeatureFmaMixInsts)>;
1440 def HasDLInsts : Predicate<"Subtarget->hasDLInsts()">,
1441 AssemblerPredicate<(all_of FeatureDLInsts)>;
1443 def HasDot1Insts : Predicate<"Subtarget->hasDot1Insts()">,
1444 AssemblerPredicate<(all_of FeatureDot1Insts)>;
1446 def HasDot2Insts : Predicate<"Subtarget->hasDot2Insts()">,
1447 AssemblerPredicate<(all_of FeatureDot2Insts)>;
1449 def HasDot3Insts : Predicate<"Subtarget->hasDot3Insts()">,
1450 AssemblerPredicate<(all_of FeatureDot3Insts)>;
1452 def HasDot4Insts : Predicate<"Subtarget->hasDot4Insts()">,
1453 AssemblerPredicate<(all_of FeatureDot4Insts)>;
1455 def HasDot5Insts : Predicate<"Subtarget->hasDot5Insts()">,
1456 AssemblerPredicate<(all_of FeatureDot5Insts)>;
1458 def HasDot6Insts : Predicate<"Subtarget->hasDot6Insts()">,
1459 AssemblerPredicate<(all_of FeatureDot6Insts)>;
1461 def HasDot7Insts : Predicate<"Subtarget->hasDot7Insts()">,
1462 AssemblerPredicate<(all_of FeatureDot7Insts)>;
1464 def HasGetWaveIdInst : Predicate<"Subtarget->hasGetWaveIdInst()">,
1465 AssemblerPredicate<(all_of FeatureGetWaveIdInst)>;
1467 def HasMAIInsts : Predicate<"Subtarget->hasMAIInsts()">,
1468 AssemblerPredicate<(all_of FeatureMAIInsts)>;
1470 def HasSMemRealTime : Predicate<"Subtarget->hasSMemRealTime()">,
1471 AssemblerPredicate<(all_of FeatureSMemRealTime)>;
1473 def HasSMemTimeInst : Predicate<"Subtarget->hasSMemTimeInst()">,
1474 AssemblerPredicate<(all_of FeatureSMemTimeInst)>;
1476 def HasShaderCyclesRegister : Predicate<"Subtarget->hasShaderCyclesRegister()">,
1477 AssemblerPredicate<(all_of FeatureShaderCyclesRegister)>;
1479 def HasPkFmacF16Inst : Predicate<"Subtarget->hasPkFmacF16Inst()">,
1480 AssemblerPredicate<(all_of FeaturePkFmacF16Inst)>;
1482 def HasMadMacF32Insts : Predicate<"Subtarget->hasMadMacF32Insts()">,
1483 AssemblerPredicate<(all_of FeatureMadMacF32Insts)>;
1485 def HasFmaLegacy32 : Predicate<"Subtarget->hasGFX10_3Insts()">,
1486 AssemblerPredicate<(any_of FeatureGFX10_3Insts)>;
1488 def HasAtomicFaddInsts : Predicate<"Subtarget->hasAtomicFaddInsts()">,
1489 AssemblerPredicate<(all_of FeatureAtomicFaddInsts)>;
1491 def HasDsSrc2Insts : Predicate<"!Subtarget->hasDsSrc2Insts()">,
1492 AssemblerPredicate<(all_of FeatureDsSrc2Insts)>;
1494 def EnableLateCFGStructurize : Predicate<
1495 "EnableLateStructurizeCFG">;
1497 def EnableFlatScratch : Predicate<"Subtarget->enableFlatScratch()">;
1499 def DisableFlatScratch : Predicate<"!Subtarget->enableFlatScratch()">;
1501 def HasUnalignedAccessMode : Predicate<"Subtarget->hasUnalignedAccessMode()">,
1502 AssemblerPredicate<(all_of FeatureUnalignedAccessMode)>;
1504 // Include AMDGPU TD files
1505 include "SISchedule.td"
1506 include "GCNProcessors.td"
1507 include "AMDGPUInstrInfo.td"
1508 include "SIRegisterInfo.td"
1509 include "AMDGPURegisterBanks.td"
1510 include "AMDGPUInstructions.td"
1511 include "SIInstrInfo.td"
1512 include "AMDGPUCallingConv.td"
1513 include "AMDGPUSearchableTables.td"