Jit64: Add optional argument to GenerateOverflow

This allows setting the overflow flag based on any condition code.
Defaults to NO (no overflow).
This commit is contained in:
Sintendo 2021-02-25 23:22:17 +01:00
parent 5f7d935b0a
commit 2454bd5ba6
2 changed files with 3 additions and 3 deletions

View File

@ -96,7 +96,7 @@ public:
void GenerateConstantOverflow(bool overflow);
void GenerateConstantOverflow(s64 val);
void GenerateOverflow();
void GenerateOverflow(Gen::CCFlags cond = Gen::CCFlags::CC_NO);
void FinalizeCarryOverflow(bool oe, bool inv = false);
void FinalizeCarry(Gen::CCFlags cond);
void FinalizeCarry(bool ca);

View File

@ -42,9 +42,9 @@ void Jit64::GenerateConstantOverflow(bool overflow)
}
// We could do overflow branchlessly, but unlike carry it seems to be quite a bit rarer.
void Jit64::GenerateOverflow()
void Jit64::GenerateOverflow(Gen::CCFlags cond)
{
FixupBranch jno = J_CC(CC_NO);
FixupBranch jno = J_CC(cond);
// XER[OV/SO] = 1
MOV(8, PPCSTATE(xer_so_ov), Imm8(XER_OV_MASK | XER_SO_MASK));
FixupBranch exit = J();