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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 VisitRR(this, kMips64CvtDW, node); | 756 VisitRR(this, kMips64CvtDW, node); |
757 } | 757 } |
758 | 758 |
759 | 759 |
760 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { | 760 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { |
761 VisitRR(this, kMips64CvtDUw, node); | 761 VisitRR(this, kMips64CvtDUw, node); |
762 } | 762 } |
763 | 763 |
764 | 764 |
765 void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) { | 765 void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) { |
| 766 Mips64OperandGenerator g(this); |
| 767 Node* value = node->InputAt(0); |
| 768 // Match ChangeFloat64ToInt32(Float64Round##OP) to corresponding instruction |
| 769 // which does rounding and conversion to integer format. |
| 770 if (CanCover(node, value)) { |
| 771 switch (value->opcode()) { |
| 772 case IrOpcode::kFloat64RoundDown: |
| 773 Emit(kMips64FloorWD, g.DefineAsRegister(node), |
| 774 g.UseRegister(value->InputAt(0))); |
| 775 return; |
| 776 case IrOpcode::kFloat64RoundUp: |
| 777 Emit(kMips64CeilWD, g.DefineAsRegister(node), |
| 778 g.UseRegister(value->InputAt(0))); |
| 779 return; |
| 780 case IrOpcode::kFloat64RoundTiesEven: |
| 781 Emit(kMips64RoundWD, g.DefineAsRegister(node), |
| 782 g.UseRegister(value->InputAt(0))); |
| 783 return; |
| 784 case IrOpcode::kFloat64RoundTruncate: |
| 785 Emit(kMips64TruncWD, g.DefineAsRegister(node), |
| 786 g.UseRegister(value->InputAt(0))); |
| 787 return; |
| 788 default: |
| 789 VisitRR(this, kMips64TruncWD, node); |
| 790 return; |
| 791 } |
| 792 } |
766 VisitRR(this, kMips64TruncWD, node); | 793 VisitRR(this, kMips64TruncWD, node); |
767 } | 794 } |
768 | 795 |
769 | 796 |
770 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { | 797 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { |
771 VisitRR(this, kMips64TruncUwD, node); | 798 VisitRR(this, kMips64TruncUwD, node); |
772 } | 799 } |
773 | 800 |
774 | 801 |
775 void InstructionSelector::VisitTruncateFloat32ToInt64(Node* node) { | 802 void InstructionSelector::VisitTruncateFloat32ToInt64(Node* node) { |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 MachineOperatorBuilder::kFloat32RoundUp | | 1690 MachineOperatorBuilder::kFloat32RoundUp | |
1664 MachineOperatorBuilder::kFloat64RoundTruncate | | 1691 MachineOperatorBuilder::kFloat64RoundTruncate | |
1665 MachineOperatorBuilder::kFloat32RoundTruncate | | 1692 MachineOperatorBuilder::kFloat32RoundTruncate | |
1666 MachineOperatorBuilder::kFloat64RoundTiesEven | | 1693 MachineOperatorBuilder::kFloat64RoundTiesEven | |
1667 MachineOperatorBuilder::kFloat32RoundTiesEven; | 1694 MachineOperatorBuilder::kFloat32RoundTiesEven; |
1668 } | 1695 } |
1669 | 1696 |
1670 } // namespace compiler | 1697 } // namespace compiler |
1671 } // namespace internal | 1698 } // namespace internal |
1672 } // namespace v8 | 1699 } // namespace v8 |
OLD | NEW |