Fixed the LI and LIS PPC instructions in the JIT. This fixes MGS:TS Konami logo hang.
Made the JIT sanity checks more informative. Sanity checks are now only performed in the DEBUG and DEBUGFAST builds. This gives a tiny speed-up for everyone else. Fixes issue 2187. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5378 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
060eed80c1
commit
3b35cb12f2
|
@ -23,7 +23,7 @@
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
// Enable memory checks in the Debug/DebugFast builds, but NOT in release
|
// Enable memory checks in the Debug/DebugFast builds, but NOT in release
|
||||||
#if _DEBUG || DEBUGFAST
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
#define ENABLE_MEM_CHECK
|
#define ENABLE_MEM_CHECK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -567,8 +567,15 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
|
||||||
if (!ops[i].skip)
|
if (!ops[i].skip)
|
||||||
Jit64Tables::CompileInstruction(ops[i].inst);
|
Jit64Tables::CompileInstruction(ops[i].inst);
|
||||||
|
|
||||||
gpr.SanityCheck();
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
fpr.SanityCheck();
|
if (gpr.SanityCheck() || fpr.SanityCheck())
|
||||||
|
{
|
||||||
|
char ppcInst[256];
|
||||||
|
DisassembleGekko(ops[i].inst.hex, em_address, ppcInst, 256);
|
||||||
|
NOTICE_LOG(DYNA_REC, "Unflushed reg: %s", ppcInst);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (js.cancel)
|
if (js.cancel)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,21 +163,22 @@ void RegCache::FlushR(X64Reg reg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegCache::SanityCheck() const
|
int RegCache::SanityCheck() const
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 32; i++) {
|
for (int i = 0; i < 32; i++) {
|
||||||
if (regs[i].away) {
|
if (regs[i].away) {
|
||||||
if (regs[i].location.IsSimpleReg()) {
|
if (regs[i].location.IsSimpleReg()) {
|
||||||
Gen::X64Reg simple = regs[i].location.GetSimpleReg();
|
Gen::X64Reg simple = regs[i].location.GetSimpleReg();
|
||||||
if (xlocks[simple]) {
|
if (xlocks[simple])
|
||||||
PanicAlert("%08x : PPC Reg %i is in locked x64 register %i", /*js.compilerPC*/ 0, i, regs[i].location.GetSimpleReg());
|
return 1;
|
||||||
}
|
if (xregs[simple].ppcReg != i)
|
||||||
if (xregs[simple].ppcReg != i) {
|
return 2;
|
||||||
PanicAlert("%08x : Xreg/ppcreg mismatch");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else if (regs[i].location.IsImm())
|
||||||
|
return 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegCache::DiscardRegContentsIfCached(int preg)
|
void RegCache::DiscardRegContentsIfCached(int preg)
|
||||||
|
@ -397,7 +398,7 @@ void RegCache::Flush(FlushMode mode)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_assert_msg_(DYNA_REC,0,"Jit64 - Flush unhandled case, reg %i", i);
|
_assert_msg_(DYNA_REC,0,"Jit64 - Flush unhandled case, reg %i PC: %08x", i, PC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ public:
|
||||||
}
|
}
|
||||||
virtual void Flush(FlushMode mode);
|
virtual void Flush(FlushMode mode);
|
||||||
virtual void Flush(PPCAnalyst::CodeOp *op) {Flush(FLUSH_ALL);}
|
virtual void Flush(PPCAnalyst::CodeOp *op) {Flush(FLUSH_ALL);}
|
||||||
void SanityCheck() const;
|
int SanityCheck() const;
|
||||||
void KillImmediate(int preg);
|
void KillImmediate(int preg);
|
||||||
|
|
||||||
//TODO - instead of doload, use "read", "write"
|
//TODO - instead of doload, use "read", "write"
|
||||||
|
|
|
@ -71,6 +71,7 @@ void Jit64::regimmop(int d, int a, bool binary, u32 value, Operation doop, void
|
||||||
{
|
{
|
||||||
// a == 0, which for these instructions imply value = 0
|
// a == 0, which for these instructions imply value = 0
|
||||||
gpr.SetImmediate32(d, value);
|
gpr.SetImmediate32(d, value);
|
||||||
|
gpr.StoreFromX64(d);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue