Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: src/ia32/lithium-codegen-ia32.cc

Issue 863633002: Use signaling NaN for holes in fixed double arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Next bunch of fixes Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698