diff options
Diffstat (limited to 'src/ARMJIT.cpp')
-rw-r--r-- | src/ARMJIT.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ARMJIT.cpp b/src/ARMJIT.cpp index 38e9ddc..361801b 100644 --- a/src/ARMJIT.cpp +++ b/src/ARMJIT.cpp @@ -645,6 +645,8 @@ void CompileBlock(ARM* cpu) u32 lr; bool hasLink = false; + bool hasMemoryInstr = false; + do { r15 += thumb ? 2 : 4; @@ -707,6 +709,10 @@ void CompileBlock(ARM* cpu) } instrs[i].Info = ARMInstrInfo::Decode(thumb, cpu->Num, instrs[i].Instr); + hasMemoryInstr |= thumb + ? (instrs[i].Info.Kind >= ARMInstrInfo::tk_LDR_PCREL && instrs[i].Info.Kind <= ARMInstrInfo::tk_STMIA) + : (instrs[i].Info.Kind >= ARMInstrInfo::ak_STR_REG_LSL && instrs[i].Info.Kind <= ARMInstrInfo::ak_STM); + cpu->R[15] = r15; cpu->CurInstr = instrs[i].Instr; cpu->CodeCycles = instrs[i].CodeCycles; @@ -915,7 +921,7 @@ void CompileBlock(ARM* cpu) #if defined(__APPLE__) && defined(__aarch64__) pthread_jit_write_protect_np(false); #endif - block->EntryPoint = JITCompiler->CompileBlock(cpu, thumb, instrs, i); + block->EntryPoint = JITCompiler->CompileBlock(cpu, thumb, instrs, i, hasMemoryInstr); #if defined(__APPLE__) && defined(__aarch64__) pthread_jit_write_protect_np(true); #endif |