rsx: Optimize RET returning to following CALL

This commit is contained in:
Eladash 2023-08-25 19:39:19 +03:00 committed by Elad Ashkenazi
parent 82c5c4d285
commit eb61ae37ae
1 changed files with 18 additions and 0 deletions

View File

@ -701,6 +701,24 @@ namespace rsx
return;
}
// Optimize returning to another CALL
if ((ctrl->put & ~3) != fifo_ret_addr)
{
if (u32 addr = iomap_table.get_addr(fifo_ret_addr); addr != umax)
{
const u32 cmd0 = vm::read32(addr);
// Check for missing step flags, in case the user is single-stepping in the debugger
if ((cmd0 & RSX_METHOD_CALL_CMD_MASK) == RSX_METHOD_CALL_CMD && cpu_flag::dbg_step - state)
{
fifo_ctrl->set_get(cmd0 & RSX_METHOD_CALL_OFFSET_MASK);
last_known_code_start = ctrl->get;
fifo_ret_addr += 4;
return;
}
}
}
fifo_ctrl->set_get(std::exchange(fifo_ret_addr, RSX_CALL_STACK_EMPTY));
last_known_code_start = ctrl->get;
return;