OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/compiler/int64-lowering.h" | 5 #include "src/compiler/int64-lowering.h" |
6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
8 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 | 10 |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 IsInt32Constant(32)), | 621 IsInt32Constant(32)), |
622 IsWord32Clz(IsInt32Constant(high_word_value(0))), | 622 IsWord32Clz(IsInt32Constant(high_word_value(0))), |
623 IsMerge( | 623 IsMerge( |
624 IsIfTrue(AllOf(CaptureEq(&branch_capture), branch_matcher)), | 624 IsIfTrue(AllOf(CaptureEq(&branch_capture), branch_matcher)), |
625 IsIfFalse( | 625 IsIfFalse( |
626 AllOf(CaptureEq(&branch_capture), branch_matcher)))), | 626 AllOf(CaptureEq(&branch_capture), branch_matcher)))), |
627 IsInt32Constant(0), start(), start())); | 627 IsInt32Constant(0), start(), start())); |
628 } | 628 } |
629 | 629 |
630 TEST_F(Int64LoweringTest, I64Ctz) { | 630 TEST_F(Int64LoweringTest, I64Ctz) { |
631 LowerGraph(graph()->NewNode(machine()->Word64CtzPlaceholder(), | 631 LowerGraph(graph()->NewNode(machine()->Word64Ctz().placeholder(), |
632 Int64Constant(value(0))), | 632 Int64Constant(value(0))), |
633 MachineRepresentation::kWord64); | 633 MachineRepresentation::kWord64); |
634 Capture<Node*> branch_capture; | 634 Capture<Node*> branch_capture; |
635 Matcher<Node*> branch_matcher = IsBranch( | 635 Matcher<Node*> branch_matcher = IsBranch( |
636 IsWord32Equal(IsInt32Constant(low_word_value(0)), IsInt32Constant(0)), | 636 IsWord32Equal(IsInt32Constant(low_word_value(0)), IsInt32Constant(0)), |
637 start()); | 637 start()); |
638 EXPECT_THAT( | 638 EXPECT_THAT( |
639 graph()->end()->InputAt(1), | 639 graph()->end()->InputAt(1), |
640 IsReturn2( | 640 IsReturn2( |
641 IsPhi(MachineRepresentation::kWord32, | 641 IsPhi(MachineRepresentation::kWord32, |
(...skipping 19 matching lines...) Expand all Loading... |
661 IsReturn2(IsWord32And(IsInt32Constant(low_word_value(0)), | 661 IsReturn2(IsWord32And(IsInt32Constant(low_word_value(0)), |
662 IsWord32And(IsInt32Constant(low_word_value(0)), | 662 IsWord32And(IsInt32Constant(low_word_value(0)), |
663 IsInt32Constant(low_word_value(1)))), | 663 IsInt32Constant(low_word_value(1)))), |
664 IsWord32And(IsInt32Constant(high_word_value(0)), | 664 IsWord32And(IsInt32Constant(high_word_value(0)), |
665 IsWord32And(IsInt32Constant(high_word_value(0)), | 665 IsWord32And(IsInt32Constant(high_word_value(0)), |
666 IsInt32Constant(high_word_value(1)))), | 666 IsInt32Constant(high_word_value(1)))), |
667 start(), start())); | 667 start(), start())); |
668 } | 668 } |
669 | 669 |
670 TEST_F(Int64LoweringTest, I64Popcnt) { | 670 TEST_F(Int64LoweringTest, I64Popcnt) { |
671 LowerGraph(graph()->NewNode(machine()->Word64PopcntPlaceholder(), | 671 LowerGraph(graph()->NewNode(machine()->Word64Popcnt().placeholder(), |
672 Int64Constant(value(0))), | 672 Int64Constant(value(0))), |
673 MachineRepresentation::kWord64); | 673 MachineRepresentation::kWord64); |
674 | 674 |
675 EXPECT_THAT( | 675 EXPECT_THAT( |
676 graph()->end()->InputAt(1), | 676 graph()->end()->InputAt(1), |
677 IsReturn2(IsInt32Add(IsWord32Popcnt(IsInt32Constant(low_word_value(0))), | 677 IsReturn2(IsInt32Add(IsWord32Popcnt(IsInt32Constant(low_word_value(0))), |
678 IsWord32Popcnt(IsInt32Constant(high_word_value(0)))), | 678 IsWord32Popcnt(IsInt32Constant(high_word_value(0)))), |
679 IsInt32Constant(0), start(), start())); | 679 IsInt32Constant(0), start(), start())); |
680 } | 680 } |
681 | 681 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 Float32Constant(2.5)); | 815 Float32Constant(2.5)); |
816 } | 816 } |
817 | 817 |
818 TEST_F(Int64LoweringTest, I64PhiWord32) { | 818 TEST_F(Int64LoweringTest, I64PhiWord32) { |
819 TestPhi(this, MachineRepresentation::kWord32, Float32Constant(1), | 819 TestPhi(this, MachineRepresentation::kWord32, Float32Constant(1), |
820 Float32Constant(2)); | 820 Float32Constant(2)); |
821 } | 821 } |
822 } // namespace compiler | 822 } // namespace compiler |
823 } // namespace internal | 823 } // namespace internal |
824 } // namespace v8 | 824 } // namespace v8 |
OLD | NEW |