diff --git a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp index 8e18c5794bc26..894607dfdd8c4 100644 --- a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp +++ b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp @@ -457,8 +457,6 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size, ArrayRef Bytes_, uint64_t Address, raw_ostream &CS) const { - bool IsSDWA = false; - unsigned MaxInstBytesNum = std::min((size_t)TargetMaxInstBytes, Bytes_.size()); Bytes = Bytes_.slice(0, MaxInstBytesNum); @@ -572,15 +570,6 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size, break; } - Res = tryDecodeInst(DecoderTableSDWA64, MI, QW, Address, CS); - if (Res) { IsSDWA = true; break; } - - Res = tryDecodeInst(DecoderTableSDWA964, MI, QW, Address, CS); - if (Res) { IsSDWA = true; break; } - - Res = tryDecodeInst(DecoderTableSDWA1064, MI, QW, Address, CS); - if (Res) { IsSDWA = true; break; } - if (STI.hasFeature(AMDGPU::FeatureUnpackedD16VMem)) { Res = tryDecodeInst(DecoderTableGFX80_UNPACKED64, MI, QW, Address, CS); if (Res) @@ -771,7 +760,7 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size, if (Res && (MCII->get(MI.getOpcode()).TSFlags & SIInstrFlags::VINTERP)) Res = convertVINTERPInst(MI); - if (Res && IsSDWA) + if (Res && (MCII->get(MI.getOpcode()).TSFlags & SIInstrFlags::SDWA)) Res = convertSDWAInst(MI); int VDstIn_Idx = AMDGPU::getNamedOperandIdx(MI.getOpcode(), diff --git a/llvm/lib/Target/AMDGPU/VOP1Instructions.td b/llvm/lib/Target/AMDGPU/VOP1Instructions.td index dcd290c0e3e12..0d4057b3ddd10 100644 --- a/llvm/lib/Target/AMDGPU/VOP1Instructions.td +++ b/llvm/lib/Target/AMDGPU/VOP1Instructions.td @@ -985,15 +985,11 @@ let AssemblerPredicate = isGFX10Only, DecoderNamespace = "GFX10" in { if !cast(NAME#"_e32").Pfl.HasExtSDWA9 then def _sdwa_gfx10 : VOP_SDWA10_Real(NAME#"_sdwa")>, - VOP1_SDWA9Ae(NAME#"_sdwa").Pfl> { - let DecoderNamespace = "SDWA10"; - } + VOP1_SDWA9Ae(NAME#"_sdwa").Pfl>; } multiclass VOP1_Real_dpp_gfx10 op> { if !cast(NAME#"_e32").Pfl.HasExt32BitDPP then - def _dpp_gfx10 : VOP1_DPP16(NAME#"_dpp"), SIEncodingFamily.GFX10> { - let DecoderNamespace = "SDWA10"; - } + def _dpp_gfx10 : VOP1_DPP16(NAME#"_dpp"), SIEncodingFamily.GFX10>; } multiclass VOP1_Real_dpp8_gfx10 op> { if !cast(NAME#"_e32").Pfl.HasExt32BitDPP then diff --git a/llvm/lib/Target/AMDGPU/VOP2Instructions.td b/llvm/lib/Target/AMDGPU/VOP2Instructions.td index eba9bf64884ec..4437d5f2a0333 100644 --- a/llvm/lib/Target/AMDGPU/VOP2Instructions.td +++ b/llvm/lib/Target/AMDGPU/VOP2Instructions.td @@ -1740,15 +1740,11 @@ let AssemblerPredicate = isGFX10Only, DecoderNamespace = "GFX10" in { if !cast(NAME#"_e32").Pfl.HasExtSDWA9 then def _sdwa_gfx10 : VOP_SDWA10_Real(NAME#"_sdwa")>, - VOP2_SDWA9Ae(NAME#"_sdwa").Pfl> { - let DecoderNamespace = "SDWA10"; - } + VOP2_SDWA9Ae(NAME#"_sdwa").Pfl>; } multiclass VOP2_Real_dpp_gfx10 op> { if !cast(NAME#"_e32").Pfl.HasExt32BitDPP then - def _dpp_gfx10 : VOP2_DPP16(NAME#"_dpp"), SIEncodingFamily.GFX10> { - let DecoderNamespace = "SDWA10"; - } + def _dpp_gfx10 : VOP2_DPP16(NAME#"_dpp"), SIEncodingFamily.GFX10>; } multiclass VOP2_Real_dpp8_gfx10 op> { if !cast(NAME#"_e32").Pfl.HasExt32BitDPP then @@ -1777,35 +1773,33 @@ let AssemblerPredicate = isGFX10Only, DecoderNamespace = "GFX10" in { let AsmString = asmName # ps.AsmOperands; } } - let DecoderNamespace = "SDWA10" in { - multiclass VOP2_Real_sdwa_gfx10_with_name op, string opName, - string asmName> { - if !cast(opName#"_e32").Pfl.HasExtSDWA9 then - def _sdwa_gfx10 : - VOP_SDWA10_Real(opName#"_sdwa")>, - VOP2_SDWA9Ae(opName#"_sdwa").Pfl> { - VOP2_SDWA_Pseudo ps = !cast(opName#"_sdwa"); - let AsmString = asmName # ps.AsmOperands; - } - } - multiclass VOP2_Real_dpp_gfx10_with_name op, string opName, - string asmName> { - if !cast(opName#"_e32").Pfl.HasExt32BitDPP then - def _dpp_gfx10 : VOP2_DPP16(opName#"_dpp"), SIEncodingFamily.GFX10> { - VOP2_Pseudo ps = !cast(opName#"_e32"); - let AsmString = asmName # ps.Pfl.AsmDPP16; + multiclass VOP2_Real_sdwa_gfx10_with_name op, string opName, + string asmName> { + if !cast(opName#"_e32").Pfl.HasExtSDWA9 then + def _sdwa_gfx10 : + VOP_SDWA10_Real(opName#"_sdwa")>, + VOP2_SDWA9Ae(opName#"_sdwa").Pfl> { + VOP2_SDWA_Pseudo ps = !cast(opName#"_sdwa"); + let AsmString = asmName # ps.AsmOperands; } + } + multiclass VOP2_Real_dpp_gfx10_with_name op, string opName, + string asmName> { + if !cast(opName#"_e32").Pfl.HasExt32BitDPP then + def _dpp_gfx10 : VOP2_DPP16(opName#"_dpp"), SIEncodingFamily.GFX10> { + VOP2_Pseudo ps = !cast(opName#"_e32"); + let AsmString = asmName # ps.Pfl.AsmDPP16; } - multiclass VOP2_Real_dpp8_gfx10_with_name op, string opName, - string asmName> { - if !cast(opName#"_e32").Pfl.HasExt32BitDPP then - def _dpp8_gfx10 : VOP2_DPP8(opName#"_e32")> { - VOP2_Pseudo ps = !cast(opName#"_e32"); - let AsmString = asmName # ps.Pfl.AsmDPP8; - let DecoderNamespace = "DPP8"; - } + } + multiclass VOP2_Real_dpp8_gfx10_with_name op, string opName, + string asmName> { + if !cast(opName#"_e32").Pfl.HasExt32BitDPP then + def _dpp8_gfx10 : VOP2_DPP8(opName#"_e32")> { + VOP2_Pseudo ps = !cast(opName#"_e32"); + let AsmString = asmName # ps.Pfl.AsmDPP8; + let DecoderNamespace = "DPP8"; } - } // End DecoderNamespace = "SDWA10" + } //===------------------------------ VOP2be ------------------------------===// multiclass VOP2be_Real_e32_gfx10 op, string opName, string asmName> { @@ -1832,7 +1826,6 @@ let AssemblerPredicate = isGFX10Only, DecoderNamespace = "GFX10" in { VOP2_SDWA9Ae(opName#"_sdwa").Pfl> { VOP2_SDWA_Pseudo Ps = !cast(opName#"_sdwa"); let AsmString = asmName # !subst(", vcc", "", Ps.AsmOperands); - let DecoderNamespace = "SDWA10"; } if !cast(opName#"_e32").Pfl.HasExtSDWA9 then def _sdwa_w32_gfx10 : @@ -1841,9 +1834,8 @@ let AssemblerPredicate = isGFX10Only, DecoderNamespace = "GFX10" in { VOP2_SDWA_Pseudo Ps = !cast(opName#"_sdwa"); let AsmString = asmName # !subst("vcc", "vcc_lo", Ps.AsmOperands); let isAsmParserOnly = 1; - let DecoderNamespace = "SDWA10"; let WaveSizePredicate = isWave32; - } + } if !cast(opName#"_e32").Pfl.HasExtSDWA9 then def _sdwa_w64_gfx10 : Base_VOP_SDWA10_Real(opName#"_sdwa")>, @@ -1851,7 +1843,6 @@ let AssemblerPredicate = isGFX10Only, DecoderNamespace = "GFX10" in { VOP2_SDWA_Pseudo Ps = !cast(opName#"_sdwa"); let AsmString = asmName # Ps.AsmOperands; let isAsmParserOnly = 1; - let DecoderNamespace = "SDWA10"; let WaveSizePredicate = isWave64; } } @@ -1861,7 +1852,6 @@ let AssemblerPredicate = isGFX10Only, DecoderNamespace = "GFX10" in { VOP2_DPP16(opName#"_dpp"), SIEncodingFamily.GFX10, asmName> { string AsmDPP = !cast(opName#"_e32").Pfl.AsmDPP16; let AsmString = asmName # !subst(", vcc", "", AsmDPP); - let DecoderNamespace = "SDWA10"; } if !cast(opName#"_e32").Pfl.HasExt32BitDPP then def _dpp_w32_gfx10 : @@ -2305,7 +2295,7 @@ multiclass VOP2be_Real_e32e64_gfx9 op, string OpName, string AsmName> { VOP2_DPPe(OpName#"_dpp")> { VOP2_DPP_Pseudo ps = !cast(OpName#"_dpp"); let AsmString = AsmName # ps.AsmOperands; - let DecoderNamespace = "SDWA9"; + let DecoderNamespace = "GFX9"; } } @@ -2329,7 +2319,7 @@ multiclass VOP2_Real_e32e64_gfx9 op> { def _dpp_gfx9 : VOP_DPP_Real(NAME#"_dpp"), SIEncodingFamily.GFX9>, VOP2_DPPe(NAME#"_dpp")> { - let DecoderNamespace = "SDWA9"; + let DecoderNamespace = "GFX9"; } } @@ -2489,7 +2479,7 @@ let AssemblerPredicate = isGFX90APlus, DecoderNamespace = "GFX90A" in { def _dpp_gfx90a : VOP_DPP_Real(NAME#"_dpp"), SIEncodingFamily.GFX90A>, VOP2_DPPe(NAME#"_dpp")> { - let DecoderNamespace = "SDWA9"; + let DecoderNamespace = "GFX9"; } } } // End AssemblerPredicate = isGFX90APlus, DecoderNamespace = "GFX90A" diff --git a/llvm/lib/Target/AMDGPU/VOPInstructions.td b/llvm/lib/Target/AMDGPU/VOPInstructions.td index 29c30bc019ed6..c47c13dbb8402 100644 --- a/llvm/lib/Target/AMDGPU/VOPInstructions.td +++ b/llvm/lib/Target/AMDGPU/VOPInstructions.td @@ -616,7 +616,7 @@ class VOP_SDWA_Pseudo pattern=[]> : let AssemblerPredicate = HasSDWA; let AsmVariantName = !if(P.HasExtSDWA, AMDGPUAsmVariants.SDWA, AMDGPUAsmVariants.Disable); - let DecoderNamespace = "SDWA"; + let DecoderNamespace = "GFX8"; VOPProfile Pfl = P; } @@ -672,7 +672,7 @@ class Base_VOP_SDWA9_Real : let AssemblerPredicate = HasSDWA9; let AsmVariantName = !if(ps.Pfl.HasExtSDWA9, AMDGPUAsmVariants.SDWA9, AMDGPUAsmVariants.Disable); - let DecoderNamespace = "SDWA9"; + let DecoderNamespace = "GFX9"; // Copy relevant pseudo op flags let AsmMatchConverter = ps.AsmMatchConverter; @@ -693,7 +693,7 @@ class VOP_SDWA9_Real : class Base_VOP_SDWA10_Real : Base_VOP_SDWA9_Real { let SubtargetPredicate = HasSDWA10; let AssemblerPredicate = HasSDWA10; - let DecoderNamespace = "SDWA10"; + let DecoderNamespace = "GFX10"; } class VOP_SDWA10_Real :