We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://webassembly.studio/?f=oeg02m22gmq
export function add_div(x: i32): i32 { return u32(x) / 100 + x / -100; }
output:
function main_add_div($0) { $0 = $0 | 0; return (($0 | 0) / (-100 | 0) | 0) + (($0 >>> 0) / (100 >>> 0) | 0) | 0 | 0; }
but I'm expecting single | 0 at the end:
| 0
function main_add_div($0) { $0 = $0 | 0; return (($0 | 0) / (-100 | 0) | 0) + (($0 >>> 0) / (100 >>> 0) | 0) | 0; }
similar here but after extra optimizations it normalized to expected. But I guess it could be done earlier without extra opts?
also since asm2js is more like js code and less than asm.js could we simplify some conversion? Like this one:
function i32_trunc_u_f32($0) { $0 = Math_fround($0); return ~~$0 >>> 0 | 0; }
could be just:
function i32_trunc_u_f32($0) { $0 = Math_fround($0); return $0 | 0; }
And Closure Compiler can't do such optimizations btw
The text was updated successfully, but these errors were encountered:
Could be a missing optimization. Those are written in src/tools/wasm2js.cpp:optimizeJS().
src/tools/wasm2js.cpp
optimizeJS()
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Uh oh!
There was an error while loading. Please reload this page.
https://webassembly.studio/?f=oeg02m22gmq
output:
but I'm expecting single
| 0
at the end:similar here
but after extra optimizations it normalized to expected. But I guess it could be done earlier without extra opts?
also since asm2js is more like js code and less than asm.js could we simplify some conversion? Like this one:
could be just:
And Closure Compiler can't do such optimizations btw
The text was updated successfully, but these errors were encountered: