mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
SPU LLVM: reintroduce branch patchpoints
Previously only used on SPU ASMJIT, may improve perf in some cases. Now refactored to spu_runtime::make_branch_patchpoint.
This commit is contained in:
parent
7f6a410770
commit
fb64b28886
3 changed files with 79 additions and 40 deletions
|
@ -947,35 +947,11 @@ void spu_recompiler::branch_fixed(u32 target)
|
|||
return;
|
||||
}
|
||||
|
||||
c->mov(x86::rax, imm_ptr(spu_runtime::g_dispatcher + target / 4));
|
||||
c->mov(x86::rax, x86::qword_ptr(x86::rax));
|
||||
|
||||
c->mov(SPU_OFF_32(pc), target);
|
||||
c->xor_(qw0->r32(), qw0->r32());
|
||||
c->cmp(SPU_OFF_32(state), 0);
|
||||
c->jnz(label_stop);
|
||||
|
||||
if (false)
|
||||
{
|
||||
// Don't generate patch points (TODO)
|
||||
c->xor_(qw0->r32(), qw0->r32());
|
||||
c->jmp(x86::rax);
|
||||
return;
|
||||
}
|
||||
|
||||
// Set patch address as a third argument and fallback to it
|
||||
Label patch_point = c->newLabel();
|
||||
c->lea(*qw0, x86::qword_ptr(patch_point));
|
||||
|
||||
// Need to emit exactly one executable instruction within 8 bytes
|
||||
c->align(kAlignCode, 8);
|
||||
c->bind(patch_point);
|
||||
//c->dq(0x841f0f);
|
||||
c->jmp(imm_ptr(&spu_recompiler_base::branch));
|
||||
|
||||
// Fallback to the branch via dispatcher
|
||||
c->align(kAlignCode, 8);
|
||||
c->xor_(qw0->r32(), qw0->r32());
|
||||
c->jmp(x86::rax);
|
||||
c->jmp(imm_ptr(m_spurt->make_branch_patchpoint(target)));
|
||||
}
|
||||
|
||||
void spu_recompiler::branch_indirect(spu_opcode_t op, bool jt, bool ret)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue