Aligned the stack before calling the LoadStorePaired asm functions. Fixes issue 2053.

The Linux x64 change is untested and has been commented out.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5118 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau 2010-02-24 08:30:50 +00:00
parent 1d40b8a5ae
commit dc9d533d4f
1 changed files with 42 additions and 0 deletions

View File

@ -115,11 +115,39 @@ void Jit64::psq_st(UGeckoInstruction inst)
// One value
XORPS(XMM0, R(XMM0)); // TODO: See if we can get rid of this cheaply by tweaking the code in the singleStore* functions.
CVTSD2SS(XMM0, fpr.R(s));
#ifdef _M_X64
#if _WIN32
SUB(64, R(RSP), Imm8(0x28));
#else
//SUB(64, R(RSP), Imm8(0x8));
#endif
#endif
CALLptr(MDisp(EDX, (u32)(u64)asm_routines.singleStoreQuantized));
#ifdef _M_X64
#if _WIN32
ADD(64, R(RSP), Imm8(0x28));
#else
//ADD(64, R(RSP), Imm8(0x8));
#endif
#endif
} else {
// Pair of values
CVTPD2PS(XMM0, fpr.R(s));
#ifdef _M_X64
#if _WIN32
SUB(64, R(RSP), Imm8(0x28));
#else
//SUB(64, R(RSP), Imm8(0x8));
#endif
#endif
CALLptr(MDisp(EDX, (u32)(u64)asm_routines.pairedStoreQuantized));
#ifdef _M_X64
#if _WIN32
ADD(64, R(RSP), Imm8(0x28));
#else
//ADD(64, R(RSP), Imm8(0x8));
#endif
#endif
}
gpr.UnlockAll();
gpr.UnlockAllX();
@ -164,8 +192,22 @@ void Jit64::psq_l(UGeckoInstruction inst)
SHL(32, R(EDX), Imm8(2));
#else
SHL(32, R(EDX), Imm8(3));
#endif
#ifdef _M_X64
#if _WIN32
SUB(64, R(RSP), Imm8(0x28));
#else
//SUB(64, R(RSP), Imm8(0x8));
#endif
#endif
CALLptr(MDisp(EDX, (u32)(u64)asm_routines.pairedLoadQuantized));
#ifdef _M_X64
#if _WIN32
ADD(64, R(RSP), Imm8(0x28));
#else
//ADD(64, R(RSP), Imm8(0x8));
#endif
#endif
CVTPS2PD(fpr.RX(inst.RS), R(XMM0));
gpr.UnlockAll();
gpr.UnlockAllX();