diff options
Diffstat (limited to 'src/compiler/codegen/arm')
| -rw-r--r-- | src/compiler/codegen/arm/ArchUtility.cc | 3 | ||||
| -rw-r--r-- | src/compiler/codegen/arm/ArmLIR.h | 2 | ||||
| -rw-r--r-- | src/compiler/codegen/arm/ArmRallocUtil.cc | 2 | ||||
| -rw-r--r-- | src/compiler/codegen/arm/MethodCodegenDriver.cc | 15 | ||||
| -rw-r--r-- | src/compiler/codegen/arm/Thumb2/Factory.cc | 6 |
5 files changed, 19 insertions, 9 deletions
diff --git a/src/compiler/codegen/arm/ArchUtility.cc b/src/compiler/codegen/arm/ArchUtility.cc index 3ceffae849..edce1148ce 100644 --- a/src/compiler/codegen/arm/ArchUtility.cc +++ b/src/compiler/codegen/arm/ArchUtility.cc @@ -404,7 +404,8 @@ void oatCodegenDump(CompilationUnit* cUnit) LOG(INFO) << "Regs (excluding ins) : " << cUnit->numRegs; LOG(INFO) << "Ins : " << cUnit->numIns; LOG(INFO) << "Outs : " << cUnit->numOuts; - LOG(INFO) << "Spills : " << cUnit->numSpills; + LOG(INFO) << "CoreSpills : " << cUnit->numCoreSpills; + LOG(INFO) << "FPSpills : " << cUnit->numFPSpills; LOG(INFO) << "Padding : " << cUnit->numPadding; LOG(INFO) << "Frame size : " << cUnit->frameSize; LOG(INFO) << "Start of ins : " << cUnit->insOffset; diff --git a/src/compiler/codegen/arm/ArmLIR.h b/src/compiler/codegen/arm/ArmLIR.h index 3b2e986acb..99b22e7741 100644 --- a/src/compiler/codegen/arm/ArmLIR.h +++ b/src/compiler/codegen/arm/ArmLIR.h @@ -99,6 +99,8 @@ #define FP_REG_OFFSET 32 /* Offset to distinguish DP FP regs */ #define FP_DOUBLE 64 +/* First FP callee save */ +#define FP_CALLEE_SAVE_BASE 16 /* Reg types */ #define REGTYPE(x) (x & (FP_REG_OFFSET | FP_DOUBLE)) #define FPREG(x) ((x & FP_REG_OFFSET) == FP_REG_OFFSET) diff --git a/src/compiler/codegen/arm/ArmRallocUtil.cc b/src/compiler/codegen/arm/ArmRallocUtil.cc index 84c3792382..9a7c642aee 100644 --- a/src/compiler/codegen/arm/ArmRallocUtil.cc +++ b/src/compiler/codegen/arm/ArmRallocUtil.cc @@ -136,7 +136,7 @@ extern void oatDoPromotion(CompilationUnit* cUnit) * machinery is in place, always spill lr. */ cUnit->coreSpillMask |= (1 << rLR); - cUnit->numSpills++; + cUnit->numCoreSpills++; /* * Simple hack for testing register allocation. Just do a static * count of the uses of Dalvik registers. Note that we examine diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc index 80118d81fb..a4e211b711 100644 --- a/src/compiler/codegen/arm/MethodCodegenDriver.cc +++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc @@ -1853,6 +1853,7 @@ STATIC bool methodBlockCodeGen(CompilationUnit* cUnit, BasicBlock* bb) ArmLIR* headLIR = NULL; + int spillCount = cUnit->numCoreSpills + cUnit->numFPSpills; if (bb->blockType == kEntryBlock) { /* * On entry, r0, r1, r2 & r3 are live. Let the register allocation @@ -1882,17 +1883,22 @@ STATIC bool methodBlockCodeGen(CompilationUnit* cUnit, BasicBlock* bb) newLIR1(cUnit, kThumb2Push, cUnit->coreSpillMask); /* Need to spill any FP regs? */ if (cUnit->numFPSpills) { + /* + * NOTE: fp spills are a little different from core spills in that + * they are pushed as a contiguous block. When promoting from + * the fp set, we must allocate all singles from s16..highest-promoted + */ newLIR1(cUnit, kThumb2VPushCS, cUnit->numFPSpills); } if (!skipOverflowCheck) { opRegRegImm(cUnit, kOpSub, rLR, rSP, - cUnit->frameSize - (cUnit->numSpills * 4)); + cUnit->frameSize - (spillCount * 4)); genRegRegCheck(cUnit, kArmCondCc, rLR, r12, NULL, kArmThrowStackOverflow); genRegCopy(cUnit, rSP, rLR); // Establish stack } else { opRegImm(cUnit, kOpSub, rSP, - cUnit->frameSize - (cUnit->numSpills * 4)); + cUnit->frameSize - (spillCount * 4)); } storeBaseDisp(cUnit, rSP, 0, r0, kWord); flushIns(cUnit); @@ -1902,7 +1908,7 @@ STATIC bool methodBlockCodeGen(CompilationUnit* cUnit, BasicBlock* bb) oatFreeTemp(cUnit, r3); } else if (bb->blockType == kExitBlock) { newLIR0(cUnit, kArmPseudoMethodExit); - opRegImm(cUnit, kOpAdd, rSP, cUnit->frameSize - (cUnit->numSpills * 4)); + opRegImm(cUnit, kOpAdd, rSP, cUnit->frameSize - (spillCount * 4)); /* Need to restore any FP callee saves? */ if (cUnit->numFPSpills) { newLIR1(cUnit, kThumb2VPopCS, cUnit->numFPSpills); @@ -2121,7 +2127,8 @@ STATIC void handleThrowLaunchpads(CompilationUnit *cUnit) funcOffset = OFFSETOF_MEMBER(Thread, pThrowStackOverflowFromCode); // Restore stack alignment - opRegImm(cUnit, kOpAdd, rSP, cUnit->numSpills * 4); + opRegImm(cUnit, kOpAdd, rSP, + (cUnit->numCoreSpills + cUnit->numFPSpills) * 4); break; default: LOG(FATAL) << "Unexpected throw kind: " << lab->operands[0]; diff --git a/src/compiler/codegen/arm/Thumb2/Factory.cc b/src/compiler/codegen/arm/Thumb2/Factory.cc index 3ee23eaf1f..45c7377988 100644 --- a/src/compiler/codegen/arm/Thumb2/Factory.cc +++ b/src/compiler/codegen/arm/Thumb2/Factory.cc @@ -75,7 +75,7 @@ STATIC ArmLIR* loadFPConstantValue(CompilationUnit* cUnit, int rDest, loadPcRel->operands[1] = r15pc; setupResourceMasks(loadPcRel); setMemRefType(loadPcRel, true, kLiteral); - loadPcRel->aliasInfo = dataTarget->operands[0]; + loadPcRel->aliasInfo = (intptr_t)dataTarget; oatAppendLIR(cUnit, (LIR* ) loadPcRel); return loadPcRel; } @@ -183,7 +183,7 @@ STATIC ArmLIR* loadConstantNoClobber(CompilationUnit* cUnit, int rDest, loadPcRel->operands[0] = rDest; setupResourceMasks(loadPcRel); setMemRefType(loadPcRel, true, kLiteral); - loadPcRel->aliasInfo = dataTarget->operands[0]; + loadPcRel->aliasInfo = (intptr_t)dataTarget; res = loadPcRel; oatAppendLIR(cUnit, (LIR* ) loadPcRel); @@ -661,7 +661,7 @@ STATIC ArmLIR* loadConstantValueWide(CompilationUnit* cUnit, int rDestLo, loadPcRel->operands[1] = r15pc; setupResourceMasks(loadPcRel); setMemRefType(loadPcRel, true, kLiteral); - loadPcRel->aliasInfo = dataTarget->operands[0]; + loadPcRel->aliasInfo = (intptr_t)dataTarget; oatAppendLIR(cUnit, (LIR* ) loadPcRel); res = loadPcRel; } |