Chromium Code Reviews| Index: src/arm/lithium-codegen-arm.cc |
| =================================================================== |
| --- src/arm/lithium-codegen-arm.cc (revision 6218) |
| +++ src/arm/lithium-codegen-arm.cc (working copy) |
| @@ -1076,8 +1076,17 @@ |
| EmitBranch(true_block, false_block, nz); |
| } else if (r.IsDouble()) { |
| DoubleRegister reg = ToDoubleRegister(instr->input()); |
| + Register scratch = scratch0(); |
| + |
| + // Test for the double value. Zero and NaN are false. |
| + // Clear the Invalid cumulative exception flags. |
|
Søren Thygesen Gjesse
2011/01/07 11:44:32
I will suggest a macro assembler instruction for t
Alexandre
2011/01/07 18:34:49
Added the ClearFPSCRBits Masm instruction.
On 2011
|
| + __ vmrs(scratch); |
| + __ bic(scratch, scratch, Operand(kVFPInvalidExceptionBit)); |
| + __ vmsr(scratch); |
| __ vcmp(reg, 0.0); |
| - __ vmrs(pc); // Move vector status bits to normal status bits. |
| + __ vmrs(scratch); // Retrieve the exception and status flags. |
| + // Check for zero or an invalid exception. |
| + __ tst(scratch, Operand(kVFPZConditionFlagBit | kVFPInvalidExceptionBit)); |
| EmitBranch(true_block, false_block, ne); |
| } else { |
| ASSERT(r.IsTagged()); |
| @@ -1104,7 +1113,7 @@ |
| __ tst(reg, Operand(kSmiTagMask)); |
| __ b(eq, true_label); |
| - // Test for double values. Zero is false. |
| + // Test for double values. Zero and NaN are false. |
| Label call_stub; |
| DoubleRegister dbl_scratch = d0; |
| Register scratch = scratch0(); |
| @@ -1114,9 +1123,15 @@ |
| __ b(ne, &call_stub); |
| __ sub(ip, reg, Operand(kHeapObjectTag)); |
| __ vldr(dbl_scratch, ip, HeapNumber::kValueOffset); |
| + // Clear the Invalid cumulative exception flags. |
|
Søren Thygesen Gjesse
2011/01/07 11:44:32
Ditto.
Alexandre
2011/01/07 18:34:49
Used the new pseudo instruction.
On 2011/01/07 11:
|
| + __ vmrs(scratch); |
| + __ bic(scratch, scratch, Operand(kVFPInvalidExceptionBit)); |
| + __ vmsr(scratch); |
| __ vcmp(dbl_scratch, 0.0); |
| - __ vmrs(pc); // Move vector status bits to normal status bits. |
| - __ b(eq, false_label); |
| + __ vmrs(scratch); // Retrieve the exception and status flags. |
| + // Check for zero or an invalid exception. |
| + __ tst(scratch, Operand(kVFPZConditionFlagBit | kVFPInvalidExceptionBit)); |
| + __ b(ne, false_label); |
| __ b(true_label); |
| // The conversion stub doesn't cause garbage collections so it's |