diff options
author | buzbee <buzbee@google.com> | 2014-05-27 13:59:04 -0700 |
---|---|---|
committer | buzbee <buzbee@google.com> | 2014-05-27 13:59:04 -0700 |
commit | 055c29fd0f752328981f1b7ccadb1862eecedd40 (patch) | |
tree | 4eda9505576549f94e5810a4a45d8356395cf400 /compiler | |
parent | ab5b370e44629332e73ffd66bfe8b8a924236c5c (diff) | |
download | art-055c29fd0f752328981f1b7ccadb1862eecedd40.tar.gz art-055c29fd0f752328981f1b7ccadb1862eecedd40.tar.bz2 art-055c29fd0f752328981f1b7ccadb1862eecedd40.zip |
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
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/dex/quick/arm/fp_arm.cc | 11 | ||||
-rw-r--r-- | compiler/oat_test.cc | 2 |
2 files changed, 1 insertions, 12 deletions
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) { |