Commit 382619d3 authored by plind44@gmail.com's avatar plind44@gmail.com

MIPS: Fix improper register use in DoMinMax.

This fixes failure on pidigit benchmark from web-shootout
after 840 digits are calculated.

TEST=
BUG=
R=plind44@gmail.com

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

Patch from Dusan Milosavljevic <Dusan.Milosavljevic@rt-rk.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21540 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 47664dc1
......@@ -1921,20 +1921,19 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
Condition condition = (operation == HMathMinMax::kMathMin) ? le : ge;
if (instr->hydrogen()->representation().IsSmiOrInteger32()) {
Register left_reg = ToRegister(left);
Operand right_op = (right->IsRegister() || right->IsConstantOperand())
? ToOperand(right)
: Operand(EmitLoadRegister(right, at));
Register right_reg = EmitLoadRegister(right, scratch0());
Register result_reg = ToRegister(instr->result());
Label return_right, done;
if (!result_reg.is(left_reg)) {
__ Branch(&return_right, NegateCondition(condition), left_reg, right_op);
__ mov(result_reg, left_reg);
__ Branch(&done);
Register scratch = scratch1();
__ Slt(scratch, left_reg, Operand(right_reg));
if (condition == ge) {
__ Movz(result_reg, left_reg, scratch);
__ Movn(result_reg, right_reg, scratch);
} else {
ASSERT(condition == le);
__ Movn(result_reg, left_reg, scratch);
__ Movz(result_reg, right_reg, scratch);
}
__ Branch(&done, condition, left_reg, right_op);
__ bind(&return_right);
__ Addu(result_reg, zero_reg, right_op);
__ bind(&done);
} else {
ASSERT(instr->hydrogen()->representation().IsDouble());
FPURegister left_reg = ToDoubleRegister(left);
......
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