[llvm] r366071 - [AMDGPU][MC][GFX9][GFX10] Added support of GET_DOORBELL message
Dmitry Preobrazhensky via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 15 08:12:16 PDT 2019
Author: dpreobra
Date: Mon Jul 15 08:12:16 2019
New Revision: 366071
URL: http://llvm.org/viewvc/llvm-project?rev=366071&view=rev
Log:
[AMDGPU][MC][GFX9][GFX10] Added support of GET_DOORBELL message
Reviewers: artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D64729
Added:
llvm/trunk/test/MC/AMDGPU/sopp-gfx10.s
Modified:
llvm/trunk/docs/AMDGPU/gfx10_msg.rst
llvm/trunk/docs/AMDGPU/gfx9_msg.rst
llvm/trunk/lib/Target/AMDGPU/SIDefines.h
llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp
llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
llvm/trunk/test/MC/AMDGPU/sopp-gfx9.s
Modified: llvm/trunk/docs/AMDGPU/gfx10_msg.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/AMDGPU/gfx10_msg.rst?rev=366071&r1=366070&r2=366071&view=diff
==============================================================================
--- llvm/trunk/docs/AMDGPU/gfx10_msg.rst (original)
+++ llvm/trunk/docs/AMDGPU/gfx10_msg.rst Mon Jul 15 08:12:16 2019
@@ -53,6 +53,7 @@ Each message type supports specific oper
\ GS_OP_EMIT 2 Optional
\ GS_OP_EMIT_CUT 3 Optional
MSG_GS_ALLOC_REQ 9 \- \- \-
+ MSG_GET_DOORBELL 10 \- \- \-
MSG_SYSMSG 15 SYSMSG_OP_ECC_ERR_INTERRUPT 1 \-
\ SYSMSG_OP_REG_RD 2 \-
\ SYSMSG_OP_HOST_TRAP_ACK 3 \-
@@ -65,6 +66,7 @@ Examples:
s_sendmsg 0x12
s_sendmsg sendmsg(MSG_INTERRUPT)
+ s_sendmsg sendmsg(MSG_GET_DOORBELL)
s_sendmsg sendmsg(2, GS_OP_CUT)
s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT)
s_sendmsg sendmsg(MSG_GS, 2)
Modified: llvm/trunk/docs/AMDGPU/gfx9_msg.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/AMDGPU/gfx9_msg.rst?rev=366071&r1=366070&r2=366071&view=diff
==============================================================================
--- llvm/trunk/docs/AMDGPU/gfx9_msg.rst (original)
+++ llvm/trunk/docs/AMDGPU/gfx9_msg.rst Mon Jul 15 08:12:16 2019
@@ -53,6 +53,7 @@ Each message type supports specific oper
\ GS_OP_EMIT 2 Optional
\ GS_OP_EMIT_CUT 3 Optional
MSG_GS_ALLOC_REQ 9 \- \- \-
+ MSG_GET_DOORBELL 10 \- \- \-
MSG_SYSMSG 15 SYSMSG_OP_ECC_ERR_INTERRUPT 1 \-
\ SYSMSG_OP_REG_RD 2 \-
\ SYSMSG_OP_HOST_TRAP_ACK 3 \-
@@ -65,6 +66,7 @@ Examples:
s_sendmsg 0x12
s_sendmsg sendmsg(MSG_INTERRUPT)
+ s_sendmsg sendmsg(MSG_GET_DOORBELL)
s_sendmsg sendmsg(2, GS_OP_CUT)
s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT)
s_sendmsg sendmsg(MSG_GS, 2)
Modified: llvm/trunk/lib/Target/AMDGPU/SIDefines.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIDefines.h?rev=366071&r1=366070&r2=366071&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIDefines.h (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIDefines.h Mon Jul 15 08:12:16 2019
@@ -263,6 +263,7 @@ enum Id { // Message ID, width(4) [3:0].
ID_GS,
ID_GS_DONE,
ID_GS_ALLOC_REQ = 9,
+ ID_GET_DOORBELL = 10,
ID_SYSMSG = 15,
ID_GAPS_LAST_, // Indicate that sequence has gaps.
ID_GAPS_FIRST_ = ID_INTERRUPT,
Modified: llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp?rev=366071&r1=366070&r2=366071&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp Mon Jul 15 08:12:16 2019
@@ -23,7 +23,7 @@ const char* const IdSymbolic[] = {
nullptr,
nullptr,
"MSG_GS_ALLOC_REQ",
- nullptr,
+ "MSG_GET_DOORBELL",
nullptr,
nullptr,
nullptr,
Modified: llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp?rev=366071&r1=366070&r2=366071&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Mon Jul 15 08:12:16 2019
@@ -731,9 +731,14 @@ static bool isValidMsgId(int64_t MsgId)
}
bool isValidMsgId(int64_t MsgId, const MCSubtargetInfo &STI, bool Strict) {
- return Strict ?
- isValidMsgId(MsgId) && (MsgId != ID_GS_ALLOC_REQ || isGFX9(STI) || isGFX10(STI)) :
- 0 <= MsgId && isUInt<ID_WIDTH_>(MsgId);
+ if (Strict) {
+ if (MsgId == ID_GS_ALLOC_REQ || MsgId == ID_GET_DOORBELL)
+ return isGFX9(STI) || isGFX10(STI);
+ else
+ return isValidMsgId(MsgId);
+ } else {
+ return 0 <= MsgId && isUInt<ID_WIDTH_>(MsgId);
+ }
}
StringRef getMsgName(int64_t MsgId) {
Added: llvm/trunk/test/MC/AMDGPU/sopp-gfx10.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/sopp-gfx10.s?rev=366071&view=auto
==============================================================================
--- llvm/trunk/test/MC/AMDGPU/sopp-gfx10.s (added)
+++ llvm/trunk/test/MC/AMDGPU/sopp-gfx10.s Mon Jul 15 08:12:16 2019
@@ -0,0 +1,17 @@
+// RUN: llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck --check-prefix=GFX10 %s
+
+//===----------------------------------------------------------------------===//
+// s_sendmsg
+//===----------------------------------------------------------------------===//
+
+s_sendmsg 9
+// GFX10: s_sendmsg sendmsg(MSG_GS_ALLOC_REQ) ; encoding: [0x09,0x00,0x90,0xbf]
+
+s_sendmsg sendmsg(MSG_GS_ALLOC_REQ)
+// GFX10: s_sendmsg sendmsg(MSG_GS_ALLOC_REQ) ; encoding: [0x09,0x00,0x90,0xbf]
+
+s_sendmsg 10
+// GFX10: s_sendmsg sendmsg(MSG_GET_DOORBELL) ; encoding: [0x0a,0x00,0x90,0xbf]
+
+s_sendmsg sendmsg(MSG_GET_DOORBELL)
+// GFX10: s_sendmsg sendmsg(MSG_GET_DOORBELL) ; encoding: [0x0a,0x00,0x90,0xbf]
Modified: llvm/trunk/test/MC/AMDGPU/sopp-gfx9.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/sopp-gfx9.s?rev=366071&r1=366070&r2=366071&view=diff
==============================================================================
--- llvm/trunk/test/MC/AMDGPU/sopp-gfx9.s (original)
+++ llvm/trunk/test/MC/AMDGPU/sopp-gfx9.s Mon Jul 15 08:12:16 2019
@@ -70,8 +70,18 @@ s_waitcnt vmcnt(62) lgkmcnt(14)
s_waitcnt vmcnt(62) expcnt(6) lgkmcnt(14)
// GFX9: s_waitcnt vmcnt(62) expcnt(6) lgkmcnt(14) ; encoding: [0x6e,0xce,0x8c,0xbf]
+//===----------------------------------------------------------------------===//
+// s_sendmsg
+//===----------------------------------------------------------------------===//
+
s_sendmsg 9
-// GCN: s_sendmsg sendmsg(MSG_GS_ALLOC_REQ) ; encoding: [0x09,0x00,0x90,0xbf]
+// GFX9: s_sendmsg sendmsg(MSG_GS_ALLOC_REQ) ; encoding: [0x09,0x00,0x90,0xbf]
s_sendmsg sendmsg(MSG_GS_ALLOC_REQ)
// GFX9: s_sendmsg sendmsg(MSG_GS_ALLOC_REQ) ; encoding: [0x09,0x00,0x90,0xbf]
+
+s_sendmsg 10
+// GFX9: s_sendmsg sendmsg(MSG_GET_DOORBELL) ; encoding: [0x0a,0x00,0x90,0xbf]
+
+s_sendmsg sendmsg(MSG_GET_DOORBELL)
+// GFX9: s_sendmsg sendmsg(MSG_GET_DOORBELL) ; encoding: [0x0a,0x00,0x90,0xbf]
More information about the llvm-commits
mailing list