aco: use scalar buffer stores for dumping SGPRS from the trap on GFX8

This avoids using any VGPRs on GFX8.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32026>
This commit is contained in:
Samuel Pitoiset
2024-11-07 14:45:54 +01:00
committed by Marge Bot
parent 17f6b4e51e
commit 8c6f2fef1b
+10 -5
View File
@@ -12518,12 +12518,17 @@ select_trap_handler_shader(Program* program, struct nir_shader* shader, ac_shade
/* Dump all SGPRs. */
for (uint32_t i = 0; i < program->dev.sgpr_limit; i++) {
bld.copy(Definition(PhysReg{256}, v1) /* v0 */, Operand(PhysReg{i}, s1));
if (ctx.program->gfx_level >= GFX9) {
bld.copy(Definition(PhysReg{256}, v1) /* v0 */, Operand(PhysReg{i}, s1));
bld.mubuf(aco_opcode::buffer_store_dword, Operand(tma_rsrc, s4), Operand(v1),
Operand::c32(0u), Operand(PhysReg{256}, v1) /* v0 */, offset, false /* offen */,
false /* idxen */, /* addr64 */ false,
/* disable_wqm */ false, cache_glc);
bld.mubuf(aco_opcode::buffer_store_dword, Operand(tma_rsrc, s4), Operand(v1),
Operand::c32(0u), Operand(PhysReg{256}, v1) /* v0 */, offset, false /* offen */,
false /* idxen */, /* addr64 */ false,
/* disable_wqm */ false, cache_glc);
} else {
bld.smem(aco_opcode::s_buffer_store_dword, Operand(tma_rsrc, s4), Operand::c32(offset),
Operand(PhysReg{i}, s1), memory_sync_info(), cache_glc);
}
offset += 4;
}