Chromium Code Reviews| Index: src/wasm/wasm-interpreter.cc |
| diff --git a/src/wasm/wasm-interpreter.cc b/src/wasm/wasm-interpreter.cc |
| index 199fe724f8bfe52da22c36b3390fcd13dc96c71a..82f7191e7f0d39e9b0f80d6bffb65214a68221c3 100644 |
| --- a/src/wasm/wasm-interpreter.cc |
| +++ b/src/wasm/wasm-interpreter.cc |
| @@ -159,8 +159,6 @@ namespace wasm { |
| 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) \ |
| @@ -606,12 +604,12 @@ static inline double ExecuteF64ReinterpretI64(int64_t a, TrapReason* trap) { |
| return bit_cast<double>(a); |
| } |
| -static inline int32_t ExecuteI32ReinterpretF32(float a, TrapReason* trap) { |
| - return bit_cast<int32_t>(a); |
| +static inline int32_t ExecuteI32ReinterpretF32(WasmVal a) { |
| + return a.to_unchecked<int32_t>(); |
| } |
| -static inline int64_t ExecuteI64ReinterpretF64(double a, TrapReason* trap) { |
| - return bit_cast<int64_t>(a); |
| +static inline int64_t ExecuteI64ReinterpretF64(WasmVal a) { |
| + return a.to_unchecked<int64_t>(); |
| } |
| static inline int32_t ExecuteGrowMemory(uint32_t delta_pages, |
| @@ -1554,6 +1552,18 @@ class ThreadImpl : public WasmInterpreter::Thread { |
| len = 1 + operand.length; |
| break; |
| } |
| + // We handle kExprI32ReinterpretF32 and kExprI64ReinterpretF64 specially |
| + // because on ia32 we may loose the signalling bit of NaNs otherwise. |
|
Clemens Hammacher
2017/01/18 18:03:49
lose, not loose. I would also write signaling inst
ahaas
2017/01/18 18:13:49
I rewrote the comment.
|
| + 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) \ |
| case kExpr##name: { \ |
| WasmVal rval = Pop(); \ |