mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-22 22:01:06 -06:00
support allocating more registers for aarch64 JIT
also some minor fixes for the x64 JIT as well
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user