1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[AMDGPU][MC][GFX9][GFX10] Added support of GET_DOORBELL message

Reviewers: artem.tamazov, arsenm

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

llvm-svn: 366071
This commit is contained in:
Dmitry Preobrazhensky 2019-07-15 15:12:16 +00:00
parent 9729b8be9a
commit 25b56899fa
7 changed files with 42 additions and 5 deletions

View 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)

View 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)

View 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,

View File

@ -23,7 +23,7 @@ const char* const IdSymbolic[] = {
nullptr,
nullptr,
"MSG_GS_ALLOC_REQ",
nullptr,
"MSG_GET_DOORBELL",
nullptr,
nullptr,
nullptr,

View 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) {

View File

@ -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]

View 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]