On x86, disabling fastmem isn't enough actually.
Without fastmem, the JIT code still does an inline check for RAM addresses. With watchpoints we have to disable that too. (Hardware watchpoints would avoid all the slow, but be complicated to implement and limited in number - I doubt most people debugging games care much if they run slower.) With this change and watchpoints enabled, Melee runs at no more than 40% speed, despite running at full speed without them. Oh well. Better works slowly than doesn't bloody work. Incidentally, I'm getting an unrelated crash in PowerPC::HostIsRAMAddress when shutting down a game. This code sucks.
This commit is contained in:
parent
b84f6a55ab
commit
dd7ab4812b
|
@ -90,4 +90,6 @@ void JitBase::UpdateMemoryOptions()
|
|||
!any_watchpoints;
|
||||
jo.memcheck = SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU ||
|
||||
any_watchpoints;
|
||||
jo.alwaysUseMemFuncs = any_watchpoints;
|
||||
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ protected:
|
|||
bool accurateSinglePrecision;
|
||||
bool fastmem;
|
||||
bool memcheck;
|
||||
bool alwaysUseMemFuncs;
|
||||
};
|
||||
struct JitState
|
||||
{
|
||||
|
|
|
@ -349,14 +349,17 @@ void EmuCodeBlock::SafeLoadToReg(X64Reg reg_value, const Gen::OpArg & opAddress,
|
|||
LEA(32, RSCRATCH, MDisp(opAddress.GetSimpleReg(), offset));
|
||||
}
|
||||
|
||||
FixupBranch slow, exit;
|
||||
slow = CheckIfSafeAddress(R(reg_value), reg_addr, registersInUse, mem_mask);
|
||||
FixupBranch exit;
|
||||
if (!jit->jo.alwaysUseMemFuncs)
|
||||
{
|
||||
FixupBranch slow = CheckIfSafeAddress(R(reg_value), reg_addr, registersInUse, mem_mask);
|
||||
UnsafeLoadToReg(reg_value, R(reg_addr), accessSize, 0, signExtend);
|
||||
if (farcode.Enabled())
|
||||
SwitchToFarCode();
|
||||
else
|
||||
exit = J(true);
|
||||
SetJumpTarget(slow);
|
||||
}
|
||||
size_t rsp_alignment = (flags & SAFE_LOADSTORE_NO_PROLOG) ? 8 : 0;
|
||||
ABI_PushRegistersAndAdjustStack(registersInUse, rsp_alignment);
|
||||
switch (accessSize)
|
||||
|
@ -387,6 +390,8 @@ void EmuCodeBlock::SafeLoadToReg(X64Reg reg_value, const Gen::OpArg & opAddress,
|
|||
MOVZX(64, accessSize, reg_value, R(ABI_RETURN));
|
||||
}
|
||||
|
||||
if (!jit->jo.alwaysUseMemFuncs)
|
||||
{
|
||||
if (farcode.Enabled())
|
||||
{
|
||||
exit = J(true);
|
||||
|
@ -394,6 +399,7 @@ void EmuCodeBlock::SafeLoadToReg(X64Reg reg_value, const Gen::OpArg & opAddress,
|
|||
}
|
||||
SetJumpTarget(exit);
|
||||
}
|
||||
}
|
||||
|
||||
static OpArg SwapImmediate(int accessSize, OpArg reg_value)
|
||||
{
|
||||
|
|
|
@ -629,6 +629,10 @@ std::string HostGetString(u32 address, size_t size)
|
|||
|
||||
bool IsOptimizableRAMAddress(const u32 address)
|
||||
{
|
||||
#ifdef ENABLE_MEM_CHECK
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (!UReg_MSR(MSR).DR)
|
||||
return false;
|
||||
|
||||
|
@ -752,6 +756,10 @@ void ClearCacheLine(const u32 address)
|
|||
|
||||
u32 IsOptimizableMMIOAccess(u32 address, u32 accessSize)
|
||||
{
|
||||
#ifdef ENABLE_MEM_CHECK
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
if (!UReg_MSR(MSR).DR)
|
||||
return 0;
|
||||
|
||||
|
@ -767,6 +775,10 @@ u32 IsOptimizableMMIOAccess(u32 address, u32 accessSize)
|
|||
|
||||
bool IsOptimizableGatherPipeWrite(u32 address)
|
||||
{
|
||||
#ifdef ENABLE_MEM_CHECK
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (!UReg_MSR(MSR).DR)
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue