diff --git a/Source/Core/Common/Src/ABI.cpp b/Source/Core/Common/Src/ABI.cpp index 941a1e9ff8..a481663eaf 100644 --- a/Source/Core/Common/Src/ABI.cpp +++ b/Source/Core/Common/Src/ABI.cpp @@ -103,6 +103,7 @@ void XEmitter::ABI_CallFunctionAC(void *func, const Gen::OpArg &arg1, u32 param2 } void XEmitter::ABI_PushAllCalleeSavedRegsAndAdjustStack() { + ABI_AlignStack(0); // Note: 4 * 4 = 16 bytes, so alignment is preserved. PUSH(EBP); PUSH(EBX); @@ -115,6 +116,7 @@ void XEmitter::ABI_PopAllCalleeSavedRegsAndAdjustStack() { POP(ESI); POP(EBX); POP(EBP); + ABI_RestoreStack(0); } unsigned int XEmitter::ABI_GetAlignedFrameSize(unsigned int frameSize) { diff --git a/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp b/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp index ad7bb21e0f..856829de98 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp @@ -67,13 +67,8 @@ AsmRoutineManager asm_routines; void AsmRoutineManager::Generate() { enterCode = AlignCode16(); -#ifdef _M_IX86 - PUSH(EBP); - PUSH(EBX); - PUSH(ESI); - PUSH(EDI); -#else ABI_PushAllCalleeSavedRegsAndAdjustStack(); +#ifndef _M_IX86 // Two statically allocated registers. MOV(64, R(RBX), Imm64((u64)Memory::base)); MOV(64, R(R15), Imm64((u64)jit.GetBlockCache()->GetCodePointers())); //It's below 2GB so 32 bits are good enough @@ -162,27 +157,13 @@ void AsmRoutineManager::Generate() TEST(32, M((void*)&PowerPC::state), Imm32(0xFFFFFFFF)); J_CC(CC_Z, outerLoop, true); -#ifdef _M_IX86 - POP(EDI); - POP(ESI); - POP(EBX); - POP(EBP); -#else //Landing pad for drec space ABI_PopAllCalleeSavedRegsAndAdjustStack(); -#endif RET(); breakpointBailout = GetCodePtr(); -#ifdef _M_IX86 - POP(EDI); - POP(ESI); - POP(EBX); - POP(EBP); -#else //Landing pad for drec space ABI_PopAllCalleeSavedRegsAndAdjustStack(); -#endif RET(); GenerateCommon();