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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 } | 640 } |
641 | 641 |
642 | 642 |
643 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { | 643 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { |
644 X87OperandGenerator g(this); | 644 X87OperandGenerator g(this); |
645 Emit(kX87Float64ToFloat32, g.DefineAsFixed(node, stX_0), | 645 Emit(kX87Float64ToFloat32, g.DefineAsFixed(node, stX_0), |
646 g.Use(node->InputAt(0))); | 646 g.Use(node->InputAt(0))); |
647 } | 647 } |
648 | 648 |
649 | 649 |
| 650 void InstructionSelector::VisitTruncateFloat64ToInt32(Node* node) { |
| 651 X87OperandGenerator g(this); |
| 652 |
| 653 switch (TruncationModeOf(node->op())) { |
| 654 case TruncationMode::kJavaScript: |
| 655 Emit(kArchTruncateDoubleToI, g.DefineAsRegister(node), |
| 656 g.Use(node->InputAt(0))); |
| 657 return; |
| 658 case TruncationMode::kRoundToZero: |
| 659 Emit(kX87Float64ToInt32, g.DefineAsRegister(node), |
| 660 g.Use(node->InputAt(0))); |
| 661 return; |
| 662 } |
| 663 UNREACHABLE(); |
| 664 } |
| 665 |
| 666 |
650 void InstructionSelector::VisitFloat32Add(Node* node) { | 667 void InstructionSelector::VisitFloat32Add(Node* node) { |
651 X87OperandGenerator g(this); | 668 X87OperandGenerator g(this); |
652 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); | 669 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
653 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(1))); | 670 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(1))); |
654 Emit(kX87Float32Add, g.DefineAsFixed(node, stX_0), 0, NULL); | 671 Emit(kX87Float32Add, g.DefineAsFixed(node, stX_0), 0, NULL); |
655 } | 672 } |
656 | 673 |
657 | 674 |
658 void InstructionSelector::VisitFloat64Add(Node* node) { | 675 void InstructionSelector::VisitFloat64Add(Node* node) { |
659 X87OperandGenerator g(this); | 676 X87OperandGenerator g(this); |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 MachineOperatorBuilder::kFloat32Min | | 1346 MachineOperatorBuilder::kFloat32Min | |
1330 MachineOperatorBuilder::kFloat64Max | | 1347 MachineOperatorBuilder::kFloat64Max | |
1331 MachineOperatorBuilder::kFloat64Min | | 1348 MachineOperatorBuilder::kFloat64Min | |
1332 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1349 MachineOperatorBuilder::kWord32ShiftIsSafe; |
1333 return flags; | 1350 return flags; |
1334 } | 1351 } |
1335 | 1352 |
1336 } // namespace compiler | 1353 } // namespace compiler |
1337 } // namespace internal | 1354 } // namespace internal |
1338 } // namespace v8 | 1355 } // namespace v8 |
OLD | NEW |