diff --git a/src/compiler/mips/instruction-selector-mips.cc b/src/compiler/mips/instruction-selector-mips.cc index 3dcf708349..86bf3a421b 100644 --- a/src/compiler/mips/instruction-selector-mips.cc +++ b/src/compiler/mips/instruction-selector-mips.cc @@ -173,10 +173,9 @@ static void VisitBinop(InstructionSelector* selector, Node* node, &inputs[1])) { inputs[0] = g.UseRegister(m.left().node()); input_count++; - } - if (has_reverse_opcode && - TryMatchImmediate(selector, &reverse_opcode, m.left().node(), - &input_count, &inputs[1])) { + } else if (has_reverse_opcode && + TryMatchImmediate(selector, &reverse_opcode, m.left().node(), + &input_count, &inputs[1])) { inputs[0] = g.UseRegister(m.right().node()); opcode = reverse_opcode; input_count++; diff --git a/src/compiler/mips64/instruction-selector-mips64.cc b/src/compiler/mips64/instruction-selector-mips64.cc index d48007b858..5d5c3898cb 100644 --- a/src/compiler/mips64/instruction-selector-mips64.cc +++ b/src/compiler/mips64/instruction-selector-mips64.cc @@ -269,10 +269,9 @@ static void VisitBinop(InstructionSelector* selector, Node* node, &inputs[1])) { inputs[0] = g.UseRegister(m.left().node()); input_count++; - } - if (has_reverse_opcode && - TryMatchImmediate(selector, &reverse_opcode, m.left().node(), - &input_count, &inputs[1])) { + } else if (has_reverse_opcode && + TryMatchImmediate(selector, &reverse_opcode, m.left().node(), + &input_count, &inputs[1])) { inputs[0] = g.UseRegister(m.right().node()); opcode = reverse_opcode; input_count++;