]> granicus.if.org Git - llvm/commitdiff
[AMDGPU][MC][GFX9][GFX10] Added support of GET_DOORBELL message
authorDmitry Preobrazhensky <dmitry.preobrazhensky@amd.com>
Mon, 15 Jul 2019 15:12:16 +0000 (15:12 +0000)
committerDmitry Preobrazhensky <dmitry.preobrazhensky@amd.com>
Mon, 15 Jul 2019 15:12:16 +0000 (15:12 +0000)
Reviewers: artem.tamazov, arsenm

Differential Revision: https://reviews.llvm.org/D64729

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366071 91177308-0d34-0410-b5e6-96231b3b80d8

docs/AMDGPU/gfx10_msg.rst
docs/AMDGPU/gfx9_msg.rst
lib/Target/AMDGPU/SIDefines.h
lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
test/MC/AMDGPU/sopp-gfx10.s [new file with mode: 0644]
test/MC/AMDGPU/sopp-gfx9.s

index d56daa5c240dcee6096b76e906e4a76bb1d7d4f0..ef531a14db19fb0fec41f7c0ccf447ce46b36845 100644 (file)
@@ -53,6 +53,7 @@ Each message type supports specific operations:
     \                            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)
index 898848532c17969029493644a8e80eb8df7a84c0..14dff9050e6581c2978034a78c6bc0293ba842c8 100644 (file)
@@ -53,6 +53,7 @@ Each message type supports specific operations:
     \                            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)
index a329dd27a6ea9d0a2feefa4212ee6314317a9e26..a0e1ec6ac235b1bc4228bff99496dbe8525ee2b3 100644 (file)
@@ -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,
index 8b2e91a8ee374f9667e559e32febc0d3ed911634..075e08986c0c0608be3c90d71b6c8000e228b4bd 100644 (file)
@@ -23,7 +23,7 @@ const char* const IdSymbolic[] = {
   nullptr,
   nullptr,
   "MSG_GS_ALLOC_REQ",
-  nullptr,
+  "MSG_GET_DOORBELL",
   nullptr,
   nullptr,
   nullptr,
index 05df975cdd47633357379eaaa9d4de67032c43cd..e90f40e6abea16a60a8995f252b6a90d65a76457 100644 (file)
@@ -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) {
diff --git a/test/MC/AMDGPU/sopp-gfx10.s b/test/MC/AMDGPU/sopp-gfx10.s
new file mode 100644 (file)
index 0000000..f597f26
--- /dev/null
@@ -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]
index a02f8e110423214fcc9e268917d178a2859c405b..dbf5983cbcd60fd401157c6227508ad9d0b39fdf 100644 (file)
@@ -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]