Chromium Code Reviews| Index: src/compiler/x64/instruction-selector-x64.cc |
| diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc |
| index 41674a37e3838afd8e0575ec6d6b329ea217f99a..e3a52a53ab6cc51aac276202f1b88b59d52fc814 100644 |
| --- a/src/compiler/x64/instruction-selector-x64.cc |
| +++ b/src/compiler/x64/instruction-selector-x64.cc |
| @@ -120,6 +120,14 @@ class AddressingModeMatcher { |
| }; |
| +static void VisitRRFloat64(InstructionSelector* selector, ArchOpcode opcode, |
| + Node* node) { |
| + X64OperandGenerator g(selector); |
| + selector->Emit(opcode, g.DefineAsRegister(node), |
| + g.UseRegister(node->InputAt(0))); |
| +} |
| + |
| + |
| void InstructionSelector::VisitLoad(Node* node) { |
| MachineType rep = RepresentationOf(OpParameter<LoadRepresentation>(node)); |
| MachineType typ = TypeOf(OpParameter<LoadRepresentation>(node)); |
| @@ -723,6 +731,35 @@ void InstructionSelector::VisitFloat64Sqrt(Node* node) { |
| } |
| +void InstructionSelector::VisitFloat64Floor(Node* node) { |
| + 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.
|
| + UNSUPPORTED_OPERATOR(node); |
| + } |
| + VisitRRFloat64(this, kSSEFloat64Floor, node); |
| +} |
| + |
| + |
| +void InstructionSelector::VisitFloat64Ceil(Node* node) { |
| + 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.
|
| + UNSUPPORTED_OPERATOR(node); |
| + } |
| + VisitRRFloat64(this, kSSEFloat64Ceil, node); |
| +} |
| + |
| + |
| +void InstructionSelector::VisitFloat64RoundTruncate(Node* node) { |
| + 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.
|
| + UNSUPPORTED_OPERATOR(node); |
| + } |
| + VisitRRFloat64(this, kSSEFloat64RoundTruncate, node); |
| +} |
| + |
| + |
| +void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) { |
| + 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.
|
| +} |
| + |
| + |
| void InstructionSelector::VisitCall(Node* node) { |
| X64OperandGenerator g(this); |
| CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node); |
| @@ -1112,9 +1149,13 @@ void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { |
| // static |
| MachineOperatorBuilder::Flags |
| InstructionSelector::SupportedMachineOperatorFlags() { |
| + if (CpuFeatures::IsSupported(SSE4_1)) { |
| + return MachineOperatorBuilder::kFloat64Floor | |
| + MachineOperatorBuilder::kFloat64Ceil | |
| + MachineOperatorBuilder::kFloat64RoundTruncate; |
| + } |
| return MachineOperatorBuilder::kNoFlags; |
| } |
| - |
| } // namespace compiler |
| } // namespace internal |
| } // namespace v8 |