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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/base/bits.h" | 6 #include "src/base/bits.h" |
7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 | 10 |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { | 907 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { |
908 VisitRR(this, kArmVcvtU32F64, node); | 908 VisitRR(this, kArmVcvtU32F64, node); |
909 } | 909 } |
910 | 910 |
911 | 911 |
912 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { | 912 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { |
913 VisitRR(this, kArmVcvtF32F64, node); | 913 VisitRR(this, kArmVcvtF32F64, node); |
914 } | 914 } |
915 | 915 |
916 | 916 |
| 917 void InstructionSelector::VisitTruncateFloat64ToInt32(Node* node) { |
| 918 switch (TruncationModeOf(node->op())) { |
| 919 case TruncationMode::kJavaScript: |
| 920 return VisitRR(this, kArchTruncateDoubleToI, node); |
| 921 case TruncationMode::kRoundToZero: |
| 922 return VisitRR(this, kArmVcvtS32F64, node); |
| 923 } |
| 924 UNREACHABLE(); |
| 925 } |
| 926 |
| 927 |
917 void InstructionSelector::VisitFloat32Add(Node* node) { | 928 void InstructionSelector::VisitFloat32Add(Node* node) { |
918 ArmOperandGenerator g(this); | 929 ArmOperandGenerator g(this); |
919 Float32BinopMatcher m(node); | 930 Float32BinopMatcher m(node); |
920 if (m.left().IsFloat32Mul() && CanCover(node, m.left().node())) { | 931 if (m.left().IsFloat32Mul() && CanCover(node, m.left().node())) { |
921 Float32BinopMatcher mleft(m.left().node()); | 932 Float32BinopMatcher mleft(m.left().node()); |
922 Emit(kArmVmlaF32, g.DefineSameAsFirst(node), | 933 Emit(kArmVmlaF32, g.DefineSameAsFirst(node), |
923 g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()), | 934 g.UseRegister(m.right().node()), g.UseRegister(mleft.left().node()), |
924 g.UseRegister(mleft.right().node())); | 935 g.UseRegister(mleft.right().node())); |
925 return; | 936 return; |
926 } | 937 } |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1620 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1631 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1621 MachineOperatorBuilder::kFloat64RoundTruncate | | 1632 MachineOperatorBuilder::kFloat64RoundTruncate | |
1622 MachineOperatorBuilder::kFloat64RoundTiesAway; | 1633 MachineOperatorBuilder::kFloat64RoundTiesAway; |
1623 } | 1634 } |
1624 return flags; | 1635 return flags; |
1625 } | 1636 } |
1626 | 1637 |
1627 } // namespace compiler | 1638 } // namespace compiler |
1628 } // namespace internal | 1639 } // namespace internal |
1629 } // namespace v8 | 1640 } // namespace v8 |
OLD | NEW |