diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-05 10:29:23 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-05 10:29:23 -0800 |
commit | d16e8900cb98af97775e406c25d4a8b0c8c86039 (patch) | |
tree | 8823a93778674be034eaf7b6765817b67c3fb7b9 /src/wasm-interpreter.h | |
parent | a1b24a29d50d6e060adf1ffd97d406bc5d71f290 (diff) | |
download | binaryen-d16e8900cb98af97775e406c25d4a8b0c8c86039.tar.gz binaryen-d16e8900cb98af97775e406c25d4a8b0c8c86039.tar.bz2 binaryen-d16e8900cb98af97775e406c25d4a8b0c8c86039.zip |
more conversion fixes
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r-- | src/wasm-interpreter.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 586715b77..5d9bf89b0 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -386,10 +386,10 @@ public: } } case ReinterpretFloat: return curr->type == i32 ? Flow(Literal(value.reinterpreti32())) : Flow(Literal(value.reinterpreti64())); - case ConvertUInt32: return Flow(Literal(double(uint32_t(value.geti32())))); - case ConvertSInt32: return Flow(Literal(double(int32_t(value.geti32())))); - case ConvertUInt64: return Flow(Literal(double((uint64_t)value.geti64()))); - case ConvertSInt64: return Flow(Literal(double(value.geti64()))); + case ConvertUInt32: return curr->type == f32 ? Flow(Literal(float(uint32_t(value.geti32())))) : Flow(Literal(double(uint32_t(value.geti32())))); + case ConvertSInt32: return curr->type == f32 ? Flow(Literal(float(int32_t(value.geti32())))) : Flow(Literal(double(int32_t(value.geti32())))); + case ConvertUInt64: return curr->type == f32 ? Flow(Literal(float((uint64_t)value.geti64()))) : Flow(Literal(double((uint64_t)value.geti64()))); + case ConvertSInt64: return curr->type == f32 ? Flow(Literal(float(value.geti64()))) : Flow(Literal(double(value.geti64()))); case PromoteFloat32: return Flow(Literal(double(value.getf32()))); case DemoteFloat64: return Flow(Literal(float(value.getf64()))); case ReinterpretInt: return curr->type == f32 ? Flow(Literal(value.reinterpretf32())) : Flow(Literal(value.reinterpretf64())); |