Open NWPlayer123 opened 2 years ago
We have perm_condition: """Change if(x) into if(x != 0), or vice versa. Also handles for/while/do-while."""
Would be nice to extend that!
... although, a separate pass may be better since we could then have it work with comparisons being assigned to variables instead of just being if'd. Leaving perm_condition
for just x
<-> x != 0
which is only valid if the variable is immediately used as a comparison
As seen in https://decomp.me/scratch/zQg5e on line 59, !(==0) or !! produces different codegen than != 0