| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "src/base/adapters.h" | 7 #include "src/base/adapters.h" |
| 8 #include "src/compiler/instruction-selector-impl.h" | 8 #include "src/compiler/instruction-selector-impl.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 827 Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 828 } | 828 } |
| 829 | 829 |
| 830 | 830 |
| 831 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { | 831 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { |
| 832 X64OperandGenerator g(this); | 832 X64OperandGenerator g(this); |
| 833 Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 833 Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 834 } | 834 } |
| 835 | 835 |
| 836 | 836 |
| 837 void InstructionSelector::VisitTruncateFloat32ToInt64(Node* node) { | 837 void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) { |
| 838 X64OperandGenerator g(this); | 838 X64OperandGenerator g(this); |
| 839 Emit(kSSEFloat32ToInt64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 839 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; |
| 840 InstructionOperand outputs[2]; |
| 841 size_t output_count = 0; |
| 842 outputs[output_count++] = g.DefineAsRegister(node); |
| 843 |
| 844 Node* success_output = NodeProperties::FindProjection(node, 1); |
| 845 if (success_output) { |
| 846 outputs[output_count++] = g.DefineAsRegister(success_output); |
| 847 } |
| 848 |
| 849 Emit(kSSEFloat32ToInt64, output_count, outputs, 1, inputs); |
| 840 } | 850 } |
| 841 | 851 |
| 842 | 852 |
| 843 void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) { | 853 void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) { |
| 844 X64OperandGenerator g(this); | 854 X64OperandGenerator g(this); |
| 845 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; | 855 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; |
| 846 InstructionOperand outputs[2]; | 856 InstructionOperand outputs[2]; |
| 847 size_t output_count = 0; | 857 size_t output_count = 0; |
| 848 outputs[output_count++] = g.DefineAsRegister(node); | 858 outputs[output_count++] = g.DefineAsRegister(node); |
| 849 | 859 |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 MachineOperatorBuilder::kFloat64RoundTruncate | | 1761 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1752 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1762 MachineOperatorBuilder::kFloat32RoundTiesEven | |
| 1753 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1763 MachineOperatorBuilder::kFloat64RoundTiesEven; |
| 1754 } | 1764 } |
| 1755 return flags; | 1765 return flags; |
| 1756 } | 1766 } |
| 1757 | 1767 |
| 1758 } // namespace compiler | 1768 } // namespace compiler |
| 1759 } // namespace internal | 1769 } // namespace internal |
| 1760 } // namespace v8 | 1770 } // namespace v8 |
| OLD | NEW |