Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
return MCDisassembler::Fail;
} while (false);

DecodeStatus Status = MCDisassembler::Success;

if (MCII->get(MI.getOpcode()).TSFlags & SIInstrFlags::DPP) {
if (isMacDPP(MI))
convertMacDPPInst(MI);
Expand Down Expand Up @@ -801,8 +803,16 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
if (ImmLitIdx != -1 && !IsSOPK)
convertFMAanyK(MI, ImmLitIdx);

if (isGFX10Plus() &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As always, I despise generation checks. Can you comment this, or put it in some kind of named predicate function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This particular generation check may not be necessary. It seems that pre-gfx10 the VOPC instructions in question are not encoded as VOP3.

This check is removed in the latest commit.

(MCII->get(MI.getOpcode()).TSFlags & SIInstrFlags::VOP3) &&
MCII->get(MI.getOpcode()).hasImplicitDefOfPhysReg(AMDGPU::EXEC)) {
auto ExecEncoding = MRI.getEncodingValue(AMDGPU::EXEC_LO);
if (Bytes_[0] != ExecEncoding)
Status = MCDisassembler::SoftFail;
}

Size = MaxInstBytesNum - Bytes.size();
return MCDisassembler::Success;
return Status;
}

void AMDGPUDisassembler::convertEXPInst(MCInst &MI) const {
Expand Down
Loading