Chromium Code Reviews| 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/compiler/generic-node-inl.h" | 5 #include "src/compiler/generic-node-inl.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 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 } | 113 } |
| 114 | 114 |
| 115 static const int kMaxInputCount = 3; | 115 static const int kMaxInputCount = 3; |
| 116 InstructionOperand* base_operand_; | 116 InstructionOperand* base_operand_; |
| 117 InstructionOperand* index_operand_; | 117 InstructionOperand* index_operand_; |
| 118 InstructionOperand* displacement_operand_; | 118 InstructionOperand* displacement_operand_; |
| 119 AddressingMode mode_; | 119 AddressingMode mode_; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 | 122 |
| 123 static void VisitRRFloat64(InstructionSelector* selector, ArchOpcode opcode, | |
| 124 Node* node) { | |
| 125 X64OperandGenerator g(selector); | |
| 126 selector->Emit(opcode, g.DefineAsRegister(node), | |
| 127 g.UseRegister(node->InputAt(0))); | |
| 128 } | |
| 129 | |
| 130 | |
| 123 void InstructionSelector::VisitLoad(Node* node) { | 131 void InstructionSelector::VisitLoad(Node* node) { |
| 124 MachineType rep = RepresentationOf(OpParameter<LoadRepresentation>(node)); | 132 MachineType rep = RepresentationOf(OpParameter<LoadRepresentation>(node)); |
| 125 MachineType typ = TypeOf(OpParameter<LoadRepresentation>(node)); | 133 MachineType typ = TypeOf(OpParameter<LoadRepresentation>(node)); |
| 126 Node* base = node->InputAt(0); | 134 Node* base = node->InputAt(0); |
| 127 Node* index = node->InputAt(1); | 135 Node* index = node->InputAt(1); |
| 128 | 136 |
| 129 ArchOpcode opcode; | 137 ArchOpcode opcode; |
| 130 // TODO(titzer): signed/unsigned small loads | 138 // TODO(titzer): signed/unsigned small loads |
| 131 switch (rep) { | 139 switch (rep) { |
| 132 case kRepFloat32: | 140 case kRepFloat32: |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 716 temps); | 724 temps); |
| 717 } | 725 } |
| 718 | 726 |
| 719 | 727 |
| 720 void InstructionSelector::VisitFloat64Sqrt(Node* node) { | 728 void InstructionSelector::VisitFloat64Sqrt(Node* node) { |
| 721 X64OperandGenerator g(this); | 729 X64OperandGenerator g(this); |
| 722 Emit(kSSEFloat64Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 730 Emit(kSSEFloat64Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 723 } | 731 } |
| 724 | 732 |
| 725 | 733 |
| 734 void InstructionSelector::VisitFloat64Floor(Node* node) { | |
| 735 if (!CpuFeatures::IsSupported(SSE4_1)) { | |
|
Benedikt Meurer
2014/10/30 11:59:13
I think this should be DCHECK(CpuFeatures::IsSuppo
sigurds
2014/10/30 12:18:27
Done.
| |
| 736 UNSUPPORTED_OPERATOR(node); | |
| 737 } | |
| 738 VisitRRFloat64(this, kSSEFloat64Floor, node); | |
| 739 } | |
| 740 | |
| 741 | |
| 742 void InstructionSelector::VisitFloat64Ceil(Node* node) { | |
| 743 if (!CpuFeatures::IsSupported(SSE4_1)) { | |
|
Benedikt Meurer
2014/10/30 11:59:13
I think this should be DCHECK(CpuFeatures::IsSuppo
sigurds
2014/10/30 12:18:27
Done.
| |
| 744 UNSUPPORTED_OPERATOR(node); | |
| 745 } | |
| 746 VisitRRFloat64(this, kSSEFloat64Ceil, node); | |
| 747 } | |
| 748 | |
| 749 | |
| 750 void InstructionSelector::VisitFloat64RoundTruncate(Node* node) { | |
| 751 if (!CpuFeatures::IsSupported(SSE4_1)) { | |
|
Benedikt Meurer
2014/10/30 11:59:13
I think this should be DCHECK(CpuFeatures::IsSuppo
sigurds
2014/10/30 12:18:27
Done.
| |
| 752 UNSUPPORTED_OPERATOR(node); | |
| 753 } | |
| 754 VisitRRFloat64(this, kSSEFloat64RoundTruncate, node); | |
| 755 } | |
| 756 | |
| 757 | |
| 758 void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) { | |
| 759 UNSUPPORTED_OPERATOR(node); | |
|
Benedikt Meurer
2014/10/30 11:59:13
Just put in UNREACHABLE(); here.
Benedikt Meurer
2014/10/30 11:59:13
Just put in UNREACHABLE(); here.
sigurds
2014/10/30 12:18:27
Done.
| |
| 760 } | |
| 761 | |
| 762 | |
| 726 void InstructionSelector::VisitCall(Node* node) { | 763 void InstructionSelector::VisitCall(Node* node) { |
| 727 X64OperandGenerator g(this); | 764 X64OperandGenerator g(this); |
| 728 CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node); | 765 CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node); |
| 729 | 766 |
| 730 FrameStateDescriptor* frame_state_descriptor = NULL; | 767 FrameStateDescriptor* frame_state_descriptor = NULL; |
| 731 if (descriptor->NeedsFrameState()) { | 768 if (descriptor->NeedsFrameState()) { |
| 732 frame_state_descriptor = GetFrameStateDescriptor( | 769 frame_state_descriptor = GetFrameStateDescriptor( |
| 733 node->InputAt(static_cast<int>(descriptor->InputCount()))); | 770 node->InputAt(static_cast<int>(descriptor->InputCount()))); |
| 734 } | 771 } |
| 735 | 772 |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1105 | 1142 |
| 1106 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { | 1143 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { |
| 1107 FlagsContinuation cont(kUnorderedLessThanOrEqual, node); | 1144 FlagsContinuation cont(kUnorderedLessThanOrEqual, node); |
| 1108 VisitFloat64Compare(this, node, &cont); | 1145 VisitFloat64Compare(this, node, &cont); |
| 1109 } | 1146 } |
| 1110 | 1147 |
| 1111 | 1148 |
| 1112 // static | 1149 // static |
| 1113 MachineOperatorBuilder::Flags | 1150 MachineOperatorBuilder::Flags |
| 1114 InstructionSelector::SupportedMachineOperatorFlags() { | 1151 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1152 if (CpuFeatures::IsSupported(SSE4_1)) { | |
| 1153 return MachineOperatorBuilder::kFloat64Floor | | |
| 1154 MachineOperatorBuilder::kFloat64Ceil | | |
| 1155 MachineOperatorBuilder::kFloat64RoundTruncate; | |
| 1156 } | |
| 1115 return MachineOperatorBuilder::kNoFlags; | 1157 return MachineOperatorBuilder::kNoFlags; |
| 1116 } | 1158 } |
| 1117 | |
| 1118 } // namespace compiler | 1159 } // namespace compiler |
| 1119 } // namespace internal | 1160 } // namespace internal |
| 1120 } // namespace v8 | 1161 } // namespace v8 |
| OLD | NEW |