Reviewers: paul.l..., akos.palfi.imgtec, balazs.kilvady,

Message:
PTAL.

Description:
MIPS64: Improve and fix nan hole checks and canonicalization.

TEST=kraken-1.1 benchmark
BUG=

Please review this at https://codereview.chromium.org/952233002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+8, -8 lines):
  M src/ic/mips64/ic-mips64.cc
  M src/mips64/lithium-codegen-mips64.cc
  M src/mips64/macro-assembler-mips64.cc


Index: src/ic/mips64/ic-mips64.cc
diff --git a/src/ic/mips64/ic-mips64.cc b/src/ic/mips64/ic-mips64.cc
index 54e6e643d2e0ddce43b96ae6755e3c2f63153fa9..1ec49c45d479435eab4b0b1a0be53e00de3561bc 100644
--- a/src/ic/mips64/ic-mips64.cc
+++ b/src/ic/mips64/ic-mips64.cc
@@ -668,7 +668,7 @@ static void KeyedStoreGenerateMegamorphicHelper(
   __ daddu(address, address, at);
   __ lw(scratch_value, MemOperand(address));
   __ Branch(&fast_double_without_map_check, ne, scratch_value,
-            Operand(kHoleNanUpper32));
+            Operand(static_cast<int32_t>(kHoleNanUpper32)));
__ JumpIfDictionaryInPrototypeChain(receiver, elements_map, scratch_value,
                                       slow);

Index: src/mips64/lithium-codegen-mips64.cc
diff --git a/src/mips64/lithium-codegen-mips64.cc b/src/mips64/lithium-codegen-mips64.cc index bb256bff3cf89cb0bdfa30fc6583438eb2a60ec8..6447dced3fb28af800d36b609c43a2ac287b92c8 100644
--- a/src/mips64/lithium-codegen-mips64.cc
+++ b/src/mips64/lithium-codegen-mips64.cc
@@ -2363,9 +2363,8 @@ void LCodeGen::DoCmpHoleAndBranch(LCmpHoleAndBranch* instr) {

   Register scratch = scratch0();
   __ FmoveHigh(scratch, input_reg);
-  __ dsll32(scratch, scratch, 0);  // FmoveHigh (mfhc1) sign-extends.
-  __ dsrl32(scratch, scratch, 0);  // Use only low 32-bits.
-  EmitBranch(instr, eq, scratch, Operand(kHoleNanUpper32));
+  EmitBranch(instr, eq, scratch,
+             Operand(static_cast<int32_t>(kHoleNanUpper32)));
 }


@@ -3280,9 +3279,9 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) {
   __ ldc1(result, MemOperand(scratch));

   if (instr->hydrogen()->RequiresHoleCheck()) {
-    __ lwu(scratch, MemOperand(scratch, sizeof(kHoleNanLower32)));
+    __ FmoveHigh(scratch, result);
     DeoptimizeIf(eq, instr, Deoptimizer::kHole, scratch,
-                 Operand(kHoleNanUpper32));
+                 Operand(static_cast<int32_t>(kHoleNanUpper32)));
   }
 }

Index: src/mips64/macro-assembler-mips64.cc
diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc index bc935326cfe1aac1e816742154a45e0bcc0aeca6..42898c94815b12b1e9bb256ab2918c978f0a8d3b 100644
--- a/src/mips64/macro-assembler-mips64.cc
+++ b/src/mips64/macro-assembler-mips64.cc
@@ -3884,13 +3884,14 @@ void MacroAssembler::StoreNumberToDoubleElements(Register value_reg,
   DoubleRegister double_scratch = f2;

ldc1(double_result, FieldMemOperand(value_reg, HeapNumber::kValueOffset));
+  Branch(USE_DELAY_SLOT, &done);  // Canonicalization is one instruction.
   FPUCanonicalizeNaN(double_result, double_result);
-  Branch(&done);

   bind(&smi_value);
   // scratch1 is now effective address of the double element.
   // Untag and transfer.
-  mthc1(value_reg, double_scratch);
+  dsrl32(at, value_reg, 0);
+  mtc1(at, double_scratch);
   cvt_d_w(double_result, double_scratch);

   bind(&done);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to