MIPS64: Improve and fix hole nan checks and canonicalization.
authordusan.milosavljevic <dusan.milosavljevic@imgtec.com>
Wed, 25 Feb 2015 17:09:27 +0000 (09:09 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 25 Feb 2015 17:09:37 +0000 (17:09 +0000)
TEST=kraken-1.1 benchmark
BUG=

Review URL: https://codereview.chromium.org/952233002

Cr-Commit-Position: refs/heads/master@{#26861}

src/ic/mips64/ic-mips64.cc
src/mips64/lithium-codegen-mips64.cc
src/mips64/macro-assembler-mips64.cc

index 54e6e64..1ec49c4 100644 (file)
@@ -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 89884ed..74dfc0f 100644 (file)
@@ -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)));
 }
 
 
@@ -3279,9 +3278,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 c6305f0..64b8d1c 100644 (file)
@@ -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);