| Index: src/ia32/lithium-codegen-ia32.cc
|
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
|
| index c4e0a9df406396918285493e150328c2ea725962..c1a0aafc43c1ad8f3142d0a97c36995e1b8f8f56 100644
|
| --- a/src/ia32/lithium-codegen-ia32.cc
|
| +++ b/src/ia32/lithium-codegen-ia32.cc
|
| @@ -3870,9 +3870,13 @@ void LCodeGen::DoMathLog(LMathLog* instr) {
|
| __ ucomisd(input_reg, xmm_scratch);
|
| __ j(above, &positive, Label::kNear);
|
| __ j(not_carry, &zero, Label::kNear);
|
| - ExternalReference nan =
|
| - ExternalReference::address_of_canonical_non_hole_nan();
|
| - __ movsd(input_reg, Operand::StaticVariable(nan));
|
| + if (CpuFeatures::IsSupported(AVX)) {
|
| + CpuFeatureScope scope2(masm(), AVX);
|
| + __ vdivsd(input_reg, xmm_scratch, xmm_scratch);
|
| + } else {
|
| + __ divsd(xmm_scratch, xmm_scratch);
|
| + __ movsd(input_reg, xmm_scratch);
|
| + }
|
| __ jmp(&done, Label::kNear);
|
| __ bind(&zero);
|
| ExternalReference ninf =
|
| @@ -4226,8 +4230,6 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
|
|
|
|
|
| void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) {
|
| - ExternalReference canonical_nan_reference =
|
| - ExternalReference::address_of_canonical_non_hole_nan();
|
| Operand double_store_operand = BuildFastArrayOperand(
|
| instr->elements(),
|
| instr->key(),
|
| @@ -4238,13 +4240,10 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) {
|
| XMMRegister value = ToDoubleRegister(instr->value());
|
|
|
| if (instr->NeedsCanonicalization()) {
|
| - Label have_value;
|
| -
|
| - __ ucomisd(value, value);
|
| - __ j(parity_odd, &have_value, Label::kNear); // NaN.
|
| -
|
| - __ movsd(value, Operand::StaticVariable(canonical_nan_reference));
|
| - __ bind(&have_value);
|
| + XMMRegister xmm_scratch = double_scratch0();
|
| + // Turn potential sNaN value into qNaN.
|
| + __ xorps(xmm_scratch, xmm_scratch);
|
| + __ subsd(value, xmm_scratch);
|
| }
|
|
|
| __ movsd(double_store_operand, value);
|
| @@ -4737,9 +4736,8 @@ void LCodeGen::EmitNumberUntagD(LNumberUntagD* instr, Register input_reg,
|
| __ cmp(input_reg, factory()->undefined_value());
|
| DeoptimizeIf(not_equal, instr, "not a heap number/undefined");
|
|
|
| - ExternalReference nan =
|
| - ExternalReference::address_of_canonical_non_hole_nan();
|
| - __ movsd(result_reg, Operand::StaticVariable(nan));
|
| + __ xorps(result_reg, result_reg);
|
| + __ divsd(result_reg, result_reg);
|
| __ jmp(&done, Label::kNear);
|
| }
|
| } else {
|
|
|