 Chromium Code Reviews
 Chromium Code Reviews Issue 7604028:
  Fix three bugs with handling negative zero in the optimizing compiler.  (Closed) 
  Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
    
  
    Issue 7604028:
  Fix three bugs with handling negative zero in the optimizing compiler.  (Closed) 
  Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/| Index: src/arm/lithium-codegen-arm.cc | 
| =================================================================== | 
| --- src/arm/lithium-codegen-arm.cc (revision 8868) | 
| +++ src/arm/lithium-codegen-arm.cc (working copy) | 
| @@ -3014,14 +3014,13 @@ | 
| void LCodeGen::DoMathRound(LUnaryMathOperation* instr) { | 
| DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); | 
| Register result = ToRegister(instr->result()); | 
| - Register scratch1 = result; | 
| Register scratch2 = scratch0(); | 
| 
Kevin Millikin (Chromium)
2011/08/10 12:03:53
It doesn't really make sense to have scratch2 when
 
fschneider
2011/08/10 12:33:16
Done.
 | 
| Label done, check_sign_on_zero; | 
| // Extract exponent bits. | 
| - __ vmov(scratch1, input.high()); | 
| + __ vmov(result, input.high()); | 
| __ ubfx(scratch2, | 
| - scratch1, | 
| + result, | 
| HeapNumber::kExponentShift, | 
| HeapNumber::kExponentBits); | 
| @@ -3040,15 +3039,15 @@ | 
| DeoptimizeIf(ge, instr->environment()); | 
| // Save the original sign for later comparison. | 
| - __ and_(scratch2, scratch1, Operand(HeapNumber::kSignMask)); | 
| + __ and_(scratch2, result, Operand(HeapNumber::kSignMask)); | 
| __ Vmov(double_scratch0(), 0.5); | 
| __ vadd(input, input, double_scratch0()); | 
| // Check sign of the result: if the sign changed, the input | 
| // value was in ]0.5, 0[ and the result should be -0. | 
| - __ vmov(scratch1, input.high()); | 
| - __ eor(scratch1, scratch1, Operand(scratch2), SetCC); | 
| + __ vmov(result, input.high()); | 
| + __ eor(result, result, Operand(scratch2), SetCC); | 
| if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 
| DeoptimizeIf(mi, instr->environment()); | 
| } else { | 
| @@ -3059,7 +3058,7 @@ | 
| __ EmitVFPTruncate(kRoundToMinusInf, | 
| double_scratch0().low(), | 
| input, | 
| - scratch1, | 
| + result, | 
| scratch2); | 
| DeoptimizeIf(ne, instr->environment()); | 
| __ vmov(result, double_scratch0().low()); | 
| @@ -3069,8 +3068,8 @@ | 
| __ cmp(result, Operand(0)); | 
| __ b(ne, &done); | 
| __ bind(&check_sign_on_zero); | 
| - __ vmov(scratch1, input.high()); | 
| - __ tst(scratch1, Operand(HeapNumber::kSignMask)); | 
| + __ vmov(scratch2, input.high()); | 
| + __ tst(scratch2, Operand(HeapNumber::kSignMask)); | 
| DeoptimizeIf(ne, instr->environment()); | 
| } | 
| __ bind(&done); |