Misc codegen fixes related to register promotion
The post-promotion world no longer guarantees that wide result
pairs don't overlap with source operands. Also had to narrow
a load-elimination optimization to apply only when using
temp registers for Dalvik virtual registers.
Change-Id: I2afbbec865d5a14d46e539cce4d8b3d0e4e8880b
diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc
index 0a5fc7e..aeb0134 100644
--- a/src/compiler/codegen/arm/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc
@@ -1817,8 +1817,14 @@
}
if (loc.location == kLocPhysReg) {
if (loc.wide) {
- loadBaseDispWide(cUnit, NULL, rSP, loc.spOffset,
- loc.lowReg, loc.highReg, INVALID_SREG);
+ if (loc.fp && (loc.lowReg & 1) != 0) {
+ // Misaligned - need to load as a pair of singles
+ loadWordDisp(cUnit, rSP, loc.spOffset, loc.lowReg);
+ loadWordDisp(cUnit, rSP, loc.spOffset + 4, loc.highReg);
+ } else {
+ loadBaseDispWide(cUnit, NULL, rSP, loc.spOffset,
+ loc.lowReg, loc.highReg, INVALID_SREG);
+ }
i++;
} else {
loadWordDisp(cUnit, rSP, loc.spOffset, loc.lowReg);