| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
| 6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
| 7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1664 } | 1664 } |
| 1665 | 1665 |
| 1666 void InstructionSelector::VisitRoundFloat64ToInt32(Node* node) { | 1666 void InstructionSelector::VisitRoundFloat64ToInt32(Node* node) { |
| 1667 VisitRR(this, kArm64Float64ToInt32, node); | 1667 VisitRR(this, kArm64Float64ToInt32, node); |
| 1668 } | 1668 } |
| 1669 | 1669 |
| 1670 | 1670 |
| 1671 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { | 1671 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { |
| 1672 Arm64OperandGenerator g(this); | 1672 Arm64OperandGenerator g(this); |
| 1673 Node* value = node->InputAt(0); | 1673 Node* value = node->InputAt(0); |
| 1674 if (CanCover(node, value) && value->InputCount() >= 2) { | 1674 // The top 32 bits in the 64-bit register will be undefined, and |
| 1675 Int64BinopMatcher m(value); | 1675 // must not be used by a dependent node. |
| 1676 if ((m.IsWord64Sar() && m.right().HasValue() && | 1676 Emit(kArchNop, g.DefineSameAsFirst(node), g.UseRegister(value)); |
| 1677 (m.right().Value() == 32)) || | |
| 1678 (m.IsWord64Shr() && m.right().IsInRange(32, 63))) { | |
| 1679 Emit(kArm64Lsr, g.DefineAsRegister(node), g.UseRegister(m.left().node()), | |
| 1680 g.UseImmediate(m.right().node())); | |
| 1681 return; | |
| 1682 } | |
| 1683 } | |
| 1684 | |
| 1685 Emit(kArm64Mov32, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); | |
| 1686 } | 1677 } |
| 1687 | 1678 |
| 1688 | 1679 |
| 1689 void InstructionSelector::VisitRoundInt64ToFloat32(Node* node) { | 1680 void InstructionSelector::VisitRoundInt64ToFloat32(Node* node) { |
| 1690 VisitRR(this, kArm64Int64ToFloat32, node); | 1681 VisitRR(this, kArm64Int64ToFloat32, node); |
| 1691 } | 1682 } |
| 1692 | 1683 |
| 1693 | 1684 |
| 1694 void InstructionSelector::VisitRoundInt64ToFloat64(Node* node) { | 1685 void InstructionSelector::VisitRoundInt64ToFloat64(Node* node) { |
| 1695 VisitRR(this, kArm64Int64ToFloat64, node); | 1686 VisitRR(this, kArm64Int64ToFloat64, node); |
| (...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2722 // static | 2713 // static |
| 2723 MachineOperatorBuilder::AlignmentRequirements | 2714 MachineOperatorBuilder::AlignmentRequirements |
| 2724 InstructionSelector::AlignmentRequirements() { | 2715 InstructionSelector::AlignmentRequirements() { |
| 2725 return MachineOperatorBuilder::AlignmentRequirements:: | 2716 return MachineOperatorBuilder::AlignmentRequirements:: |
| 2726 FullUnalignedAccessSupport(); | 2717 FullUnalignedAccessSupport(); |
| 2727 } | 2718 } |
| 2728 | 2719 |
| 2729 } // namespace compiler | 2720 } // namespace compiler |
| 2730 } // namespace internal | 2721 } // namespace internal |
| 2731 } // namespace v8 | 2722 } // namespace v8 |
| OLD | NEW |