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) { ...@@ -1681,8 +1681,7 @@ void LCodeGen::DoSubI(LSubI* instr) {
} else { } else {
DCHECK(right->IsRegister() || right->IsConstantOperand()); DCHECK(right->IsRegister() || right->IsConstantOperand());
__ SubuAndCheckForOverflow(ToRegister(result), ToRegister(left), __ SubuAndCheckForOverflow(ToRegister(result), ToRegister(left),
ToOperand(right), ToOperand(right), overflow, scratch);
overflow); // Reg at also used as scratch.
} }
DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow, DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow,
Operand(zero_reg)); Operand(zero_reg));
...@@ -1878,8 +1877,7 @@ void LCodeGen::DoAddI(LAddI* instr) { ...@@ -1878,8 +1877,7 @@ void LCodeGen::DoAddI(LAddI* instr) {
} else { } else {
DCHECK(right->IsRegister() || right->IsConstantOperand()); DCHECK(right->IsRegister() || right->IsConstantOperand());
__ AdduAndCheckForOverflow(ToRegister(result), ToRegister(left), __ AdduAndCheckForOverflow(ToRegister(result), ToRegister(left),
ToOperand(right), ToOperand(right), overflow, scratch);
overflow); // Reg at also used as scratch.
} }
DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow, DeoptimizeIf(lt, instr, Deoptimizer::kOverflow, overflow,
Operand(zero_reg)); Operand(zero_reg));
......
...@@ -4459,7 +4459,7 @@ void MacroAssembler::AdduAndCheckForOverflow(Register dst, Register left, ...@@ -4459,7 +4459,7 @@ void MacroAssembler::AdduAndCheckForOverflow(Register dst, Register left,
xor_(overflow_dst, dst, t9); xor_(overflow_dst, dst, t9);
and_(overflow_dst, overflow_dst, scratch); and_(overflow_dst, overflow_dst, scratch);
} else { } else {
addiu(dst, left, right.immediate()); Addu(dst, left, right.immediate());
xor_(overflow_dst, dst, left); xor_(overflow_dst, dst, left);
// Load right since xori takes uint16 as immediate. // Load right since xori takes uint16 as immediate.
Addu(t9, zero_reg, right); 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