JitArm64: Store memory pointer once, not per block.

This commit is contained in:
degasus 2016-02-29 00:20:39 +01:00
parent 56c8f65bc2
commit 55b9ce9b5b
3 changed files with 7 additions and 7 deletions

View File

@ -205,6 +205,7 @@ void JitArm64::WriteExit(u32 destination)
b->linkData.push_back(linkData);
}
void JitArm64::WriteExceptionExit(ARM64Reg dest)
{
Cleanup();
@ -464,10 +465,6 @@ const u8* JitArm64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitB
gpr.Start(js.gpa);
fpr.Start(js.fpa);
// Setup memory base register
u8* base = UReg_MSR(MSR).DR ? Memory::logical_base : Memory::physical_base;
MOVI2R(X28, (u64)base);
if (!SConfig::GetInstance().bEnableDebugging)
js.downcountAmount += PatchEngine::GetSpeedhackCycles(em_address);

View File

@ -13,6 +13,7 @@
// Dedicated host registers
// X29 = ppcState pointer
// X28 = memory base register
using namespace Arm64Gen;
enum RegType

View File

@ -26,6 +26,8 @@ void JitArm64AsmRoutineManager::Generate()
ABI_PushRegisters(regs_to_save);
MOVI2R(X29, (u64)&PowerPC::ppcState);
MOVI2R(X28, (u64)Memory::logical_base);
FixupBranch to_dispatcher = B();
// If we align the dispatcher to a page then we can load its location with one ADRP instruction
@ -44,11 +46,11 @@ void JitArm64AsmRoutineManager::Generate()
// This block of code gets the address of the compiled block of code
// It runs though to the compiling portion if it isn't found
LDR(INDEX_UNSIGNED, W28, X29, PPCSTATE_OFF(pc)); // Load the current PC into W28
BFM(W28, WSP, 3, 2); // Wipe the top 3 bits. Same as PC & JIT_ICACHE_MASK
LDR(INDEX_UNSIGNED, W26, X29, PPCSTATE_OFF(pc)); // Load the current PC into W26
BFM(W26, WSP, 3, 2); // Wipe the top 3 bits. Same as PC & JIT_ICACHE_MASK
MOVI2R(X27, (u64)jit->GetBlockCache()->iCache.data());
LDR(W27, X27, X28);
LDR(W27, X27, X26);
FixupBranch JitBlock = TBNZ(W27, 7); // Test the 7th bit
// Success, it is our Jitblock.