From 40041c9a38e3961d8675d117517719458a115520 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Sun, 27 Dec 2015 16:20:14 +0000 Subject: [PATCH] Make Math.round consistent on arm64. OpenJDK seems to have a different rounding implementation than libcore. Temporarily disable the intrinsic. Test that fails: Assert.assertEquals(StrictMath.round(0.49999999999999994d), 1l); Assert.assertEquals(Math.round(0.49999999999999994d), 1l); bug:26327751 Change-Id: Iad2fb847e4a553b8c1f5031f772c81e7e4db9f4c --- compiler/dex/quick/arm64/fp_arm64.cc | 4 ++++ compiler/optimizing/intrinsics_arm64.cc | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/compiler/dex/quick/arm64/fp_arm64.cc b/compiler/dex/quick/arm64/fp_arm64.cc index 3b8802136..97f13e9e2 100644 --- a/compiler/dex/quick/arm64/fp_arm64.cc +++ b/compiler/dex/quick/arm64/fp_arm64.cc @@ -448,6 +448,10 @@ bool Arm64Mir2Lir::GenInlinedRint(CallInfo* info) { } bool Arm64Mir2Lir::GenInlinedRound(CallInfo* info, bool is_double) { + if ((true)) { + // TODO(26327751): Re-enable? + return false; + } int32_t encoded_imm = EncodeImmSingle(bit_cast(0.5f)); A64Opcode wide = (is_double) ? WIDE(0) : UNWIDE(0); RegLocation rl_src = info->args[0]; diff --git a/compiler/optimizing/intrinsics_arm64.cc b/compiler/optimizing/intrinsics_arm64.cc index 9f6863cf6..4e7f60dad 100644 --- a/compiler/optimizing/intrinsics_arm64.cc +++ b/compiler/optimizing/intrinsics_arm64.cc @@ -614,6 +614,10 @@ static void GenMathRound(LocationSummary* locations, } void IntrinsicLocationsBuilderARM64::VisitMathRoundDouble(HInvoke* invoke) { + if ((true)) { + // TODO(26327751): Re-enable? + return; + } CreateFPToIntPlusTempLocations(arena_, invoke); } @@ -622,6 +626,10 @@ void IntrinsicCodeGeneratorARM64::VisitMathRoundDouble(HInvoke* invoke) { } void IntrinsicLocationsBuilderARM64::VisitMathRoundFloat(HInvoke* invoke) { + if ((true)) { + // TODO(26327751): Re-enable? + return; + } CreateFPToIntPlusTempLocations(arena_, invoke); } -- 2.11.0