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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0), | 563 IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0), |
564 start(), start())); | 564 start(), start())); |
565 } | 565 } |
566 | 566 |
567 TEST_F(Int64LoweringTest, F64ReinterpretI64) { | 567 TEST_F(Int64LoweringTest, F64ReinterpretI64) { |
568 LowerGraph(graph()->NewNode(machine()->BitcastInt64ToFloat64(), | 568 LowerGraph(graph()->NewNode(machine()->BitcastInt64ToFloat64(), |
569 Int64Constant(value(0))), | 569 Int64Constant(value(0))), |
570 MachineRepresentation::kFloat64); | 570 MachineRepresentation::kFloat64); |
571 | 571 |
572 Capture<Node*> stack_slot_capture; | 572 Capture<Node*> stack_slot_capture; |
573 Matcher<Node*> stack_slot_matcher = | 573 Matcher<Node*> stack_slot_matcher = IsStackSlot(sizeof(int64_t)); |
574 IsStackSlot(MachineRepresentation::kWord64); | |
575 | 574 |
576 Capture<Node*> store_capture; | 575 Capture<Node*> store_capture; |
577 Matcher<Node*> store_matcher = | 576 Matcher<Node*> store_matcher = |
578 IsStore(StoreRepresentation(MachineRepresentation::kWord32, | 577 IsStore(StoreRepresentation(MachineRepresentation::kWord32, |
579 WriteBarrierKind::kNoWriteBarrier), | 578 WriteBarrierKind::kNoWriteBarrier), |
580 AllOf(CaptureEq(&stack_slot_capture), stack_slot_matcher), | 579 AllOf(CaptureEq(&stack_slot_capture), stack_slot_matcher), |
581 IsInt32Constant(Int64Lowering::kLowerWordOffset), | 580 IsInt32Constant(Int64Lowering::kLowerWordOffset), |
582 IsInt32Constant(low_word_value(0)), | 581 IsInt32Constant(low_word_value(0)), |
583 IsStore(StoreRepresentation(MachineRepresentation::kWord32, | 582 IsStore(StoreRepresentation(MachineRepresentation::kWord32, |
584 WriteBarrierKind::kNoWriteBarrier), | 583 WriteBarrierKind::kNoWriteBarrier), |
(...skipping 10 matching lines...) Expand all Loading... |
595 AllOf(CaptureEq(&store_capture), store_matcher), start()), | 594 AllOf(CaptureEq(&store_capture), store_matcher), start()), |
596 start(), start())); | 595 start(), start())); |
597 } | 596 } |
598 | 597 |
599 TEST_F(Int64LoweringTest, I64ReinterpretF64) { | 598 TEST_F(Int64LoweringTest, I64ReinterpretF64) { |
600 LowerGraph(graph()->NewNode(machine()->BitcastFloat64ToInt64(), | 599 LowerGraph(graph()->NewNode(machine()->BitcastFloat64ToInt64(), |
601 Float64Constant(bit_cast<double>(value(0)))), | 600 Float64Constant(bit_cast<double>(value(0)))), |
602 MachineRepresentation::kWord64); | 601 MachineRepresentation::kWord64); |
603 | 602 |
604 Capture<Node*> stack_slot; | 603 Capture<Node*> stack_slot; |
605 Matcher<Node*> stack_slot_matcher = | 604 Matcher<Node*> stack_slot_matcher = IsStackSlot(sizeof(int64_t)); |
606 IsStackSlot(MachineRepresentation::kWord64); | |
607 | 605 |
608 Capture<Node*> store; | 606 Capture<Node*> store; |
609 Matcher<Node*> store_matcher = IsStore( | 607 Matcher<Node*> store_matcher = IsStore( |
610 StoreRepresentation(MachineRepresentation::kFloat64, | 608 StoreRepresentation(MachineRepresentation::kFloat64, |
611 WriteBarrierKind::kNoWriteBarrier), | 609 WriteBarrierKind::kNoWriteBarrier), |
612 AllOf(CaptureEq(&stack_slot), stack_slot_matcher), IsInt32Constant(0), | 610 AllOf(CaptureEq(&stack_slot), stack_slot_matcher), IsInt32Constant(0), |
613 IsFloat64Constant(bit_cast<double>(value(0))), start(), start()); | 611 IsFloat64Constant(bit_cast<double>(value(0))), start(), start()); |
614 | 612 |
615 EXPECT_THAT( | 613 EXPECT_THAT( |
616 graph()->end()->InputAt(1), | 614 graph()->end()->InputAt(1), |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 graph()->NewNode(common()->Branch(), compare, | 888 graph()->NewNode(common()->Branch(), compare, |
891 graph()->start())))); | 889 graph()->start())))); |
892 | 890 |
893 NodeProperties::ReplaceValueInput(compare, load, 0); | 891 NodeProperties::ReplaceValueInput(compare, load, 0); |
894 | 892 |
895 LowerGraph(load, MachineRepresentation::kWord64); | 893 LowerGraph(load, MachineRepresentation::kWord64); |
896 } | 894 } |
897 } // namespace compiler | 895 } // namespace compiler |
898 } // namespace internal | 896 } // namespace internal |
899 } // namespace v8 | 897 } // namespace v8 |
OLD | NEW |