Chromium Code Reviews| Index: src/arm/lithium-codegen-arm.cc |
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
| index ac10793b46f56e7d088227233861c8e2aec06387..35dcc17b0da3ed6e6dc47a1f162598abe3dd53d0 100644 |
| --- a/src/arm/lithium-codegen-arm.cc |
| +++ b/src/arm/lithium-codegen-arm.cc |
| @@ -3097,9 +3097,20 @@ void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { |
| void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) { |
| DoubleRegister input = ToDoubleRegister(instr->InputAt(0)); |
| DoubleRegister result = ToDoubleRegister(instr->result()); |
| + |
| + // Note that according to ECMA-262 15.8.2.13: |
| + // Math.pow(-Infinity, 0.5) == Infinity |
| + // Math.sqrt(-Infinity) == NaN |
| + Label done; |
| + __ vmov(result, -INFINITY); |
| + __ vcmp(input, result); |
|
Rodolph Perfetta
2011/12/05 17:38:36
Confusingly on ARM vcmp does no set the flags! you
|
| + __ vneg(result, input, eq); |
| + __ b(&done, eq); |
| + |
| // Add +0 to convert -0 to +0. |
| __ vadd(result, input, kDoubleRegZero); |
| __ vsqrt(result, result); |
| + __ bind(&done); |
| } |