Skip to content

[AMDGPU] Fix GFX11 sendmsg codes #85299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion llvm/lib/Target/AMDGPU/SIDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ enum Id { // Message ID, width(4) [3:0].
ID_RTN_GET_REALTIME = 131,
ID_RTN_SAVE_WAVE = 132,
ID_RTN_GET_TBA = 133,
ID_RTN_GET_SE_AID_ID = 134,
ID_RTN_GET_TBA_TO_PC = 134,
ID_RTN_GET_SE_AID_ID = 135,

ID_MASK_PreGFX11_ = 0xF,
ID_MASK_GFX11Plus_ = 0xFF
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const CustomOperand<const MCSubtargetInfo &> Msg[] = {
{{"MSG_RTN_GET_REALTIME"}, ID_RTN_GET_REALTIME, isGFX11Plus},
{{"MSG_RTN_SAVE_WAVE"}, ID_RTN_SAVE_WAVE, isGFX11Plus},
{{"MSG_RTN_GET_TBA"}, ID_RTN_GET_TBA, isGFX11Plus},
{{"MSG_RTN_GET_TBA_TO_PC"}, ID_RTN_GET_TBA_TO_PC, isGFX11Plus},
{{"MSG_RTN_GET_SE_AID_ID"}, ID_RTN_GET_SE_AID_ID, isGFX12Plus},
};
// clang-format on
Expand Down
3 changes: 3 additions & 0 deletions llvm/test/MC/AMDGPU/gfx11_asm_sop1.s
Original file line number Diff line number Diff line change
Expand Up @@ -2964,6 +2964,9 @@ s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_SAVE_WAVE)
s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_TBA)
// GFX11: encoding: [0x85,0x4c,0x80,0xbe]

s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_TBA_TO_PC)
// GFX11: encoding: [0x86,0x4c,0x80,0xbe]

s_ctz_i32_b32 s5, s1
// GFX11: encoding: [0x01,0x08,0x85,0xbe]

Expand Down
5 changes: 4 additions & 1 deletion llvm/test/MC/AMDGPU/gfx12_asm_sop1.s
Original file line number Diff line number Diff line change
Expand Up @@ -3708,9 +3708,12 @@ s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_SAVE_WAVE)
s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_TBA)
// GFX12: encoding: [0x85,0x4c,0x80,0xbe]

s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_SE_AID_ID)
s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_TBA_TO_PC)
// GFX12: encoding: [0x86,0x4c,0x80,0xbe]

s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_SE_AID_ID)
// GFX12: encoding: [0x87,0x4c,0x80,0xbe]

s_ctz_i32_b32 s5, s1
// GFX12: encoding: [0x01,0x08,0x85,0xbe]

Expand Down
3 changes: 3 additions & 0 deletions llvm/test/MC/Disassembler/AMDGPU/gfx11_dasm_sop1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2536,6 +2536,9 @@
# GFX11: s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_TBA) ; encoding: [0x85,0x4c,0x80,0xbe]
0x85,0x4c,0x80,0xbe

# GFX11: s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_TBA_TO_PC) ; encoding: [0x86,0x4c,0x80,0xbe]
0x86,0x4c,0x80,0xbe

# GFX11: s_setpc_b64 s[0:1] ; encoding: [0x00,0x48,0x80,0xbe]
0x00,0x48,0x80,0xbe

Expand Down
5 changes: 4 additions & 1 deletion llvm/test/MC/Disassembler/AMDGPU/gfx12_dasm_sop1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3279,9 +3279,12 @@
# GFX12: s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_TBA) ; encoding: [0x85,0x4c,0x80,0xbe]
0x85,0x4c,0x80,0xbe

# GFX12: s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_SE_AID_ID) ; encoding: [0x86,0x4c,0x80,0xbe]
# GFX12: s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_TBA_TO_PC) ; encoding: [0x86,0x4c,0x80,0xbe]
0x86,0x4c,0x80,0xbe

# GFX12: s_sendmsg_rtn_b32 s0, sendmsg(MSG_RTN_GET_SE_AID_ID) ; encoding: [0x87,0x4c,0x80,0xbe]
0x87,0x4c,0x80,0xbe

# GFX12: s_setpc_b64 s[0:1] ; encoding: [0x00,0x48,0x80,0xbe]
0x00,0x48,0x80,0xbe

Expand Down