mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-15 19:59:53 +00:00
Merge pull request #14188 from JosJuice/jit64-flush-carry
Jit64: Flush carry flag in FallBackToInterpreter
This commit is contained in:
commit
582d5cfe96
@ -351,6 +351,7 @@ void Jit64::Shutdown()
|
||||
|
||||
void Jit64::FallBackToInterpreter(UGeckoInstruction inst)
|
||||
{
|
||||
FlushCarry();
|
||||
gpr.Flush(BitSet32(0xFFFFFFFF), RegCache::IgnoreDiscardedRegisters::Yes);
|
||||
fpr.Flush(BitSet32(0xFFFFFFFF), RegCache::IgnoreDiscardedRegisters::Yes);
|
||||
|
||||
|
||||
@ -124,6 +124,7 @@ public:
|
||||
void FinalizeCarryOverflow(bool oe, bool inv = false);
|
||||
void FinalizeCarry(Gen::CCFlags cond);
|
||||
void FinalizeCarry(bool ca);
|
||||
void FlushCarry();
|
||||
void ComputeRC(preg_t preg, bool needs_test = true, bool needs_sext = true);
|
||||
void FinalizeImmediateRC(s32 value);
|
||||
|
||||
|
||||
@ -137,6 +137,25 @@ void Jit64::FinalizeCarryOverflow(bool oe, bool inv)
|
||||
FinalizeCarry(inv ? CC_NC : CC_C);
|
||||
}
|
||||
|
||||
void Jit64::FlushCarry()
|
||||
{
|
||||
switch (js.carryFlag)
|
||||
{
|
||||
case CarryFlag::InPPCState:
|
||||
break;
|
||||
case CarryFlag::InHostCarry:
|
||||
JitSetCAIf(CC_C);
|
||||
UnlockFlags();
|
||||
break;
|
||||
case CarryFlag::InHostCarryInverted:
|
||||
JitSetCAIf(CC_NC);
|
||||
UnlockFlags();
|
||||
break;
|
||||
}
|
||||
|
||||
js.carryFlag = CarryFlag::InPPCState;
|
||||
}
|
||||
|
||||
// Be careful; only set needs_test to false if we can be absolutely sure flags don't need
|
||||
// to be recalculated and haven't been clobbered. Keep in mind not all instructions set
|
||||
// sufficient flags -- for example, the flags from SHL/SHR are *not* sufficient for LT/GT
|
||||
|
||||
Loading…
Reference in New Issue
Block a user