From 1b43900f30f51b765d599490c5a07a723da28344 Mon Sep 17 00:00:00 2001 From: skidau Date: Wed, 24 Feb 2010 20:06:13 +0000 Subject: [PATCH] Applied the fix from r5118 to the JIT IL recompiler. Enabled the fix on Linux x64. Aligned the stack before calling the LoadStorePaired asm functions. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5122 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp | 12 ++++---- .../Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp | 28 +++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp index d6cb415d03..f5011716f0 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp @@ -119,7 +119,7 @@ void Jit64::psq_st(UGeckoInstruction inst) #if _WIN32 SUB(64, R(RSP), Imm8(0x28)); #else - //SUB(64, R(RSP), Imm8(0x8)); + SUB(64, R(RSP), Imm8(0x8)); #endif #endif CALLptr(MDisp(EDX, (u32)(u64)asm_routines.singleStoreQuantized)); @@ -127,7 +127,7 @@ void Jit64::psq_st(UGeckoInstruction inst) #if _WIN32 ADD(64, R(RSP), Imm8(0x28)); #else - //ADD(64, R(RSP), Imm8(0x8)); + ADD(64, R(RSP), Imm8(0x8)); #endif #endif } else { @@ -137,7 +137,7 @@ void Jit64::psq_st(UGeckoInstruction inst) #if _WIN32 SUB(64, R(RSP), Imm8(0x28)); #else - //SUB(64, R(RSP), Imm8(0x8)); + SUB(64, R(RSP), Imm8(0x8)); #endif #endif CALLptr(MDisp(EDX, (u32)(u64)asm_routines.pairedStoreQuantized)); @@ -145,7 +145,7 @@ void Jit64::psq_st(UGeckoInstruction inst) #if _WIN32 ADD(64, R(RSP), Imm8(0x28)); #else - //ADD(64, R(RSP), Imm8(0x8)); + ADD(64, R(RSP), Imm8(0x8)); #endif #endif } @@ -197,7 +197,7 @@ void Jit64::psq_l(UGeckoInstruction inst) #if _WIN32 SUB(64, R(RSP), Imm8(0x28)); #else - //SUB(64, R(RSP), Imm8(0x8)); + SUB(64, R(RSP), Imm8(0x8)); #endif #endif CALLptr(MDisp(EDX, (u32)(u64)asm_routines.pairedLoadQuantized)); @@ -205,7 +205,7 @@ void Jit64::psq_l(UGeckoInstruction inst) #if _WIN32 ADD(64, R(RSP), Imm8(0x28)); #else - //ADD(64, R(RSP), Imm8(0x8)); + ADD(64, R(RSP), Imm8(0x8)); #endif #endif CVTPS2PD(fpr.RX(inst.RS), R(XMM0)); diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp index 26aa327b5f..c4b87ce49d 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp @@ -1185,7 +1185,21 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak Jit->SHL(32, R(EDX), Imm8(3)); #endif Jit->MOV(32, R(ECX), regLocForInst(RI, getOp1(I))); +#ifdef _M_X64 +#if _WIN32 + Jit->SUB(64, R(RSP), Imm8(0x28)); +#else + Jit->SUB(64, R(RSP), Imm8(0x8)); +#endif +#endif Jit->CALLptr(MDisp(EDX, (u32)(u64)(((JitIL *)jit)->asm_routines.pairedLoadQuantized))); +#ifdef _M_X64 +#if _WIN32 + Jit->ADD(64, R(RSP), Imm8(0x28)); +#else + Jit->ADD(64, R(RSP), Imm8(0x8)); +#endif +#endif Jit->MOVAPD(reg, R(XMM0)); RI.fregs[reg] = I; regNormalRegClear(RI, I); @@ -1244,7 +1258,21 @@ static void DoWriteCode(IRBuilder* ibuild, JitIL* Jit, bool UseProfile, bool Mak #endif Jit->MOV(32, R(ECX), regLocForInst(RI, getOp2(I))); Jit->MOVAPD(XMM0, fregLocForInst(RI, getOp1(I))); +#ifdef _M_X64 +#if _WIN32 + Jit->SUB(64, R(RSP), Imm8(0x28)); +#else + Jit->SUB(64, R(RSP), Imm8(0x8)); +#endif +#endif Jit->CALLptr(MDisp(EDX, (u32)(u64)(((JitIL *)jit)->asm_routines.pairedStoreQuantized))); +#ifdef _M_X64 +#if _WIN32 + Jit->ADD(64, R(RSP), Imm8(0x28)); +#else + Jit->ADD(64, R(RSP), Imm8(0x8)); +#endif +#endif if (RI.IInfo[I - RI.FirstI] & 4) fregClearInst(RI, getOp1(I)); if (RI.IInfo[I - RI.FirstI] & 8)