mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
For floats: When const >= function.max, comparisons of function > const always yield FALSE. When const < function.min, comparisons of function > const always yield TRUE. When const > function.max, comparisons of function < const always yield TRUE. When const <= function.min, comparisons of function < const always yield FALSE. For integers: When min = -1, cond(function > -1) is the same as cond(!~function). When min = -1, cond(function < 0) is the same as cond(~function). To implement the above, we got rid of the cond(x < 0) -> cond(x & 0x80000000) optimization, which has caused more trouble than it has solved for just 1 byte gain. When min = 0, cond(function > 0) is the same as cond(function). When min = 0, cond(function < 1) is the same as cond(!function). Similar expressions can be obtained for max in [-1, 0], but it's not worth it, as there are no functions with -1 as maximum, and the ones with max=0 also have min=0 (always return 0). |
||
---|---|---|
.. | ||
__init__.py | ||
lslbasefuncs.py | ||
lslcommon.py | ||
lsldeadcode.py | ||
lslextrafuncs.py | ||
lslfoldconst.py | ||
lslfuncopt.py | ||
lslfuncs.py | ||
lsljson.py | ||
lsllastpass.py | ||
lslloadlib.py | ||
lsloptimizer.py | ||
lsloutput.py | ||
lslparse.py | ||
lslrenamer.py |