From 034014a165117bbb4e83f3bf577104da148f41f7 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 12 Nov 2024 12:32:38 +0100 Subject: [PATCH] aco: restore m0/exec before exiting the trap handler Dumping VGPRs will overwrite m0 and exec and they need to be restored if we want to return to the shader. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 65f613da1a5..a09725302bf 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -12434,6 +12434,10 @@ select_trap_handler_shader(Program* program, ac_shader_config* config, restore_vgprs_from_mem(&ctx, Operand(tma_rsrc, s4)); } + /* Restore m0 and exec. */ + bld.copy(Definition(m0, s1), Operand(save_m0, s1)); + bld.copy(Definition(exec, bld.lm), Operand(save_exec, bld.lm)); + /* Restore SCC which is the first bit of SQ_WAVE_STATUS. */ bld.sopc(aco_opcode::s_bitcmp1_b32, bld.def(s1, scc), Operand(save_wave_status, s1), Operand::c32(0u));