From 14ad84c09bd93958cc8fcfa4a38bbcc7e7267169 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 21 Nov 2015 22:10:43 -0800 Subject: handle -f32 --- src/asm2wasm.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 394b3de9f..ac9732e68 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -965,11 +965,16 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { ret->type = WasmType::i32; return ret; } - assert(asmType == ASM_DOUBLE); auto ret = allocator.alloc(); ret->op = Neg; ret->value = process(ast[2]); - ret->type = WasmType::f64; + if (asmType == ASM_DOUBLE) { + ret->type = WasmType::f64; + } else if (asmType == ASM_FLOAT) { + ret->type = WasmType::f32; + } else { + abort(); + } return ret; } else if (ast[1] == B_NOT) { // ~, might be ~~ as a coercion or just a not -- cgit v1.2.3