Fixed the crash in DSP LLE JIT on x64 by aligning the stack.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5357 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau committed 2010-04-13 10:18:05 +00:00
1 parent 379c469343
commit 122d5e7b4e
4 files changed
+37 -87

No files matched your search

@@ -117,39 +117,15 @@ 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
ABI_AlignStack(0);
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
ABI_RestoreStack(0);
} 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
ABI_AlignStack(0);
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
ABI_RestoreStack(0);
}
gpr.UnlockAll();
gpr.UnlockAllX();
@@ -195,21 +171,9 @@ void Jit64::psq_l(UGeckoInstruction inst)
#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
ABI_AlignStack(0);
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
ABI_RestoreStack(0);
CVTPS2PD(fpr.RX(inst.RS), R(XMM0));
gpr.UnlockAll();
gpr.UnlockAllX();
@@ -1185,21 +1185,9 @@ 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->ABI_AlignStack(0);
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->ABI_RestoreStack(0);
Jit->MOVAPD(reg, R(XMM0));
RI.fregs[reg] = I;
regNormalRegClear(RI, I);
@@ -1258,21 +1246,9 @@ 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->ABI_AlignStack(0);
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
Jit->ABI_RestoreStack(0);
if (RI.IInfo[I - RI.FirstI] & 4)
fregClearInst(RI, getOp1(I));
if (RI.IInfo[I - RI.FirstI] & 8)