Reordered the safe write path of the stfd instruction.

This commit is contained in:
skidau 2012-01-03 10:20:20 +11:00 committed by calc84maniac
parent daf7e96521
commit 32755aa48c
1 changed files with 10 additions and 4 deletions

View File

@ -172,6 +172,11 @@ void Jit64::stfd(UGeckoInstruction inst)
int s = inst.RS;
int a = inst.RA;
if (!a)
{
Default(inst);
return;
}
u32 mem_mask = Memory::ADDR_MASK_HW_ACCESS;
if (Core::g_CoreStartupParameter.bMMU ||
@ -219,14 +224,15 @@ void Jit64::stfd(UGeckoInstruction inst)
// Safe but slow routine
MOVAPD(XMM0, fpr.R(s));
MOVD_xmm(R(EAX), XMM0);
SafeWriteRegToReg(EAX, ABI_PARAM1, 32, 4);
PSRLQ(XMM0, 32);
MOVD_xmm(R(EAX), XMM0);
LEA(32, ABI_PARAM1, MDisp(gpr.R(a).GetSimpleReg(), offset));
SafeWriteRegToReg(EAX, ABI_PARAM1, 32, 0);
MOVAPD(XMM0, fpr.R(s));
MOVD_xmm(R(EAX), XMM0);
LEA(32, ABI_PARAM1, MDisp(gpr.R(a).GetSimpleReg(), offset));
SafeWriteRegToReg(EAX, ABI_PARAM1, 32, 4);
SetJumpTarget(exit);
gpr.UnlockAll();