SwadicalRag / wasm2lua

wasm2lua: converting WASM into Lua
MIT License
190 stars 10 forks source link

Comparison Folding #16

Open MDFL64 opened 5 years ago

MDFL64 commented 5 years ago

Currently the results of comparison operations are always converted to integers, then converted back to bools when testing a conditional branch. We should store the comparison results as bools, and only convert between integers and bools if necessary. We should also try to fold the comparisons straight into conditional tests, since LuaJIT bytecode is designed to jump on comparisons.