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 7882253b21e9ae8bdc3ee5628220f623466bbc35..38d0197cbd319769553f97f85f83bf09c4d466f0 100644 |
--- a/src/compiler/x64/instruction-selector-x64.cc |
+++ b/src/compiler/x64/instruction-selector-x64.cc |
@@ -736,29 +736,49 @@ void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { |
void InstructionSelector::VisitFloat64Add(Node* node) { |
X64OperandGenerator g(this); |
- Emit(kSSEFloat64Add, g.DefineSameAsFirst(node), |
- g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ if (IsSupported(AVX)) { |
+ Emit(kAVXFloat64Add, g.DefineAsRegister(node), |
+ g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ } else { |
+ Emit(kSSEFloat64Add, g.DefineSameAsFirst(node), |
+ g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ } |
} |
void InstructionSelector::VisitFloat64Sub(Node* node) { |
X64OperandGenerator g(this); |
- Emit(kSSEFloat64Sub, g.DefineSameAsFirst(node), |
- g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ if (IsSupported(AVX)) { |
+ Emit(kAVXFloat64Sub, g.DefineAsRegister(node), |
+ g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ } else { |
+ Emit(kSSEFloat64Sub, g.DefineSameAsFirst(node), |
+ g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ } |
} |
void InstructionSelector::VisitFloat64Mul(Node* node) { |
X64OperandGenerator g(this); |
- Emit(kSSEFloat64Mul, g.DefineSameAsFirst(node), |
- g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ if (IsSupported(AVX)) { |
+ Emit(kAVXFloat64Mul, g.DefineAsRegister(node), |
+ g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ } else { |
+ Emit(kSSEFloat64Mul, g.DefineSameAsFirst(node), |
+ g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ } |
} |
void InstructionSelector::VisitFloat64Div(Node* node) { |
X64OperandGenerator g(this); |
- Emit(kSSEFloat64Div, g.DefineSameAsFirst(node), |
- g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ if (IsSupported(AVX)) { |
+ Emit(kAVXFloat64Div, g.DefineAsRegister(node), |
+ g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ } else { |
+ Emit(kSSEFloat64Div, g.DefineSameAsFirst(node), |
+ g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1))); |
+ } |
} |