Commit e6d12302 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC/s390: [arm] Fix infinite loop in Math.pow(2,2147483648).

Port e83739c0

    Fix applies to PPC/s390 as well.

R=jacob.bramley@arm.com, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=v8:5214
LOG=N

Review-Url: https://codereview.chromium.org/2167273003
Cr-Commit-Position: refs/heads/master@{#37956}
parent eaa86cbf
......@@ -805,7 +805,7 @@ void MathPowStub::Generate(MacroAssembler* masm) {
__ beq(&no_carry, cr0);
__ fmul(double_result, double_result, double_scratch);
__ bind(&no_carry);
__ ShiftRightArithImm(scratch, scratch, 1, SetRC);
__ ShiftRightImm(scratch, scratch, Operand(1), SetRC);
__ beq(&loop_end, cr0);
__ fmul(double_scratch, double_scratch, double_scratch);
__ b(&while_true);
......
......@@ -776,7 +776,8 @@ void MathPowStub::Generate(MacroAssembler* masm) {
__ beq(&no_carry, Label::kNear);
__ mdbr(double_result, double_scratch);
__ bind(&no_carry);
__ ShiftRightArithP(scratch, scratch, Operand(1));
__ ShiftRightP(scratch, scratch, Operand(1));
__ LoadAndTestP(scratch, scratch);
__ beq(&loop_end, Label::kNear);
__ mdbr(double_scratch, double_scratch);
__ b(&while_true);
......
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