From c82926e42c532b7c6089df6ffe0d52ef77038f90 Mon Sep 17 00:00:00 2001 From: Ivan Kosarev Date: Fri, 9 Aug 2024 13:28:57 +0100 Subject: [PATCH] [AMDGPU][AsmParser][NFCI] All NamedIntOperands to be of the i32 type. There's no need for them to have different types. Part of . --- llvm/lib/Target/AMDGPU/SIInstrInfo.td | 37 ++++++++++++------------ llvm/lib/Target/AMDGPU/SMInstructions.td | 4 +-- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.td b/llvm/lib/Target/AMDGPU/SIInstrInfo.td index b97256bc1ac78..e99b43afd1c3a 100644 --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.td +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.td @@ -1017,9 +1017,8 @@ def SDWAVopcDst : BoolRC { let PrintMethod = "printVOPDst"; } -class NamedIntOperand - : CustomOperand { +class NamedIntOperand + : CustomOperand { string Prefix = prefix; let PredicateMethod = @@ -1079,10 +1078,10 @@ class ArrayOperand0 let ImmTy = "ImmTyOffset" in def flat_offset : CustomOperand; let PrintMethod = "printOffset" in -def Offset : NamedIntOperand; +def Offset : NamedIntOperand<"offset">; let Validator = "isUInt<8>" in { -def Offset0 : NamedIntOperand; -def Offset1 : NamedIntOperand; +def Offset0 : NamedIntOperand<"offset0">; +def Offset1 : NamedIntOperand<"offset1">; } def gds : NamedBitOperand<"gds", "GDS">; @@ -1118,7 +1117,7 @@ def exp_vm : NamedBitOperand<"vm", "ExpVM">; def FORMAT : CustomOperand; let PrintInHex = 1 in -def DMask : NamedIntOperand; +def DMask : NamedIntOperand<"dmask">; def Dim : CustomOperand; @@ -1139,24 +1138,24 @@ def dpp8 : CustomOperand; def dpp_ctrl : CustomOperand; let DefaultValue = "0xf", PrintInHex = 1, AlwaysPrint = 1 in { -def DppRowMask : NamedIntOperand; -def DppBankMask : NamedIntOperand; +def DppRowMask : NamedIntOperand<"row_mask">; +def DppBankMask : NamedIntOperand<"bank_mask">; } -def DppBoundCtrl : NamedIntOperand { +def DppBoundCtrl : NamedIntOperand<"bound_ctrl"> { let ConvertMethod = "[this] (int64_t &BC) -> bool { return convertDppBoundCtrl(BC); }"; let PrintMethod = "printDppBoundCtrl"; } let DecoderMethod = "decodeDpp8FI", PrintMethod = "printDppFI" in -def Dpp8FI : NamedIntOperand; +def Dpp8FI : NamedIntOperand<"fi", 1, "DppFI">; let PrintMethod = "printDppFI" in -def Dpp16FI : NamedIntOperand; +def Dpp16FI : NamedIntOperand<"fi", 1, "DppFI">; def blgp : CustomOperand; -def CBSZ : NamedIntOperand { +def CBSZ : NamedIntOperand<"cbsz"> { let Validator = "isUInt<3>"; } -def ABID : NamedIntOperand { +def ABID : NamedIntOperand<"abid"> { let Validator = "isUInt<4>"; } def hwreg : CustomOperand; @@ -1164,21 +1163,21 @@ def hwreg : CustomOperand; def exp_tgt : CustomOperand; let AlwaysPrint = 1 in { -def WaitVDST : NamedIntOperand { +def WaitVDST : NamedIntOperand<"wait_vdst"> { let Validator = "isUInt<4>"; } -def WaitEXP : NamedIntOperand { +def WaitEXP : NamedIntOperand<"wait_exp"> { let Validator = "isUInt<3>"; } -def WaitVAVDst : NamedIntOperand { +def WaitVAVDst : NamedIntOperand<"wait_va_vdst"> { let Validator = "isUInt<4>"; } -def WaitVMVSrc : NamedIntOperand { +def WaitVMVSrc : NamedIntOperand<"wait_vm_vsrc"> { let Validator = "isUInt<1>"; } } // End AlwaysPrint = 1 -def ByteSel : NamedIntOperand { +def ByteSel : NamedIntOperand<"byte_sel"> { let Validator = "isUInt<2>"; } diff --git a/llvm/lib/Target/AMDGPU/SMInstructions.td b/llvm/lib/Target/AMDGPU/SMInstructions.td index 8cc963a6c1bb5..9fc570bb85f24 100644 --- a/llvm/lib/Target/AMDGPU/SMInstructions.td +++ b/llvm/lib/Target/AMDGPU/SMInstructions.td @@ -11,11 +11,11 @@ def smrd_offset_8 : ImmOperand; let EncoderMethod = "getSMEMOffsetEncoding", DecoderMethod = "decodeSMEMOffset" in { def SMEMOffset : ImmOperand; -def SMEMOffsetMod : NamedIntOperand { +def SMEMOffsetMod : NamedIntOperand<"offset", 0> { let AlwaysPrint = 1; let PrintInHex = 1; } -def OptSMEMOffsetMod : NamedIntOperand { +def OptSMEMOffsetMod : NamedIntOperand<"offset"> { let ImmTy = SMEMOffsetMod.ImmTy; let PredicateMethod = SMEMOffsetMod.PredicateMethod; let PrintMethod = SMEMOffsetMod.PrintMethod;