Commit 879053a5 authored by paul.lind's avatar paul.lind Committed by Commit bot

MIPS: Fix for Remove unsafe EmitLoadRegister usage in AddI/SubI for constant right operand.

Fix a missed addiu->Addu, and a bad default use of 'at' register in https://codereview.chromium.org/1185143002/

TEST=test/mjsunit/regress/regress-500176
BUG=chromium:500176
LOG=N

Review URL: https://codereview.chromium.org/1187063002

Cr-Commit-Position: refs/heads/master@{#29034}
parent 350a70e5
......@@ -1681,8 +1681,7 @@ void LCodeGen::DoSubI(LSubI* instr) {
} else {
DCHECK(right->IsRegister() || right->IsConstantOperand());
__ SubuAndCheckForOverflow(ToRegister(result), ToRegister(left),
ToOperand(right),
overflow); // Reg at also used as scratch.
ToOperand(right), overflow, scratch);
}
DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow,
Operand(zero_reg));
......@@ -1878,8 +1877,7 @@ void LCodeGen::DoAddI(LAddI* instr) {
} else {
DCHECK(right->IsRegister() || right->IsConstantOperand());
__ AdduAndCheckForOverflow(ToRegister(result), ToRegister(left),
ToOperand(right),
overflow); // Reg at also used as scratch.
ToOperand(right), overflow, scratch);
}
DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow,
Operand(zero_reg));
......
......@@ -4459,7 +4459,7 @@ void MacroAssembler::AdduAndCheckForOverflow(Register dst, Register left,
xor_(overflow_dst, dst, t9);
and_(overflow_dst, overflow_dst, scratch);
} else {
addiu(dst, left, right.immediate());
Addu(dst, left, right.immediate());
xor_(overflow_dst, dst, left);
// Load right since xori takes uint16 as immediate.
Addu(t9, zero_reg, right);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment