VarAction2: Detect and replace signed relational comparisons

This commit is contained in:
Jonathan G Rennison
2022-05-25 23:58:44 +01:00
parent e732042785
commit 90a2aa57fc
3 changed files with 70 additions and 9 deletions

View File

@@ -164,10 +164,17 @@ enum DeterministicSpriteGroupAdjustOperation {
DSGA_OP_TERNARY = 0x80, ///< a == 0 ? b : c,
DSGA_OP_EQ, ///< a == b ? 1 : 0,
DSGA_OP_SLT, ///< (signed) a < b ? 1 : 0,
DSGA_OP_SGE, ///< (signed) a >= b ? 1 : 0,
DSGA_OP_SLE, ///< (signed) a <= b ? 1 : 0,
DSGA_OP_SGT, ///< (signed) a > b ? 1 : 0,
DSGA_OP_SPECIAL_END,
};
static_assert((DSGA_OP_SLT ^ 1) == DSGA_OP_SGE);
static_assert((DSGA_OP_SLE ^ 1) == DSGA_OP_SGT);
inline bool IsEvalAdjustWithZeroRemovable(DeterministicSpriteGroupAdjustOperation op)
{
switch (op) {