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

Unified Diff: test/unittests/compiler/machine-operator-reducer-unittest.cc

Issue 683753004: [turbofan] Transform x * -1.0 to -0.0 - x. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Corner cases. Created 6 years, 1 month 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 | « test/mjsunit/asm/float64mul.js ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/machine-operator-reducer-unittest.cc
diff --git a/test/unittests/compiler/machine-operator-reducer-unittest.cc b/test/unittests/compiler/machine-operator-reducer-unittest.cc
index 268afc4b275135aa2e407eb98f935a8ab3fe5b13..d811808adf51320bf6a52cffbca157cea8b70863 100644
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc
@@ -1107,6 +1107,27 @@ TEST_F(MachineOperatorReducerTest, Uint32LessThanWithWord32Sar) {
// -----------------------------------------------------------------------------
+// Float64Mul
+
+
+TEST_F(MachineOperatorReducerTest, Float64MulWithMinusOne) {
+ Node* const p0 = Parameter(0);
+ {
+ Reduction r = Reduce(
+ graph()->NewNode(machine()->Float64Mul(), p0, Float64Constant(-1.0)));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(r.replacement(), IsFloat64Sub(IsFloat64Constant(-0.0), p0));
+ }
+ {
+ Reduction r = Reduce(
+ graph()->NewNode(machine()->Float64Mul(), Float64Constant(-1.0), p0));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(r.replacement(), IsFloat64Sub(IsFloat64Constant(-0.0), p0));
+ }
+}
+
+
+// -----------------------------------------------------------------------------
// Store
« no previous file with comments | « test/mjsunit/asm/float64mul.js ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698