Skip to content

Commit

Permalink
DoJit
Browse files Browse the repository at this point in the history
  • Loading branch information
MerryMage committed Oct 28, 2018
1 parent 4443b36 commit c896d41
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions Source/Core/Core/PowerPC/Jit64/Jit.cpp
Expand Up @@ -800,13 +800,17 @@ u8* Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
ProcessorInterface::INT_CAUSE_PE_FINISH));
FixupBranch noCPInt = J_CC(CC_Z, true);

gpr.Flush(RegCache::FlushMode::MaintainState);
fpr.Flush(RegCache::FlushMode::MaintainState);
{
RCForkGuard gpr_guard = gpr.Fork();
RCForkGuard fpr_guard = fpr.Fork();

MOV(32, PPCSTATE(pc), Imm32(op.address));
WriteExternalExceptionExit();
SwitchToNearCode();
gpr.Flush();
fpr.Flush();

MOV(32, PPCSTATE(pc), Imm32(op.address));
WriteExternalExceptionExit();
}
SwitchToNearCode();
SetJumpTarget(noCPInt);
SetJumpTarget(noExtIntEnable);
}
Expand All @@ -824,14 +828,19 @@ u8* Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)

SwitchToFarCode();
SetJumpTarget(b1);
gpr.Flush(RegCache::FlushMode::MaintainState);
fpr.Flush(RegCache::FlushMode::MaintainState);
{
RCForkGuard gpr_guard = gpr.Fork();
RCForkGuard fpr_guard = fpr.Fork();

// If a FPU exception occurs, the exception handler will read
// from PC. Update PC with the latest value in case that happens.
MOV(32, PPCSTATE(pc), Imm32(op.address));
OR(32, PPCSTATE(Exceptions), Imm32(EXCEPTION_FPU_UNAVAILABLE));
WriteExceptionExit();
gpr.Flush();
fpr.Flush();

// If a FPU exception occurs, the exception handler will read
// from PC. Update PC with the latest value in case that happens.
MOV(32, PPCSTATE(pc), Imm32(op.address));
OR(32, PPCSTATE(Exceptions), Imm32(EXCEPTION_FPU_UNAVAILABLE));
WriteExceptionExit();
}
SwitchToNearCode();

js.firstFPInstructionFound = true;
Expand Down

0 comments on commit c896d41

Please sign in to comment.