VarAction2: Remove mul and div operations with constant 1

This commit is contained in:
Jonathan G Rennison
2022-10-08 22:14:39 +01:00
parent 669b3f2e04
commit 419c356f30
2 changed files with 17 additions and 0 deletions

View File

@@ -225,6 +225,19 @@ inline bool IsEvalAdjustWithZeroAlwaysZero(DeterministicSpriteGroupAdjustOperati
}
}
inline bool IsEvalAdjustWithOneRemovable(DeterministicSpriteGroupAdjustOperation op)
{
switch (op) {
case DSGA_OP_MUL:
case DSGA_OP_SDIV:
case DSGA_OP_UDIV:
return true;
default:
return false;
}
}
inline bool IsEvalAdjustWithSideEffects(DeterministicSpriteGroupAdjustOperation op)
{
switch (op) {