Index: src/compiler/wasm-compiler.cc |
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc |
index d2f2eda136a7b72daae0df5ac18625df26a65bec..3022237fabe194fae88f426cd0f5b9ea0a2a5bf9 100644 |
--- a/src/compiler/wasm-compiler.cc |
+++ b/src/compiler/wasm-compiler.cc |
@@ -669,8 +669,8 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input) { |
op = m->Float32Abs(); |
break; |
case wasm::kExprF32Neg: |
- op = m->Float32Sub(); |
- return graph()->NewNode(op, jsgraph()->Float32Constant(0), input); |
+ op = m->Float32Mul(); |
+ return graph()->NewNode(op, jsgraph()->Float32Constant(-1), input); |
case wasm::kExprF32Sqrt: |
op = m->Float32Sqrt(); |
break; |
@@ -678,8 +678,8 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input) { |
op = m->Float64Abs(); |
break; |
case wasm::kExprF64Neg: |
- op = m->Float64Sub(); |
- return graph()->NewNode(op, jsgraph()->Float64Constant(0), input); |
+ op = m->Float64Mul(); |
+ return graph()->NewNode(op, jsgraph()->Float64Constant(-1), input); |
case wasm::kExprF64Sqrt: |
op = m->Float64Sqrt(); |
break; |