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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 graph()->NewNode(machine()->ChangeUint32ToUint64(), | 484 graph()->NewNode(machine()->ChangeUint32ToUint64(), |
485 graph()->NewNode(machine()->TruncateInt64ToInt32(), | 485 graph()->NewNode(machine()->TruncateInt64ToInt32(), |
486 Int64Constant(value(0)))), | 486 Int64Constant(value(0)))), |
487 MachineRepresentation::kWord64); | 487 MachineRepresentation::kWord64); |
488 | 488 |
489 EXPECT_THAT(graph()->end()->InputAt(1), | 489 EXPECT_THAT(graph()->end()->InputAt(1), |
490 IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0), | 490 IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0), |
491 start(), start())); | 491 start(), start())); |
492 } | 492 } |
493 // kExprF64ReinterpretI64: | 493 // kExprF64ReinterpretI64: |
| 494 TEST_F(Int64LoweringTest, F64ReinterpretI64) { |
| 495 LowerGraph(graph()->NewNode(machine()->BitcastInt64ToFloat64(), |
| 496 Int64Constant(value(0))), |
| 497 MachineRepresentation::kFloat64); |
| 498 |
| 499 Capture<Node*> stack_slot_capture; |
| 500 Matcher<Node*> stack_slot_matcher = |
| 501 IsStackSlot(MachineRepresentation::kWord64); |
| 502 |
| 503 Capture<Node*> store_capture; |
| 504 Matcher<Node*> store_matcher = |
| 505 IsStore(StoreRepresentation(MachineRepresentation::kWord32, |
| 506 WriteBarrierKind::kNoWriteBarrier), |
| 507 AllOf(CaptureEq(&stack_slot_capture), stack_slot_matcher), |
| 508 IsInt32Constant(0), IsInt32Constant(low_word_value(0)), |
| 509 IsStore(StoreRepresentation(MachineRepresentation::kWord32, |
| 510 WriteBarrierKind::kNoWriteBarrier), |
| 511 AllOf(CaptureEq(&stack_slot_capture), stack_slot_matcher), |
| 512 IsInt32Constant(4), IsInt32Constant(high_word_value(0)), |
| 513 start(), start()), |
| 514 start()); |
| 515 |
| 516 EXPECT_THAT( |
| 517 graph()->end()->InputAt(1), |
| 518 IsReturn(IsLoad(MachineType::Float64(), |
| 519 AllOf(CaptureEq(&stack_slot_capture), stack_slot_matcher), |
| 520 IsInt32Constant(0), |
| 521 AllOf(CaptureEq(&store_capture), store_matcher), start()), |
| 522 start(), start())); |
| 523 } |
494 // kExprI64ReinterpretF64: | 524 // kExprI64ReinterpretF64: |
495 TEST_F(Int64LoweringTest, I64ReinterpretF64) { | 525 TEST_F(Int64LoweringTest, I64ReinterpretF64) { |
496 LowerGraph(graph()->NewNode(machine()->BitcastFloat64ToInt64(), | 526 LowerGraph(graph()->NewNode(machine()->BitcastFloat64ToInt64(), |
497 Float64Constant(bit_cast<double>(value(0)))), | 527 Float64Constant(bit_cast<double>(value(0)))), |
498 MachineRepresentation::kWord64); | 528 MachineRepresentation::kWord64); |
499 | 529 |
500 Capture<Node*> stack_slot; | 530 Capture<Node*> stack_slot; |
501 Matcher<Node*> stack_slot_matcher = | 531 Matcher<Node*> stack_slot_matcher = |
502 IsStackSlot(MachineRepresentation::kWord64); | 532 IsStackSlot(MachineRepresentation::kWord64); |
503 | 533 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 | 579 |
550 EXPECT_THAT( | 580 EXPECT_THAT( |
551 graph()->end()->InputAt(1), | 581 graph()->end()->InputAt(1), |
552 IsReturn2(IsInt32Add(IsWord32Popcnt(IsInt32Constant(low_word_value(0))), | 582 IsReturn2(IsInt32Add(IsWord32Popcnt(IsInt32Constant(low_word_value(0))), |
553 IsWord32Popcnt(IsInt32Constant(high_word_value(0)))), | 583 IsWord32Popcnt(IsInt32Constant(high_word_value(0)))), |
554 IsInt32Constant(0), start(), start())); | 584 IsInt32Constant(0), start(), start())); |
555 } | 585 } |
556 } // namespace compiler | 586 } // namespace compiler |
557 } // namespace internal | 587 } // namespace internal |
558 } // namespace v8 | 588 } // namespace v8 |
OLD | NEW |