Rerumu / Wasynth

WebAssembly to Lua translation library and tool
https://discord.gg/sgm5YcmgyD
GNU General Public License v3.0
130 stars 18 forks source link

Various Numeric & runtime improvements for `f64` and `u32` #9

Closed Hexcede closed 2 years ago

Hexcede commented 2 years ago

This PR fixes several implementation issues in numeric.lua and runtime.lua and migrates math.min and math.max to runtime.lua to account for luau discrepancy (math.min(0, NaN) and math.max(0, NaN) return 0 instead of NaN)

This allows the f64.wast test to pass along with three others (33 passing tests -> 37 including f64.wast)

Hexcede commented 2 years ago

@Rerumu I believe I have made the requested changes. I have additionally added a bit_band local to runtime which fixes its usage in i32_i16.