diff --git a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp --- a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp +++ b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp @@ -398,6 +398,9 @@ return MCDisassembler::Fail; } +// The disassembler is greedy, so we need to check FI operand value to +// not parse a dpp if the correct literal is not set. For dpp16 the +// autogenerated decoder checks the dpp literal static bool isValidDPP8(const MCInst &MI) { using namespace llvm::AMDGPU::DPP; int FiIdx = AMDGPU::getNamedOperandIdx(MI.getOpcode(), AMDGPU::OpName::fi); @@ -650,6 +653,8 @@ return MCDisassembler::Success; } +// We must check FI == literal to reject not genuine dpp8 insts, and we must +// first add optional MI operands to check FI DecodeStatus AMDGPUDisassembler::convertDPP8Inst(MCInst &MI) const { unsigned Opc = MI.getOpcode(); unsigned DescNumOps = MCII->get(Opc).getNumOperands(); diff --git a/llvm/lib/Target/AMDGPU/SIRegisterInfo.td b/llvm/lib/Target/AMDGPU/SIRegisterInfo.td --- a/llvm/lib/Target/AMDGPU/SIRegisterInfo.td +++ b/llvm/lib/Target/AMDGPU/SIRegisterInfo.td @@ -1026,7 +1026,7 @@ } //===----------------------------------------------------------------------===// -// VSrc_* Operands with an VGPR +// VRegSrc_* Operands with a VGPR //===----------------------------------------------------------------------===// // This is for operands with the enum(9), VSrc encoding restriction,