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 82134b45c1b2b8252b2cc906719b3a06a3a91cc8..890cd7e8e2713ab23635c8b0d8400c37c7a5b41f 100644 |
| --- a/src/arm/lithium-codegen-arm.cc |
| +++ b/src/arm/lithium-codegen-arm.cc |
| @@ -4431,18 +4431,14 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { |
| } |
| if (instr->NeedsCanonicalization()) { |
| - // Check for NaN. All NaNs must be canonicalized. |
| - __ VFPCompareAndSetFlags(value, value); |
| - Label after_canonicalization; |
| - |
| - // Only load canonical NaN if the comparison above set the overflow. |
| - __ b(vc, &after_canonicalization); |
| - __ Vmov(value, |
| - FixedDoubleArray::canonical_not_the_hole_nan_as_double()); |
| - |
| - __ bind(&after_canonicalization); |
| + // Force a canonical NaN. |
| + if (masm()->emit_debug_code()) { |
| + __ vmrs(ip); |
| + __ tst(ip, Operand(kVFPDefaultNaNModeControlBit)); |
| + __ Assert(ne, "Default NaN mode not set"); |
| + } |
| + __ vsub(value, value, kDoubleRegZero); |
| } |
| - |
| __ vstr(value, scratch, instr->additional_index() << element_size_shift); |
| } |
| @@ -4864,16 +4860,13 @@ void LCodeGen::DoNumberTagD(LNumberTagD* instr) { |
| DwVfpRegister input_reg = ToDoubleRegister(instr->value()); |
| __ VFPCompareAndSetFlags(input_reg, input_reg); |
| __ b(vc, &no_special_nan_handling); |
| - __ vmov(reg, scratch0(), input_reg); |
| - __ cmp(scratch0(), Operand(kHoleNanUpper32)); |
| - Label canonicalize; |
| - __ b(ne, &canonicalize); |
| + __ vmov(scratch, input_reg.high()); |
| + __ cmp(scratch, Operand(kHoleNanUpper32)); |
| + // If not the hole NaN, force the NaN to be canonical. |
| + __ vadd(input_reg, input_reg, kDoubleRegZero, ne); |
|
ulan
2013/04/15 07:43:01
In other places vsub is used to canonicalize. Mayb
|
| + __ b(ne, &no_special_nan_handling); |
| __ Move(reg, factory()->the_hole_value()); |
| __ b(&done); |
| - __ bind(&canonicalize); |
| - __ Vmov(input_reg, |
| - FixedDoubleArray::canonical_not_the_hole_nan_as_double(), |
| - no_reg); |
| } |
| __ bind(&no_special_nan_handling); |