Merge pull request #1724 from Sonicadvance1/AArch64_dispatcher_optimization
[AArch64] Optimization in the dispatcher.
This commit is contained in:
commit
5cf79fd3b1
|
@ -13,15 +13,24 @@ using namespace Arm64Gen;
|
||||||
|
|
||||||
void JitArm64AsmRoutineManager::Generate()
|
void JitArm64AsmRoutineManager::Generate()
|
||||||
{
|
{
|
||||||
|
// This value is all of the callee saved registers that we are required to save.
|
||||||
|
// According to the AACPS64 we need to save R19 ~ R30.
|
||||||
|
const u32 ALL_CALLEE_SAVED = 0x7FF80000;
|
||||||
|
BitSet32 regs_to_save(ALL_CALLEE_SAVED);
|
||||||
enterCode = GetCodePtr();
|
enterCode = GetCodePtr();
|
||||||
|
|
||||||
SUB(SP, SP, 16);
|
ABI_PushRegisters(regs_to_save);
|
||||||
STR(INDEX_UNSIGNED, X30, SP, 0);
|
|
||||||
|
|
||||||
MOVI2R(X29, (u64)&PowerPC::ppcState);
|
MOVI2R(X29, (u64)&PowerPC::ppcState);
|
||||||
|
FixupBranch to_dispatcher = B();
|
||||||
|
|
||||||
|
// If we align the dispatcher to a page then we can load its location with one ADRP instruction
|
||||||
|
AlignCodePage();
|
||||||
dispatcher = GetCodePtr();
|
dispatcher = GetCodePtr();
|
||||||
printf("Dispatcher is %p\n", dispatcher);
|
WARN_LOG(DYNA_REC, "Dispatcher is %p\n", dispatcher);
|
||||||
|
|
||||||
|
SetJumpTarget(to_dispatcher);
|
||||||
|
|
||||||
// Downcount Check
|
// Downcount Check
|
||||||
// The result of slice decrementation should be in flags if somebody jumped here
|
// The result of slice decrementation should be in flags if somebody jumped here
|
||||||
// IMPORTANT - We jump on negative, not carry!!!
|
// IMPORTANT - We jump on negative, not carry!!!
|
||||||
|
@ -77,8 +86,7 @@ void JitArm64AsmRoutineManager::Generate()
|
||||||
|
|
||||||
SetJumpTarget(Exit);
|
SetJumpTarget(Exit);
|
||||||
|
|
||||||
LDR(INDEX_UNSIGNED, X30, SP, 0);
|
ABI_PopRegisters(regs_to_save);
|
||||||
ADD(SP, SP, 16);
|
|
||||||
RET(X30);
|
RET(X30);
|
||||||
|
|
||||||
FlushIcache();
|
FlushIcache();
|
||||||
|
|
Loading…
Reference in New Issue