[PATCH] D100665: [AMDGPU] NFC, Comment in disassembler for dpp8
Joe Nash via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 16 11:01:38 PDT 2021
Joe_Nash created this revision.
Joe_Nash added reviewers: rampitec, foad, arsenm.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl.
Joe_Nash requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
Gives reasoning for convertDPP8.
Also corrects typo in Operand type comment.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D100665
Files:
llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
llvm/lib/Target/AMDGPU/SIRegisterInfo.td
Index: llvm/lib/Target/AMDGPU/SIRegisterInfo.td
===================================================================
--- llvm/lib/Target/AMDGPU/SIRegisterInfo.td
+++ 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,
Index: llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+++ 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();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100665.338168.patch
Type: text/x-patch
Size: 1555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210416/bb7e5e12/attachment.bin>
More information about the llvm-commits
mailing list