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
diff --git a/compiler/dex/quick/arm64/fp_arm64.cc b/compiler/dex/quick/arm64/fp_arm64.cc
index 3b88021..97f13e9 100644
--- a/compiler/dex/quick/arm64/fp_arm64.cc
+++ b/compiler/dex/quick/arm64/fp_arm64.cc
@@ -448,6 +448,10 @@
}
bool Arm64Mir2Lir::GenInlinedRound(CallInfo* info, bool is_double) {
+ if ((true)) {
+ // TODO(26327751): Re-enable?
+ return false;
+ }
int32_t encoded_imm = EncodeImmSingle(bit_cast<uint32_t, float>(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 9f6863c..4e7f60d 100644
--- a/compiler/optimizing/intrinsics_arm64.cc
+++ b/compiler/optimizing/intrinsics_arm64.cc
@@ -614,6 +614,10 @@
}
void IntrinsicLocationsBuilderARM64::VisitMathRoundDouble(HInvoke* invoke) {
+ if ((true)) {
+ // TODO(26327751): Re-enable?
+ return;
+ }
CreateFPToIntPlusTempLocations(arena_, invoke);
}
@@ -622,6 +626,10 @@
}
void IntrinsicLocationsBuilderARM64::VisitMathRoundFloat(HInvoke* invoke) {
+ if ((true)) {
+ // TODO(26327751): Re-enable?
+ return;
+ }
CreateFPToIntPlusTempLocations(arena_, invoke);
}