Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: src/compiler/wasm-compiler.cc

Issue 1516143004: [wasm] Fixed F32Neg and F64Neg for -0.0. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698