From 3dac399ba503e05ee014e96a7ce9c82f29f6981c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 7 Nov 2016 16:47:47 -0800 Subject: support assigns of f32 to HEAP64 in asm2wasm (#830) --- src/asm2wasm.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 8c8e5855a..6455fbf08 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -1228,8 +1228,14 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { conv->value = ret->value; conv->type = WasmType::f32; ret->value = conv; + } else if (ret->valueType == f64 && ret->value->type == f32) { + auto conv = allocator.alloc(); + conv->op = PromoteFloat32; + conv->value = ret->value; + conv->type = WasmType::f64; + ret->value = conv; } else { - abort_on("bad subtract types", ast); + abort_on("bad sub[] types", ast); } } return ret; -- cgit v1.2.3