| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* Move wasm2asm test outputs into their natural location, test/wasm2asm/
* Let people create new tests in there that ./auto_update_tests.py will auto-generate outputs for, just like all the other tests.
|
|
|
|
|
|
|
| |
The documentation for the simplify-locals pass suggests running
reorder-locals after it to clean up unnecessary locals. wasm2asm wasn't
doing this, which meant that generated code had a number of unused
variables. A good minimizer will probably clean that up, but let's go
ahead and clean it up in wasm2asm itself.
|
|
|
|
|
| |
We were using the global to return 64-bit values from functions, but
said global wasn't actually present in the IR. This omission caused the
generated code to fail validation.
|
|
|
|
|
|
|
|
|
| |
We were using Math_{min,max} in wasm2asm-generated files without
declaring said functions. This decision created problems for tests,
because Math_min (resp. max) would first be used on f32s, thus returning
f32, and then validation would fail when it was used on f64s.
The resulting changes make wasm2asm tests pass with MOZJS asm.js
validation, which moves #1443 forward.
|
|
|
|
| |
This change eliminates one issue that prevents asm.js validation of the
generated code, see #1443.
|
|
|
|
|
|
| |
Also refactors mangling to its own file so it can be reused by generators and consumers, i.e., where it is important to know that an import must be named 'switch_' where it otherwise would be 'switch'.
* Update tests and JS dist files
|
|
|
|
| |
los of extra inefficient variables. this is more similar to the output we had before the flatten rewrite (#1229)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename flatten-control-flow to flatten, which now flattens everything, not just control flow, so e.g.
(i32.add
(call $x)
(call $y)
)
==>
(block
(set_local $temp_x (call $x))
(set_local $temp_y (call $y))
(i32.add
(get_local $x)
(get_local $y)
)
)
This uses more locals than before, but is much simpler and avoids a bunch of corner cases and fuzz bugs the old one hit. We can optimize later if necessary.
|
|
|
|
|
|
| |
* Refactor i64 lowering to use RAII temp vars
* Always generate trampoline blocks for Switch lowering
|
|
|
|
|
|
|
|
| |
* if a block has a concrete final element (or a break with a value), then even if it has an unreachable child, keep it with that concrete type. this means we no longe allow the silly case of a block with an unreachable in the middle and a concrete as the final element while the block is unreachable - after this change, the block would have the type of the final element
* if an if has a concrete element in one arm, make it have that type as a result, even if the if condition is unreachable, to parallel block
* make type rules for brs and switches simpler, ignore whether they are reachable or not. whether they are dead code should not affect how they influence other types in our IR.
|
|
|