| Index: src/wasm/wasm-interpreter.cc
|
| diff --git a/src/wasm/wasm-interpreter.cc b/src/wasm/wasm-interpreter.cc
|
| index 4bb215a51ac2e7f13d7dc677def634abe16b052b..d2ad0cb8f1daf46797405cd97a737155dec9f1a0 100644
|
| --- a/src/wasm/wasm-interpreter.cc
|
| +++ b/src/wasm/wasm-interpreter.cc
|
| @@ -159,6 +159,8 @@
|
| V(F64UConvertI64, uint64_t) \
|
| V(F64ConvertF32, float) \
|
| V(F64ReinterpretI64, int64_t) \
|
| + V(I32ReinterpretF32, float) \
|
| + V(I64ReinterpretF64, double) \
|
| V(I32AsmjsSConvertF32, float) \
|
| V(I32AsmjsUConvertF32, float) \
|
| V(I32AsmjsSConvertF64, double) \
|
| @@ -604,12 +606,12 @@
|
| return bit_cast<double>(a);
|
| }
|
|
|
| -static inline int32_t ExecuteI32ReinterpretF32(WasmVal a) {
|
| - return a.to_unchecked<int32_t>();
|
| -}
|
| -
|
| -static inline int64_t ExecuteI64ReinterpretF64(WasmVal a) {
|
| - return a.to_unchecked<int64_t>();
|
| +static inline int32_t ExecuteI32ReinterpretF32(float a, TrapReason* trap) {
|
| + return bit_cast<int32_t>(a);
|
| +}
|
| +
|
| +static inline int64_t ExecuteI64ReinterpretF64(double a, TrapReason* trap) {
|
| + return bit_cast<int64_t>(a);
|
| }
|
|
|
| static inline int32_t ExecuteGrowMemory(uint32_t delta_pages,
|
| @@ -1544,19 +1546,6 @@
|
| Push(pc, WasmVal(static_cast<uint32_t>(instance()->mem_size /
|
| WasmModule::kPageSize)));
|
| len = 1 + operand.length;
|
| - break;
|
| - }
|
| - // We need to treat kExprI32ReinterpretF32 and kExprI64ReinterpretF64
|
| - // specially to guarantee that the quiet bit of a NaN is preserved on
|
| - // ia32 by the reinterpret casts.
|
| - case kExprI32ReinterpretF32: {
|
| - WasmVal result(ExecuteI32ReinterpretF32(Pop()));
|
| - Push(pc, result);
|
| - break;
|
| - }
|
| - case kExprI64ReinterpretF64: {
|
| - WasmVal result(ExecuteI64ReinterpretF64(Pop()));
|
| - Push(pc, result);
|
| break;
|
| }
|
| #define EXECUTE_SIMPLE_BINOP(name, ctype, op) \
|
|
|