From 47e608ab5261c7c222dbef4fab83be43865f784b Mon Sep 17 00:00:00 2001 From: "dusan.milosavljevic" Date: Wed, 25 Feb 2015 09:09:27 -0800 Subject: [PATCH] MIPS64: Improve and fix hole nan checks and canonicalization. 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 | 2 +- src/mips64/lithium-codegen-mips64.cc | 9 ++++----- src/mips64/macro-assembler-mips64.cc | 5 +++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ic/mips64/ic-mips64.cc b/src/ic/mips64/ic-mips64.cc index 54e6e64..1ec49c4 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(kHoleNanUpper32))); __ JumpIfDictionaryInPrototypeChain(receiver, elements_map, scratch_value, slow); diff --git a/src/mips64/lithium-codegen-mips64.cc b/src/mips64/lithium-codegen-mips64.cc index 89884ed..74dfc0f 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(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(kHoleNanUpper32))); } } diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc index c6305f0..64b8d1c 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); -- 2.7.4