Skip to content

Commit 434d592

Browse files
committedOct 4, 2019
[AMDGPU][MC][GFX10][WS32] Corrected decoding of dst operand for v_cmp_*_sdwa opcodes
See bug 43484: https://bugs.llvm.org/show_bug.cgi?id=43484 Reviewers: arsenm, rampitec Differential Revision: https://reviews.llvm.org/D68349 llvm-svn: 373745
1 parent f8ad4d6 commit 434d592

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
 

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,8 @@ MCOperand AMDGPUDisassembler::decodeSDWAVopcDst(unsigned Val) const {
11731173

11741174
int TTmpIdx = getTTmpIdx(Val);
11751175
if (TTmpIdx >= 0) {
1176-
return createSRegOperand(getTtmpClassId(OPW64), TTmpIdx);
1176+
auto TTmpClsId = getTtmpClassId(IsWave64 ? OPW64 : OPW32);
1177+
return createSRegOperand(TTmpClsId, TTmpIdx);
11771178
} else if (Val > SGPR_MAX) {
11781179
return IsWave64 ? decodeSpecialReg64(Val)
11791180
: decodeSpecialReg32(Val);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# RUN: llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize32,-wavefrontsize64 -disassemble -show-encoding < %s | FileCheck -check-prefixes=GFX10,W32 %s
2+
# RUN: llvm-mc -arch=amdgcn -mcpu=gfx1010 -mattr=-wavefrontsize32,+wavefrontsize64 -disassemble -show-encoding < %s | FileCheck -check-prefixes=GFX10,W64 %s
3+
4+
# W32: v_cmp_class_f16_sdwa ttmp14, v1, v2 src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x1e,0x7d,0x01,0xfa,0x06,0x06]
5+
# W64: v_cmp_class_f16_sdwa ttmp[14:15], v1, v2 src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x1e,0x7d,0x01,0xfa,0x06,0x06]
6+
0xf9,0x04,0x1e,0x7d,0x01,0xfa,0x06,0x06

0 commit comments

Comments
 (0)
Please sign in to comment.