From 055c29fd0f752328981f1b7ccadb1862eecedd40 Mon Sep 17 00:00:00 2001 From: buzbee Date: Tue, 27 May 2014 13:59:04 -0700 Subject: Art compiler: remove unnecessary sqrt call For reasons lost in the mists of time, the Dalvik JIT tested the results of an inlined sqrt for NaN on Arm targets, and then called an out-of-line routine to recompute if true. The Quick compiler inherited this behavior. It is not necessary, and the CL purges it (along with the out-of-line sqrt entrypoint). Change-Id: I8c8fa6feacf9b7c3b9e190dfc6f728932fd948c6 --- compiler/dex/quick/arm/fp_arm.cc | 11 ----------- compiler/oat_test.cc | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'compiler') diff --git a/compiler/dex/quick/arm/fp_arm.cc b/compiler/dex/quick/arm/fp_arm.cc index bb02f74751..18d4391f92 100644 --- a/compiler/dex/quick/arm/fp_arm.cc +++ b/compiler/dex/quick/arm/fp_arm.cc @@ -334,22 +334,11 @@ void ArmMir2Lir::GenNegDouble(RegLocation rl_dest, RegLocation rl_src) { bool ArmMir2Lir::GenInlinedSqrt(CallInfo* info) { DCHECK_EQ(cu_->instruction_set, kThumb2); - LIR *branch; RegLocation rl_src = info->args[0]; RegLocation rl_dest = InlineTargetWide(info); // double place for result rl_src = LoadValueWide(rl_src, kFPReg); RegLocation rl_result = EvalLoc(rl_dest, kFPReg, true); NewLIR2(kThumb2Vsqrtd, rl_result.reg.GetReg(), rl_src.reg.GetReg()); - NewLIR2(kThumb2Vcmpd, rl_result.reg.GetReg(), rl_result.reg.GetReg()); - NewLIR0(kThumb2Fmstat); - branch = NewLIR2(kThumbBCond, 0, kArmCondEq); - ClobberCallerSave(); - LockCallTemps(); // Using fixed registers - RegStorage r_tgt = LoadHelper(QUICK_ENTRYPOINT_OFFSET(4, pSqrt)); - NewLIR3(kThumb2Fmrrd, rs_r0.GetReg(), rs_r1.GetReg(), rl_src.reg.GetReg()); - NewLIR1(kThumbBlxR, r_tgt.GetReg()); - NewLIR3(kThumb2Fmdrr, rl_result.reg.GetReg(), rs_r0.GetReg(), rs_r1.GetReg()); - branch->target = NewLIR0(kPseudoTargetLabel); StoreValueWide(rl_dest, rl_result); return true; } diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc index 6812f3c9df..49cf71b7eb 100644 --- a/compiler/oat_test.cc +++ b/compiler/oat_test.cc @@ -180,7 +180,7 @@ TEST_F(OatTest, OatHeaderSizeCheck) { EXPECT_EQ(80U, sizeof(OatHeader)); EXPECT_EQ(8U, sizeof(OatMethodOffsets)); EXPECT_EQ(24U, sizeof(OatQuickMethodHeader)); - EXPECT_EQ(80 * GetInstructionSetPointerSize(kRuntimeISA), sizeof(QuickEntryPoints)); + EXPECT_EQ(79 * GetInstructionSetPointerSize(kRuntimeISA), sizeof(QuickEntryPoints)); } TEST_F(OatTest, OatHeaderIsValid) { -- cgit v1.2.3