Skip to content

Commit bab5dad

Browse files
committed
[AMDGPU][MC][DISASSEMBLER] Corrected decoder to consume each code fragment only once
Summary: disabled disassembly of successfully decoded fragments of code. See detailed bug description: https://bugs.llvm.org/show_bug.cgi?id=46101 Reviewers: arsenm, rampitec Differential Revision: https://reviews.llvm.org/D80637
1 parent bd06c41 commit bab5dad

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,6 @@ DecodeStatus AMDGPUDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
362362
Res = tryDecodeInst(DecoderTableGFX1064, MI, QW, Address);
363363
} while (false);
364364

365-
if (Res && (MaxInstBytesNum - Bytes.size()) == 12 && (!HasLiteral ||
366-
!(MCII->get(MI.getOpcode()).TSFlags & SIInstrFlags::VOP3))) {
367-
MaxInstBytesNum = 8;
368-
Bytes = Bytes_.slice(0, MaxInstBytesNum);
369-
eatBytes<uint64_t>(Bytes);
370-
}
371-
372365
if (Res && (MI.getOpcode() == AMDGPU::V_MAC_F32_e64_vi ||
373366
MI.getOpcode() == AMDGPU::V_MAC_F32_e64_gfx6_gfx7 ||
374367
MI.getOpcode() == AMDGPU::V_MAC_F32_e64_gfx10 ||

llvm/test/MC/Disassembler/AMDGPU/gfx10_dasm_all.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98025,8 +98025,8 @@
9802598025
# GFX10: v_trunc_f64_e64 v[5:6], |v[1:2]| ; encoding: [0x05,0x01,0x97,0xd5,0x01,0x01,0x00,0x00]
9802698026
0x05,0x01,0x97,0xd5,0x01,0x01,0x00,0x00
9802798027

98028-
# GFX10: v_writelane_b32 v255, 0, s2 ; encoding: [0xff,0x00,0x61,0xd7,0x80,0x04,0x00,0x00]
98029-
0xff,0x00,0x61,0xd7,0x80,0x04,0x00,0x00
98028+
# GFX10-FIXME: v_writelane_b32 v255, 0, s2 ; encoding: [0xff,0x00,0x61,0xd7,0x80,0x04,0x00,0x00]
98029+
# 0xff,0x00,0x61,0xd7,0x80,0x04,0x00,0x00
9803098030

9803198031
# GFX10: v_writelane_b32 v5, -1, s2 ; encoding: [0x05,0x00,0x61,0xd7,0xc1,0x04,0x00,0x00]
9803298032
0x05,0x00,0x61,0xd7,0xc1,0x04,0x00,0x00

0 commit comments

Comments
 (0)