Skip to content

Commit 99430c5

Browse files
authored
[AMDGPU] Update sendmsg types for GFX12 (#74888)
1 parent a3a8acd commit 99430c5

File tree

5 files changed

+71
-54
lines changed

5 files changed

+71
-54
lines changed

llvm/lib/Target/AMDGPU/SIDefines.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ enum Id { // Message ID, width(4) [3:0].
413413
ID_DEALLOC_VGPRS_GFX11Plus = 3, // reused in GFX11
414414

415415
ID_SAVEWAVE = 4, // added in GFX8, removed in GFX11
416-
ID_STALL_WAVE_GEN = 5, // added in GFX9
417-
ID_HALT_WAVES = 6, // added in GFX9
416+
ID_STALL_WAVE_GEN = 5, // added in GFX9, removed in GFX12
417+
ID_HALT_WAVES = 6, // added in GFX9, removed in GFX12
418418
ID_ORDERED_PS_DONE = 7, // added in GFX9, removed in GFX11
419419
ID_EARLY_PRIM_DEALLOC = 8, // added in GFX9, removed in GFX10
420420
ID_GS_ALLOC_REQ = 9, // added in GFX9
@@ -428,6 +428,7 @@ enum Id { // Message ID, width(4) [3:0].
428428
ID_RTN_GET_REALTIME = 131,
429429
ID_RTN_SAVE_WAVE = 132,
430430
ID_RTN_GET_TBA = 133,
431+
ID_RTN_GET_SE_AID_ID = 134,
431432

432433
ID_MASK_PreGFX11_ = 0xF,
433434
ID_MASK_GFX11Plus_ = 0xFF

llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@ namespace SendMsg {
3636

3737
// Disable lint checking for this block since it makes the table unreadable.
3838
// NOLINTBEGIN
39+
// clang-format off
3940
const CustomOperand<const MCSubtargetInfo &> Msg[] = {
4041
{{""}},
4142
{{"MSG_INTERRUPT"}, ID_INTERRUPT},
4243
{{"MSG_GS"}, ID_GS_PreGFX11, isNotGFX11Plus},
4344
{{"MSG_GS_DONE"}, ID_GS_DONE_PreGFX11, isNotGFX11Plus},
4445
{{"MSG_SAVEWAVE"}, ID_SAVEWAVE, isGFX8_GFX9_GFX10},
45-
{{"MSG_STALL_WAVE_GEN"}, ID_STALL_WAVE_GEN, isGFX9Plus},
46-
{{"MSG_HALT_WAVES"}, ID_HALT_WAVES, isGFX9Plus},
46+
{{"MSG_STALL_WAVE_GEN"}, ID_STALL_WAVE_GEN, isGFX9_GFX10_GFX11},
47+
{{"MSG_HALT_WAVES"}, ID_HALT_WAVES, isGFX9_GFX10_GFX11},
4748
{{"MSG_ORDERED_PS_DONE"}, ID_ORDERED_PS_DONE, isGFX9_GFX10},
4849
{{"MSG_EARLY_PRIM_DEALLOC"}, ID_EARLY_PRIM_DEALLOC, isGFX9_GFX10},
4950
{{"MSG_GS_ALLOC_REQ"}, ID_GS_ALLOC_REQ, isGFX9Plus},
@@ -59,7 +60,9 @@ const CustomOperand<const MCSubtargetInfo &> Msg[] = {
5960
{{"MSG_RTN_GET_REALTIME"}, ID_RTN_GET_REALTIME, isGFX11Plus},
6061
{{"MSG_RTN_SAVE_WAVE"}, ID_RTN_SAVE_WAVE, isGFX11Plus},
6162
{{"MSG_RTN_GET_TBA"}, ID_RTN_GET_TBA, isGFX11Plus},
63+
{{"MSG_RTN_GET_SE_AID_ID"}, ID_RTN_GET_SE_AID_ID, isGFX12Plus},
6264
};
65+
// clang-format on
6366
// NOLINTEND
6467

6568
const int MSG_SIZE = static_cast<int>(

llvm/test/MC/AMDGPU/gfx12_asm_sop1.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3648,6 +3648,9 @@ s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_SAVE_WAVE)
36483648
s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_TBA)
36493649
// GFX12: encoding: [0x85,0x4c,0x80,0xbe]
36503650

3651+
s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_SE_AID_ID)
3652+
// GFX12: encoding: [0x86,0x4c,0x80,0xbe]
3653+
36513654
s_ctz_i32_b32 s5, s1
36523655
// GFX12: encoding: [0x01,0x08,0x85,0xbe]
36533656

0 commit comments

Comments
 (0)