Index: src/compiler/ia32/instruction-selector-ia32.cc |
diff --git a/src/compiler/ia32/instruction-selector-ia32.cc b/src/compiler/ia32/instruction-selector-ia32.cc |
index dccfced9e1da2596d7cede9bcfae121f3deae243..1c48a7cd66d26a054744e36ad5a9767ff35d28fa 100644 |
--- a/src/compiler/ia32/instruction-selector-ia32.cc |
+++ b/src/compiler/ia32/instruction-selector-ia32.cc |
@@ -1918,10 +1918,16 @@ void InstructionSelector::VisitI32x4ExtractLane(Node* node) { |
void InstructionSelector::VisitI32x4ReplaceLane(Node* node) { |
IA32OperandGenerator g(this); |
- int32_t lane = OpParameter<int32_t>(node); |
- Emit(kIA32I32x4ReplaceLane, g.DefineSameAsFirst(node), |
- g.UseRegister(node->InputAt(0)), g.UseImmediate(lane), |
- g.Use(node->InputAt(1))); |
+ InstructionOperand operand0 = g.UseRegister(node->InputAt(0)); |
+ InstructionOperand operand1 = g.UseImmediate(OpParameter<int32_t>(node)); |
+ InstructionOperand operand2 = g.Use(node->InputAt(1)); |
+ if (IsSupported(AVX)) { |
+ Emit(kAVXI32x4ReplaceLane, g.DefineAsRegister(node), operand0, operand1, |
+ operand2); |
+ } else { |
+ Emit(kSSEI32x4ReplaceLane, g.DefineSameAsFirst(node), operand0, operand1, |
+ operand2); |
+ } |
} |
void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) { |