aco: split the sendmsg enumeration into sendmsg_rtn

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19267>
This commit is contained in:
Samuel Pitoiset
2022-10-25 13:17:34 +02:00
parent 6630b6e2aa
commit c481978ac2
3 changed files with 31 additions and 17 deletions
+12 -8
View File
@@ -97,14 +97,18 @@ enum sendmsg {
sendmsg_gs_alloc_req = 9, /* gfx9+ */
sendmsg_get_doorbell = 10, /* gfx9 to gfx10.3 */
sendmsg_get_ddid = 11, /* gfx10 to gfx10.3 */
sendmsg_rtn_get_doorbell = 128, /* gfx11+ */
sendmsg_rtn_get_ddid = 129, /* gfx11+ */
sendmsg_rtn_get_tma = 130, /* gfx11+ */
sendmsg_rtn_get_realtime = 131, /* gfx11+ */
sendmsg_rtn_save_wave = 132, /* gfx11+ */
sendmsg_rtn_get_tba = 133, /* gfx11+ */
sendmsg_id_mask_gfx6 = 0xf,
sendmsg_id_mask_gfx11 = 0xff,
sendmsg_id_mask = 0xf,
};
/* gfx11+ */
enum sendmsg_rtn {
sendmsg_rtn_get_doorbell = 0,
sendmsg_rtn_get_ddid = 1,
sendmsg_rtn_get_tma = 2,
sendmsg_rtn_get_realtime = 3,
sendmsg_rtn_save_wave = 4,
sendmsg_rtn_get_tba = 5,
sendmsg_rtn_mask = 0xff,
};
inline sendmsg
+18 -8
View File
@@ -333,8 +333,7 @@ print_instr_format_specific(enum amd_gfx_level gfx_level, const Instruction* ins
break;
}
case aco_opcode::s_sendmsg: {
unsigned id =
gfx_level >= GFX11 ? (imm & sendmsg_id_mask_gfx11) : (imm & sendmsg_id_mask_gfx6);
unsigned id = imm & sendmsg_id_mask;
static_assert(_sendmsg_gs == sendmsg_hs_tessfactor);
static_assert(_sendmsg_gs_done == sendmsg_dealloc_vgprs);
switch (id) {
@@ -361,12 +360,6 @@ print_instr_format_specific(enum amd_gfx_level gfx_level, const Instruction* ins
case sendmsg_gs_alloc_req: fprintf(output, " sendmsg(gs_alloc_req)"); break;
case sendmsg_get_doorbell: fprintf(output, " sendmsg(get_doorbell)"); break;
case sendmsg_get_ddid: fprintf(output, " sendmsg(get_ddid)"); break;
case sendmsg_rtn_get_doorbell: fprintf(output, " sendmsg(rtn_get_doorbell)"); break;
case sendmsg_rtn_get_ddid: fprintf(output, " sendmsg(rtn_get_ddid)"); break;
case sendmsg_rtn_get_tma: fprintf(output, " sendmsg(rtn_get_Tma)"); break;
case sendmsg_rtn_get_realtime: fprintf(output, " sendmsg(rtn_get_realtime)"); break;
case sendmsg_rtn_save_wave: fprintf(output, " sendmsg(rtn_save_wave)"); break;
case sendmsg_rtn_get_tba: fprintf(output, " sendmsg(rtn_get_Tba)"); break;
default: fprintf(output, " imm:%u", imm);
}
break;
@@ -381,6 +374,23 @@ print_instr_format_specific(enum amd_gfx_level gfx_level, const Instruction* ins
fprintf(output, " block:BB%d", instr->sopp().block);
break;
}
case Format::SOP1: {
if (instr->opcode == aco_opcode::s_sendmsg_rtn_b32 ||
instr->opcode == aco_opcode::s_sendmsg_rtn_b64) {
unsigned id = instr->operands[0].constantValue();
switch (id) {
case sendmsg_rtn_get_doorbell: fprintf(output, " sendmsg(rtn_get_doorbell)"); break;
case sendmsg_rtn_get_ddid: fprintf(output, " sendmsg(rtn_get_ddid)"); break;
case sendmsg_rtn_get_tma: fprintf(output, " sendmsg(rtn_get_tma)"); break;
case sendmsg_rtn_get_realtime: fprintf(output, " sendmsg(rtn_get_realtime)"); break;
case sendmsg_rtn_save_wave: fprintf(output, " sendmsg(rtn_save_wave)"); break;
case sendmsg_rtn_get_tba: fprintf(output, " sendmsg(rtn_get_tba)"); break;
default: break;
}
break;
}
break;
}
case Format::SMEM: {
const SMEM_instruction& smem = instr->smem();
if (smem.glc)
+1 -1
View File
@@ -424,7 +424,7 @@ bool
is_done_sendmsg(amd_gfx_level gfx_level, const Instruction* instr)
{
if (gfx_level <= GFX10_3 && instr->opcode == aco_opcode::s_sendmsg)
return (instr->sopp().imm & sendmsg_id_mask_gfx6) == _sendmsg_gs_done;
return (instr->sopp().imm & sendmsg_id_mask) == _sendmsg_gs_done;
return false;
}