JIT: fix carry merging across breakpoints

More precisely, don't do it.
This commit is contained in:
Fiora 2014-09-26 13:21:01 -07:00
parent 943383c30e
commit 39d4306a2e
3 changed files with 5 additions and 1 deletions

View File

@ -624,6 +624,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
// WARNING - cmp->branch merging will screw this up. // WARNING - cmp->branch merging will screw this up.
js.isLastInstruction = true; js.isLastInstruction = true;
js.next_inst = 0; js.next_inst = 0;
js.next_inst_bp = false;
if (Profiler::g_ProfileBlocks) if (Profiler::g_ProfileBlocks)
{ {
// CAUTION!!! push on stack regs you use, do your stuff, then pop // CAUTION!!! push on stack regs you use, do your stuff, then pop
@ -641,6 +642,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
js.next_inst = ops[i + 1].inst; js.next_inst = ops[i + 1].inst;
js.next_compilerPC = ops[i + 1].address; js.next_compilerPC = ops[i + 1].address;
js.next_op = &ops[i + 1]; js.next_op = &ops[i + 1];
js.next_inst_bp = SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging && breakpoints.IsAddressBreakPoint(ops[i + 1].address);
} }
if (jo.optimizeGatherPipe && js.fifoBytesThisBlock >= 32) if (jo.optimizeGatherPipe && js.fifoBytesThisBlock >= 32)

View File

@ -52,7 +52,8 @@ void Jit64::FinalizeCarry(CCFlags cond)
js.carryFlagInverted = false; js.carryFlagInverted = false;
if (js.op->wantsCA) if (js.op->wantsCA)
{ {
if (js.next_op->wantsCAInFlags) // Be careful: a breakpoint kills flags in between instructions
if (js.next_op->wantsCAInFlags && !js.next_inst_bp)
{ {
if (cond == CC_C || cond == CC_NC) if (cond == CC_C || cond == CC_NC)
{ {

View File

@ -84,6 +84,7 @@ protected:
bool skipnext; bool skipnext;
bool carryFlagSet; bool carryFlagSet;
bool carryFlagInverted; bool carryFlagInverted;
bool next_inst_bp;
int fifoBytesThisBlock; int fifoBytesThisBlock;