diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-17 20:35:29 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-17 20:35:29 -0800 |
commit | 65db7e5e8f3994a7d4ca1b4e01f87eef13c7c87b (patch) | |
tree | 35b7ad54cc0739838406fd86346a0b9389676d26 | |
parent | 875df2b921ae704a3a820b2922ce732fc574d727 (diff) | |
download | binaryen-65db7e5e8f3994a7d4ca1b4e01f87eef13c7c87b.tar.gz binaryen-65db7e5e8f3994a7d4ca1b4e01f87eef13c7c87b.tar.bz2 binaryen-65db7e5e8f3994a7d4ca1b4e01f87eef13c7c87b.zip |
handle + as a float-to-double conversion
-rw-r--r-- | src/asm2wasm.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index a81f4af68..08f4e4141 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -773,6 +773,13 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { ret->type = WasmType::f64; return ret; } + if (childType == ASM_FLOAT) { + auto ret = allocator.alloc<Convert>(); + ret->op = PromoteFloat32; + ret->value = process(ast[2]); + ret->type = WasmType::f64; + return ret; + } assert(childType == ASM_NONE || childType == ASM_DOUBLE); // e.g. a coercion on a call or for a return auto ret = process(ast[2]); // just look through the +() coercion ret->type = WasmType::f64; // we add it here for e.g. call coercions |