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

Side by Side Diff: test/unittests/compiler/int64-lowering-unittest.cc

Issue 1844553002: [wasm] New attempt to implement the Int64Lowering of phis. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed out-of-bounds memory access. Created 4 years, 8 months 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
« no previous file with comments | « test/unittests/compiler/graph-unittest.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 LowerGraph(graph()->NewNode(machine()->Word64PopcntPlaceholder(), 635 LowerGraph(graph()->NewNode(machine()->Word64PopcntPlaceholder(),
636 Int64Constant(value(0))), 636 Int64Constant(value(0))),
637 MachineRepresentation::kWord64); 637 MachineRepresentation::kWord64);
638 638
639 EXPECT_THAT( 639 EXPECT_THAT(
640 graph()->end()->InputAt(1), 640 graph()->end()->InputAt(1),
641 IsReturn2(IsInt32Add(IsWord32Popcnt(IsInt32Constant(low_word_value(0))), 641 IsReturn2(IsInt32Add(IsWord32Popcnt(IsInt32Constant(low_word_value(0))),
642 IsWord32Popcnt(IsInt32Constant(high_word_value(0)))), 642 IsWord32Popcnt(IsInt32Constant(high_word_value(0)))),
643 IsInt32Constant(0), start(), start())); 643 IsInt32Constant(0), start(), start()));
644 } 644 }
645
646 TEST_F(Int64LoweringTest, I64PhiWord64) {
647 LowerGraph(graph()->NewNode(common()->Phi(MachineRepresentation::kWord64, 2),
648 Int64Constant(value(0)), Int64Constant(value(1)),
649 start()),
650 MachineRepresentation::kWord64);
651
652 EXPECT_THAT(graph()->end()->InputAt(1),
653 IsReturn2(IsPhi(MachineRepresentation::kWord32,
654 IsInt32Constant(low_word_value(0)),
655 IsInt32Constant(low_word_value(1)), start()),
656 IsPhi(MachineRepresentation::kWord32,
657 IsInt32Constant(high_word_value(0)),
658 IsInt32Constant(high_word_value(1)), start()),
659 start(), start()));
660 }
661
662 void TestPhi(Int64LoweringTest* test, MachineRepresentation rep, Node* v1,
663 Node* v2) {
664 test->LowerGraph(test->graph()->NewNode(test->common()->Phi(rep, 2), v1, v2,
665 test->start()),
666 rep);
667
668 EXPECT_THAT(test->graph()->end()->InputAt(1),
669 IsReturn(IsPhi(rep, v1, v2, test->start()), test->start(),
670 test->start()));
671 }
672
673 TEST_F(Int64LoweringTest, I64PhiFloat32) {
674 TestPhi(this, MachineRepresentation::kFloat32, Float32Constant(1.5),
675 Float32Constant(2.5));
676 }
677
678 TEST_F(Int64LoweringTest, I64PhiFloat64) {
679 TestPhi(this, MachineRepresentation::kFloat64, Float32Constant(1.5),
680 Float32Constant(2.5));
681 }
682
683 TEST_F(Int64LoweringTest, I64PhiWord32) {
684 TestPhi(this, MachineRepresentation::kWord32, Float32Constant(1),
685 Float32Constant(2));
686 }
645 } // namespace compiler 687 } // namespace compiler
646 } // namespace internal 688 } // namespace internal
647 } // namespace v8 689 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/graph-unittest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698