mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
32-bit build fix, proper fix for lfd. THP glitches are gone! (at least in the games I tried)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@997 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -85,7 +85,11 @@ LONG NTAPI Handler(PEXCEPTION_POINTERS pPtrs)
|
|||||||
// We no longer touch Rip, since we return back to the instruction, after overwriting it with a
|
// We no longer touch Rip, since we return back to the instruction, after overwriting it with a
|
||||||
// trampoline jump and some nops
|
// trampoline jump and some nops
|
||||||
if (new_rip)
|
if (new_rip)
|
||||||
|
#ifdef _M_X64
|
||||||
ctx->Rip = (DWORD_PTR)new_rip;
|
ctx->Rip = (DWORD_PTR)new_rip;
|
||||||
|
#else
|
||||||
|
ctx->Eip = (DWORD_PTR)new_rip;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return (DWORD)EXCEPTION_CONTINUE_EXECUTION;
|
return (DWORD)EXCEPTION_CONTINUE_EXECUTION;
|
||||||
|
|
||||||
|
@ -189,6 +189,8 @@ u8 *BackPatch(u8 *codePtr, int accessType, u32 emAddress, CONTEXT *ctx)
|
|||||||
return codePtr - 2;
|
return codePtr - 2;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,8 +104,6 @@ void lfs(UGeckoInstruction inst)
|
|||||||
|
|
||||||
void lfd(UGeckoInstruction inst)
|
void lfd(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
Default(inst);
|
|
||||||
return;
|
|
||||||
#ifdef JIT_OFF_OPTIONS
|
#ifdef JIT_OFF_OPTIONS
|
||||||
if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreFloatingOff)
|
if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreFloatingOff)
|
||||||
{Default(inst); return;} // turn off from debugger
|
{Default(inst); return;} // turn off from debugger
|
||||||
@ -125,26 +123,30 @@ void lfd(UGeckoInstruction inst)
|
|||||||
gpr.FlushLockX(ABI_PARAM1);
|
gpr.FlushLockX(ABI_PARAM1);
|
||||||
gpr.Lock(a);
|
gpr.Lock(a);
|
||||||
MOV(32, R(ABI_PARAM1), gpr.R(a));
|
MOV(32, R(ABI_PARAM1), gpr.R(a));
|
||||||
fpr.LoadToX64(d, false);
|
// TODO - optimize. This has to load the previous value - upper double should stay unmodified.
|
||||||
|
fpr.LoadToX64(d, true);
|
||||||
fpr.Lock(d);
|
fpr.Lock(d);
|
||||||
if (cpu_info.bSSSE3) {
|
if (cpu_info.bSSSE3) {
|
||||||
X64Reg xd = fpr.RX(d);
|
X64Reg xd = fpr.RX(d);
|
||||||
#ifdef _M_X64
|
#ifdef _M_X64
|
||||||
MOVQ_xmm(xd, MComplex(RBX, ABI_PARAM1, SCALE_1, offset));
|
MOVQ_xmm(XMM0, MComplex(RBX, ABI_PARAM1, SCALE_1, offset));
|
||||||
#else
|
#else
|
||||||
MOV(32, R(EAX), R(ABI_PARAM1));
|
MOV(32, R(EAX), R(ABI_PARAM1));
|
||||||
AND(32, R(EAX), Imm32(Memory::MEMVIEW32_MASK));
|
AND(32, R(EAX), Imm32(Memory::MEMVIEW32_MASK));
|
||||||
MOVQ_xmm(xd, MDisp(EAX, (u32)Memory::base + offset));
|
MOVQ_xmm(XMM0, MDisp(EAX, (u32)Memory::base + offset));
|
||||||
#endif
|
#endif
|
||||||
PSHUFB(xd, M((void *)bswapShuffle1x8Dupe));
|
PSHUFB(XMM0, M((void *)bswapShuffle1x8Dupe));
|
||||||
|
MOVSD(xd, R(XMM0));
|
||||||
} else {
|
} else {
|
||||||
#ifndef _M_X64
|
#ifndef _M_X64
|
||||||
PanicAlert("lfd - wtf");
|
PanicAlert("lfd - wtf");
|
||||||
#endif
|
#endif
|
||||||
|
X64Reg xd = fpr.RX(d);
|
||||||
MOV(64, R(EAX), MComplex(RBX, ABI_PARAM1, SCALE_1, offset));
|
MOV(64, R(EAX), MComplex(RBX, ABI_PARAM1, SCALE_1, offset));
|
||||||
BSWAP(64, EAX);
|
BSWAP(64, EAX);
|
||||||
MOV(64, M(&temp64), R(EAX));
|
MOV(64, M(&temp64), R(EAX));
|
||||||
MOVDDUP(fpr.RX(d), M(&temp64));
|
MOVSD(XMM0, M(&temp64));
|
||||||
|
MOVSD(xd, R(XMM0));
|
||||||
}
|
}
|
||||||
gpr.UnlockAll();
|
gpr.UnlockAll();
|
||||||
gpr.UnlockAllX();
|
gpr.UnlockAllX();
|
||||||
|
Reference in New Issue
Block a user