mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 17:49:48 -06:00
DSPInterpreter: Fix IsLess
`IsLess` would incorrectly return true if both `SR_OVERFLOW` and `SR_SIGN` are set, as `(sr & SR_OVERFLOW) != (sr & SR_SIGN)` becomes `SR_OVERFLOW != SR_SIGN` which is true as the two masks are different. This broke in e651592ef5
.
This issue only affected the DSP LLE Interpreter, and not the DSP LLE JIT.
I've also included a simple test case for this. `ax0.l` (on the top left) is set to 0 if the instruction following `IFL` does not execute and to 1 if it is executed.
This commit is contained in:
@ -250,10 +250,7 @@ bool Interpreter::CheckCondition(u8 condition) const
|
||||
const auto IsCarry = [this] { return IsSRFlagSet(SR_CARRY); };
|
||||
const auto IsOverflow = [this] { return IsSRFlagSet(SR_OVERFLOW); };
|
||||
const auto IsOverS32 = [this] { return IsSRFlagSet(SR_OVER_S32); };
|
||||
const auto IsLess = [this] {
|
||||
const auto& state = m_dsp_core.DSPState();
|
||||
return (state.r.sr & SR_OVERFLOW) != (state.r.sr & SR_SIGN);
|
||||
};
|
||||
const auto IsLess = [this] { return IsSRFlagSet(SR_OVERFLOW) != IsSRFlagSet(SR_SIGN); };
|
||||
const auto IsZero = [this] { return IsSRFlagSet(SR_ARITH_ZERO); };
|
||||
const auto IsLogicZero = [this] { return IsSRFlagSet(SR_LOGIC_ZERO); };
|
||||
const auto IsConditionA = [this] {
|
||||
|
Reference in New Issue
Block a user