OLD | NEW |
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 Loading... |
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 |
1649 } // namespace compiler | 1661 } // namespace compiler |
1650 } // namespace internal | 1662 } // namespace internal |
1651 } // namespace v8 | 1663 } // namespace v8 |
OLD | NEW |