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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0), | 596 IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0), |
597 start(), start())); | 597 start(), start())); |
598 } | 598 } |
599 | 599 |
600 TEST_F(Int64LoweringTest, F64ReinterpretI64) { | 600 TEST_F(Int64LoweringTest, F64ReinterpretI64) { |
601 LowerGraph(graph()->NewNode(machine()->BitcastInt64ToFloat64(), | 601 LowerGraph(graph()->NewNode(machine()->BitcastInt64ToFloat64(), |
602 Int64Constant(value(0))), | 602 Int64Constant(value(0))), |
603 MachineRepresentation::kFloat64); | 603 MachineRepresentation::kFloat64); |
604 | 604 |
605 Capture<Node*> stack_slot_capture; | 605 Capture<Node*> stack_slot_capture; |
606 Matcher<Node*> stack_slot_matcher = IsStackSlot(sizeof(int64_t)); | 606 Matcher<Node*> stack_slot_matcher = |
| 607 IsStackSlot(StackSlotRepresentation(sizeof(int64_t), 0)); |
607 | 608 |
608 Capture<Node*> store_capture; | 609 Capture<Node*> store_capture; |
609 Matcher<Node*> store_matcher = | 610 Matcher<Node*> store_matcher = |
610 IsStore(StoreRepresentation(MachineRepresentation::kWord32, | 611 IsStore(StoreRepresentation(MachineRepresentation::kWord32, |
611 WriteBarrierKind::kNoWriteBarrier), | 612 WriteBarrierKind::kNoWriteBarrier), |
612 AllOf(CaptureEq(&stack_slot_capture), stack_slot_matcher), | 613 AllOf(CaptureEq(&stack_slot_capture), stack_slot_matcher), |
613 IsInt32Constant(kInt64LowerHalfMemoryOffset), | 614 IsInt32Constant(kInt64LowerHalfMemoryOffset), |
614 IsInt32Constant(low_word_value(0)), | 615 IsInt32Constant(low_word_value(0)), |
615 IsStore(StoreRepresentation(MachineRepresentation::kWord32, | 616 IsStore(StoreRepresentation(MachineRepresentation::kWord32, |
616 WriteBarrierKind::kNoWriteBarrier), | 617 WriteBarrierKind::kNoWriteBarrier), |
(...skipping 10 matching lines...) Expand all Loading... |
627 AllOf(CaptureEq(&store_capture), store_matcher), start()), | 628 AllOf(CaptureEq(&store_capture), store_matcher), start()), |
628 start(), start())); | 629 start(), start())); |
629 } | 630 } |
630 | 631 |
631 TEST_F(Int64LoweringTest, I64ReinterpretF64) { | 632 TEST_F(Int64LoweringTest, I64ReinterpretF64) { |
632 LowerGraph(graph()->NewNode(machine()->BitcastFloat64ToInt64(), | 633 LowerGraph(graph()->NewNode(machine()->BitcastFloat64ToInt64(), |
633 Float64Constant(bit_cast<double>(value(0)))), | 634 Float64Constant(bit_cast<double>(value(0)))), |
634 MachineRepresentation::kWord64); | 635 MachineRepresentation::kWord64); |
635 | 636 |
636 Capture<Node*> stack_slot; | 637 Capture<Node*> stack_slot; |
637 Matcher<Node*> stack_slot_matcher = IsStackSlot(sizeof(int64_t)); | 638 Matcher<Node*> stack_slot_matcher = |
| 639 IsStackSlot(StackSlotRepresentation(sizeof(int64_t), 0)); |
638 | 640 |
639 Capture<Node*> store; | 641 Capture<Node*> store; |
640 Matcher<Node*> store_matcher = IsStore( | 642 Matcher<Node*> store_matcher = IsStore( |
641 StoreRepresentation(MachineRepresentation::kFloat64, | 643 StoreRepresentation(MachineRepresentation::kFloat64, |
642 WriteBarrierKind::kNoWriteBarrier), | 644 WriteBarrierKind::kNoWriteBarrier), |
643 AllOf(CaptureEq(&stack_slot), stack_slot_matcher), IsInt32Constant(0), | 645 AllOf(CaptureEq(&stack_slot), stack_slot_matcher), IsInt32Constant(0), |
644 IsFloat64Constant(bit_cast<double>(value(0))), start(), start()); | 646 IsFloat64Constant(bit_cast<double>(value(0))), start(), start()); |
645 | 647 |
646 EXPECT_THAT( | 648 EXPECT_THAT( |
647 graph()->end()->InputAt(1), | 649 graph()->end()->InputAt(1), |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 graph()->NewNode(common()->Branch(), compare, | 923 graph()->NewNode(common()->Branch(), compare, |
922 graph()->start())))); | 924 graph()->start())))); |
923 | 925 |
924 NodeProperties::ReplaceValueInput(compare, load, 0); | 926 NodeProperties::ReplaceValueInput(compare, load, 0); |
925 | 927 |
926 LowerGraph(load, MachineRepresentation::kWord64); | 928 LowerGraph(load, MachineRepresentation::kWord64); |
927 } | 929 } |
928 } // namespace compiler | 930 } // namespace compiler |
929 } // namespace internal | 931 } // namespace internal |
930 } // namespace v8 | 932 } // namespace v8 |
OLD | NEW |