mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Move another couple of temps into MIPSState
This commit is contained in:
parent
102be8654f
commit
f08c278fd5
2 changed files with 12 additions and 12 deletions
|
@ -224,6 +224,10 @@ public:
|
||||||
// Debug stuff
|
// Debug stuff
|
||||||
u32 debugCount; // can be used to count basic blocks before crashes, etc.
|
u32 debugCount; // can be used to count basic blocks before crashes, etc.
|
||||||
|
|
||||||
|
// Temps needed for JitBranch.cpp experiments
|
||||||
|
u32 intBranchExit;
|
||||||
|
u32 jitBranchExit;
|
||||||
|
|
||||||
static const u32 FCR0_VALUE = 0x00003351;
|
static const u32 FCR0_VALUE = 0x00003351;
|
||||||
|
|
||||||
u8 VfpuWriteMask() const {
|
u8 VfpuWriteMask() const {
|
||||||
|
|
|
@ -77,11 +77,7 @@ namespace MIPSComp
|
||||||
{
|
{
|
||||||
using namespace Gen;
|
using namespace Gen;
|
||||||
|
|
||||||
static u32 intBranchExit;
|
static void JitBranchLog(MIPSOpcode op, u32 pc) {
|
||||||
static u32 jitBranchExit;
|
|
||||||
|
|
||||||
static void JitBranchLog(MIPSOpcode op, u32 pc)
|
|
||||||
{
|
|
||||||
currentMIPS->pc = pc;
|
currentMIPS->pc = pc;
|
||||||
currentMIPS->inDelaySlot = false;
|
currentMIPS->inDelaySlot = false;
|
||||||
|
|
||||||
|
@ -91,15 +87,15 @@ static void JitBranchLog(MIPSOpcode op, u32 pc)
|
||||||
|
|
||||||
// Branch taken, use nextPC.
|
// Branch taken, use nextPC.
|
||||||
if (currentMIPS->inDelaySlot)
|
if (currentMIPS->inDelaySlot)
|
||||||
intBranchExit = currentMIPS->nextPC;
|
currentMIPS->intBranchExit = currentMIPS->nextPC;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Branch not taken, likely delay slot skipped.
|
// Branch not taken, likely delay slot skipped.
|
||||||
if (info & LIKELY)
|
if (info & LIKELY)
|
||||||
intBranchExit = currentMIPS->pc;
|
currentMIPS->intBranchExit = currentMIPS->pc;
|
||||||
// Branch not taken, so increment over delay slot.
|
// Branch not taken, so increment over delay slot.
|
||||||
else
|
else
|
||||||
intBranchExit = currentMIPS->pc + 4;
|
currentMIPS->intBranchExit = currentMIPS->pc + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentMIPS->pc = pc;
|
currentMIPS->pc = pc;
|
||||||
|
@ -110,7 +106,7 @@ static void JitBranchLogMismatch(MIPSOpcode op, u32 pc)
|
||||||
{
|
{
|
||||||
char temp[256];
|
char temp[256];
|
||||||
MIPSDisAsm(op, pc, temp, true);
|
MIPSDisAsm(op, pc, temp, true);
|
||||||
ERROR_LOG(JIT, "Bad jump: %s - int:%08x jit:%08x", temp, intBranchExit, jitBranchExit);
|
ERROR_LOG(JIT, "Bad jump: %s - int:%08x jit:%08x", temp, currentMIPS->intBranchExit, currentMIPS->jitBranchExit);
|
||||||
host->SetDebugMode(true);
|
host->SetDebugMode(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,14 +120,14 @@ void Jit::BranchLogExit(MIPSOpcode op, u32 dest, bool useEAX)
|
||||||
{
|
{
|
||||||
OpArg destArg = useEAX ? R(EAX) : Imm32(dest);
|
OpArg destArg = useEAX ? R(EAX) : Imm32(dest);
|
||||||
|
|
||||||
CMP(32, M(&intBranchExit), destArg);
|
CMP(32, MIPSSTATE_VAR(intBranchExit), destArg);
|
||||||
FixupBranch skip = J_CC(CC_E);
|
FixupBranch skip = J_CC(CC_E);
|
||||||
|
|
||||||
MOV(32, M(&jitBranchExit), destArg);
|
MOV(32, MIPSSTATE_VAR(jitBranchExit), destArg);
|
||||||
ABI_CallFunctionCC(thunks.ProtectFunction(&JitBranchLogMismatch), op.encoding, GetCompilerPC());
|
ABI_CallFunctionCC(thunks.ProtectFunction(&JitBranchLogMismatch), op.encoding, GetCompilerPC());
|
||||||
// Restore EAX, we probably ruined it.
|
// Restore EAX, we probably ruined it.
|
||||||
if (useEAX)
|
if (useEAX)
|
||||||
MOV(32, R(EAX), M(&jitBranchExit));
|
MOV(32, R(EAX), MIPSSTATE_VAR(jitBranchExit));
|
||||||
|
|
||||||
SetJumpTarget(skip);
|
SetJumpTarget(skip);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue