From de081d09008cd9128165d3cd45a72409d2a27cdd Mon Sep 17 00:00:00 2001 From: nakeee Date: Fri, 23 Apr 2010 08:15:00 +0000 Subject: [PATCH] DSP jit: fixed some crash by pop/push (close to bhaal's solution) If it breaks 64bit you know what to uncomment :-) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5400 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DSPCore/Src/DSPEmitter.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/Core/DSPCore/Src/DSPEmitter.cpp b/Source/Core/DSPCore/Src/DSPEmitter.cpp index 78cb7bf6a1..8311d0b931 100644 --- a/Source/Core/DSPCore/Src/DSPEmitter.cpp +++ b/Source/Core/DSPCore/Src/DSPEmitter.cpp @@ -93,7 +93,8 @@ void DSPEmitter::checkExceptions() { ABI_CallFunction((void *)&DSPCore_CheckExceptions); - ABI_RestoreStack(0); + // ABI_RestoreStack(0); + ABI_PopAllCalleeSavedRegsAndAdjustStack(); RET(); SetJumpTarget(skipCheck); @@ -149,7 +150,8 @@ void DSPEmitter::Default(UDSPInstruction _inst) const u8 *DSPEmitter::Compile(int start_addr) { AlignCode16(); const u8 *entryPoint = GetCodePtr(); - ABI_AlignStack(0); + ABI_PushAllCalleeSavedRegsAndAdjustStack(); + // ABI_AlignStack(0); int addr = start_addr; checkExceptions(); @@ -178,7 +180,8 @@ const u8 *DSPEmitter::Compile(int start_addr) { // These functions branch and therefore only need to be called in the // end of each block and in this order ABI_CallFunction((void *)&DSPInterpreter::HandleLoop); - ABI_RestoreStack(0); + // ABI_RestoreStack(0); + ABI_PopAllCalleeSavedRegsAndAdjustStack(); RET(); SetJumpTarget(rLoopAddressExit); @@ -200,7 +203,8 @@ const u8 *DSPEmitter::Compile(int start_addr) { addr += opcode->size; } - ABI_RestoreStack(0); + // ABI_RestoreStack(0); + ABI_PopAllCalleeSavedRegsAndAdjustStack(); RET(); blocks[start_addr] = (CompiledCode)entryPoint;