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

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

Issue 1478923002: Revert of binary-operator-reducer: reduce mul+div(shift) (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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/base/bits.h" 5 #include "src/base/bits.h"
6 #include "src/base/division-by-constant.h" 6 #include "src/base/division-by-constant.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/machine-operator-reducer.h" 8 #include "src/compiler/machine-operator-reducer.h"
9 #include "src/compiler/typer.h" 9 #include "src/compiler/typer.h"
10 #include "src/conversions-inl.h" 10 #include "src/conversions-inl.h"
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 Int32Constant(x)), 1639 Int32Constant(x)),
1640 effect, control); 1640 effect, control);
1641 1641
1642 Reduction r = Reduce(node); 1642 Reduction r = Reduce(node);
1643 ASSERT_TRUE(r.Changed()); 1643 ASSERT_TRUE(r.Changed());
1644 EXPECT_THAT(r.replacement(), 1644 EXPECT_THAT(r.replacement(),
1645 IsStore(rep, base, index, value, effect, control)); 1645 IsStore(rep, base, index, value, effect, control));
1646 } 1646 }
1647 } 1647 }
1648 1648
1649
1650 TEST_F(MachineOperatorReducerTest, RoundPlusTruncate) {
1651 Node* p0 = Parameter(0);
1652 Node* t0 = graph()->NewNode(machine()->RoundInt64ToFloat64(), p0);
1653 Node* t1 = graph()->NewNode(
1654 machine()->TruncateFloat64ToInt32(TruncationMode::kJavaScript), t0);
1655
1656 Reduction r = Reduce(t1);
1657 ASSERT_TRUE(r.Changed());
1658 EXPECT_THAT(r.replacement(), p0);
1659 }
1660
1661 } // namespace compiler 1649 } // namespace compiler
1662 } // namespace internal 1650 } // namespace internal
1663 } // namespace v8 1651 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/binary-operator-reducer-unittest.cc ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698