[PATCH] D65229: [AMDGPU][MC][GFX10] Corrected constant bus checks to exclude null
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 2 07:18:57 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370665: [AMDGPU][MC][GFX10] Corrected constant bus checks to exclude null (authored by dpreobra, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D65229?vs=211557&id=218365#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65229/new/
https://reviews.llvm.org/D65229
Files:
llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/trunk/test/MC/AMDGPU/gfx10-constant-bus.s
Index: llvm/trunk/test/MC/AMDGPU/gfx10-constant-bus.s
===================================================================
--- llvm/trunk/test/MC/AMDGPU/gfx10-constant-bus.s
+++ llvm/trunk/test/MC/AMDGPU/gfx10-constant-bus.s
@@ -55,3 +55,9 @@
v_mad_u64_u32 v[5:6], s12, s1, 0x12345678, 0x12345678
// GFX10-ERR: error: invalid operand (violates constant bus restrictions)
+
+//-----------------------------------------------------------------------------------------
+// null is free
+
+v_bfe_u32 v5, s1, s2, null
+// GFX10: v_bfe_u32 v5, s1, s2, null ; encoding: [0x05,0x00,0x48,0xd5,0x01,0x04,0xf4,0x01]
Index: llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -2657,7 +2657,6 @@
case AMDGPU::VCC_LO:
case AMDGPU::VCC_HI:
case AMDGPU::M0:
- case AMDGPU::SGPR_NULL:
return Reg;
default:
break;
@@ -2731,9 +2730,13 @@
const MCOperand &MO = Inst.getOperand(OpIdx);
if (MO.isImm()) {
return !isInlineConstant(Inst, OpIdx);
+ } else if (MO.isReg()) {
+ auto Reg = MO.getReg();
+ const MCRegisterInfo *TRI = getContext().getRegisterInfo();
+ return isSGPR(mc2PseudoReg(Reg), TRI) && Reg != SGPR_NULL;
+ } else {
+ return true;
}
- return !MO.isReg() ||
- isSGPR(mc2PseudoReg(MO.getReg()), getContext().getRegisterInfo());
}
bool AMDGPUAsmParser::validateConstantBusLimitations(const MCInst &Inst) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65229.218365.patch
Type: text/x-patch
Size: 1586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190902/b5f298e1/attachment.bin>
More information about the llvm-commits
mailing list