summaryrefslogtreecommitdiff
path: root/src/asm2wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-11-04 14:55:32 -0700
committerGitHub <noreply@github.com>2016-11-04 14:55:32 -0700
commit5af71eea09abfa9078c62633cea89b121ec4ec08 (patch)
tree73b6ed0baa0c644a1fa7e34228546587a1f297d4 /src/asm2wasm.h
parent22699ebad0972fa7604dd8ffd26f9f6607e82fb0 (diff)
downloadbinaryen-5af71eea09abfa9078c62633cea89b121ec4ec08.tar.gz
binaryen-5af71eea09abfa9078c62633cea89b121ec4ec08.tar.bz2
binaryen-5af71eea09abfa9078c62633cea89b121ec4ec08.zip
Fixes fround of an unsigned integer (#821)
* fix fround of unsigned * add testing for f32 ops, and remove a duplicate test (now that f32 is on by default in wasm, we don't need to check with and without PRECISE_F32) * update wasm.js and binaryen.js
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r--src/asm2wasm.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index 87fd10649..8c8e5855a 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -1488,7 +1488,11 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
if (ret->value->type == f64) {
ret->op = DemoteFloat64;
} else if (ret->value->type == i32) {
- ret->op = ConvertSInt32ToFloat32;
+ if (isUnsignedCoercion(ast[2][0])) {
+ ret->op = ConvertUInt32ToFloat32;
+ } else {
+ ret->op = ConvertSInt32ToFloat32;
+ }
} else if (ret->value->type == f32) {
return ret->value;
} else if (ret->value->type == none) { // call, etc.