From 9bd763679fe97593cc9a660c37d5ab00e9bfec06 Mon Sep 17 00:00:00 2001 From: Dmitry Preobrazhensky Date: Fri, 4 Oct 2019 12:38:36 +0000 Subject: [PATCH] [AMDGPU][MC][GFX10] Enabled decoding of 'null' operand See bug 43485: https://bugs.llvm.org/show_bug.cgi?id=43485 Reviewers: arsenm, rampitec Differential Revision: https://reviews.llvm.org/D68348 llvm-svn: 373740 --- llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp | 1 + llvm/test/MC/Disassembler/AMDGPU/sop2_gfx10.txt | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 llvm/test/MC/Disassembler/AMDGPU/sop2_gfx10.txt diff --git a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp index 4ec4be9bc485..e3b179c5caf4 100644 --- a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp +++ b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp @@ -1095,6 +1095,7 @@ MCOperand AMDGPUDisassembler::decodeSpecialReg64(unsigned Val) const { case 106: return createRegOperand(VCC); case 108: return createRegOperand(TBA); case 110: return createRegOperand(TMA); + case 125: return createRegOperand(SGPR_NULL); case 126: return createRegOperand(EXEC); case 235: return createRegOperand(SRC_SHARED_BASE); case 236: return createRegOperand(SRC_SHARED_LIMIT); diff --git a/llvm/test/MC/Disassembler/AMDGPU/sop2_gfx10.txt b/llvm/test/MC/Disassembler/AMDGPU/sop2_gfx10.txt new file mode 100644 index 000000000000..adeb47aa9d4d --- /dev/null +++ b/llvm/test/MC/Disassembler/AMDGPU/sop2_gfx10.txt @@ -0,0 +1,7 @@ +# RUN: llvm-mc -arch=amdgcn -mcpu=gfx1010 -disassemble -show-encoding < %s | FileCheck %s -check-prefix=GFX10 + +# GFX10: s_ashr_i64 s[0:1], null, s0 ; encoding: [0x7d,0x00,0x80,0x91] +0x7d,0x00,0x80,0x91 + +# GFX10: s_and_b64 s[0:1], null, null ; encoding: [0x7d,0x7d,0x80,0x87] +0x7d,0x7d,0x80,0x87