summaryrefslogtreecommitdiff
path: root/src/tools/wasm2asm.cpp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-05-16 18:40:45 -0500
committerAlon Zakai <alonzakai@gmail.com>2018-05-16 16:40:45 -0700
commit3c5a2de669542caebd7ef001db6678b70375f0b5 (patch)
treebbe25d21142627cc04041d7ecbea9d4d15f3a680 /src/tools/wasm2asm.cpp
parentd4aa0d30234ac9e553d743bd881a767d96554a4a (diff)
downloadbinaryen-3c5a2de669542caebd7ef001db6678b70375f0b5.tar.gz
binaryen-3c5a2de669542caebd7ef001db6678b70375f0b5.tar.bz2
binaryen-3c5a2de669542caebd7ef001db6678b70375f0b5.zip
wasm2asm: Implement float<->int conversions (#1550)
This commit lifts the same conversion strategy that `emcc` takes to convert between floats point numbers and integers, and it should implement all the various matrices of i32/u32/i64/u64 to f32/f64 Some refactoring was performed in the i64->i32 pass to allow for temporary variables to get allocated which have types other than i32, but otherwise this contains a pretty direct translation of `emcc`'s operations to `wasm2asm`.
Diffstat (limited to 'src/tools/wasm2asm.cpp')
-rw-r--r--src/tools/wasm2asm.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/wasm2asm.cpp b/src/tools/wasm2asm.cpp
index cc53dc834..2251a332c 100644
--- a/src/tools/wasm2asm.cpp
+++ b/src/tools/wasm2asm.cpp
@@ -39,7 +39,8 @@ int main(int argc, const char *argv[]) {
})
.add("--allow-asserts", "", "Allow compilation of .wast testing asserts",
Options::Arguments::Zero,
- [](Options* o, const std::string& argument) {
+ [&](Options* o, const std::string& argument) {
+ builderFlags.allowAsserts = true;
o->extra["asserts"] = "1";
})
.add("--pedantic", "", "Emulate WebAssembly trapping behavior",