diff --git a/src/compiler/ia32/instruction-selector-ia32.cc b/src/compiler/ia32/instruction-selector-ia32.cc index 43b572170f..a1dbcf0bfa 100644 --- a/src/compiler/ia32/instruction-selector-ia32.cc +++ b/src/compiler/ia32/instruction-selector-ia32.cc @@ -237,7 +237,12 @@ void VisitRRISimd(InstructionSelector* selector, Node* node, InstructionOperand operand0 = g.UseRegister(node->InputAt(0)); InstructionOperand operand1 = g.UseImmediate(OpParameter<int32_t>(node->op())); - selector->Emit(opcode, g.DefineAsRegister(node), operand0, operand1); + // 8x16 uses movsx_b on dest to extract a byte, which only works + // if dest is a byte register. + InstructionOperand dest = opcode == kIA32I8x16ExtractLane + ? g.DefineAsFixed(node, eax) + : g.DefineAsRegister(node); + selector->Emit(opcode, dest, operand0, operand1); } void VisitRRISimd(InstructionSelector* selector, Node* node, diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc index 83c8054917..01c505830b 100644 --- a/src/ia32/assembler-ia32.cc +++ b/src/ia32/assembler-ia32.cc @@ -687,6 +687,7 @@ void Assembler::mov(Operand dst, Register src) { } void Assembler::movsx_b(Register dst, Operand src) { + DCHECK_IMPLIES(src.is_reg_only(), src.reg().is_byte_register()); EnsureSpace ensure_space(this); EMIT(0x0F); EMIT(0xBE); @@ -701,6 +702,7 @@ void Assembler::movsx_w(Register dst, Operand src) { } void Assembler::movzx_b(Register dst, Operand src) { + DCHECK_IMPLIES(src.is_reg_only(), src.reg().is_byte_register()); EnsureSpace ensure_space(this); EMIT(0x0F); EMIT(0xB6);