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/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 } | 839 } |
840 | 840 |
841 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { | 841 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { |
842 X87OperandGenerator g(this); | 842 X87OperandGenerator g(this); |
843 Emit(kX87Float64ToFloat32, g.DefineAsFixed(node, stX_0), | 843 Emit(kX87Float64ToFloat32, g.DefineAsFixed(node, stX_0), |
844 g.Use(node->InputAt(0))); | 844 g.Use(node->InputAt(0))); |
845 } | 845 } |
846 | 846 |
847 void InstructionSelector::VisitTruncateFloat64ToWord32(Node* node) { | 847 void InstructionSelector::VisitTruncateFloat64ToWord32(Node* node) { |
848 X87OperandGenerator g(this); | 848 X87OperandGenerator g(this); |
| 849 Emit(kArchTruncateDoubleToI, g.DefineAsRegister(node), |
| 850 g.Use(node->InputAt(0))); |
| 851 } |
849 | 852 |
850 switch (TruncationModeOf(node->op())) { | 853 void InstructionSelector::VisitRoundFloat64ToInt32(Node* node) { |
851 case TruncationMode::kJavaScript: | 854 X87OperandGenerator g(this); |
852 Emit(kArchTruncateDoubleToI, g.DefineAsRegister(node), | 855 Emit(kX87Float64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
853 g.Use(node->InputAt(0))); | |
854 return; | |
855 case TruncationMode::kRoundToZero: | |
856 Emit(kX87Float64ToInt32, g.DefineAsRegister(node), | |
857 g.Use(node->InputAt(0))); | |
858 return; | |
859 } | |
860 UNREACHABLE(); | |
861 } | 856 } |
862 | 857 |
863 | 858 |
864 void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) { | 859 void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) { |
865 X87OperandGenerator g(this); | 860 X87OperandGenerator g(this); |
866 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); | 861 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
867 Emit(kX87BitcastFI, g.DefineAsRegister(node), 0, nullptr); | 862 Emit(kX87BitcastFI, g.DefineAsRegister(node), 0, nullptr); |
868 } | 863 } |
869 | 864 |
870 | 865 |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1618 MachineOperatorBuilder::kFloat32RoundTruncate | | 1613 MachineOperatorBuilder::kFloat32RoundTruncate | |
1619 MachineOperatorBuilder::kFloat64RoundTruncate | | 1614 MachineOperatorBuilder::kFloat64RoundTruncate | |
1620 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1615 MachineOperatorBuilder::kFloat32RoundTiesEven | |
1621 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1616 MachineOperatorBuilder::kFloat64RoundTiesEven; |
1622 return flags; | 1617 return flags; |
1623 } | 1618 } |
1624 | 1619 |
1625 } // namespace compiler | 1620 } // namespace compiler |
1626 } // namespace internal | 1621 } // namespace internal |
1627 } // namespace v8 | 1622 } // namespace v8 |
OLD | NEW |