| Index: src/ia32/lithium-codegen-ia32.cc
|
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
|
| index 5d3d11be17d27668355507b42f4321575c9ba31a..a569be9cc44c6fa0db015039b33f718de3d03a32 100644
|
| --- a/src/ia32/lithium-codegen-ia32.cc
|
| +++ b/src/ia32/lithium-codegen-ia32.cc
|
| @@ -3894,9 +3894,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 =
|
| @@ -4250,8 +4254,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(),
|
| @@ -4262,13 +4264,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);
|
| @@ -4761,9 +4760,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 {
|
|
|