diff options
Diffstat (limited to 'src/compiler/codegen/arm')
| -rw-r--r-- | src/compiler/codegen/arm/Assemble.cc | 4 | ||||
| -rw-r--r-- | src/compiler/codegen/arm/Thumb2/Gen.cc | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/compiler/codegen/arm/Assemble.cc b/src/compiler/codegen/arm/Assemble.cc index 9a5bd40674..19b9445511 100644 --- a/src/compiler/codegen/arm/Assemble.cc +++ b/src/compiler/codegen/arm/Assemble.cc @@ -967,8 +967,8 @@ ArmEncodingMap EncodingMap[kArmLast] = { #define PADDING_MOV_R5_R5 0x1C2D static void pushWord(std::vector<short>&buf, int data) { - buf.push_back( (data >> 16) & 0xffff); buf.push_back( data & 0xffff); + buf.push_back( (data >> 16) & 0xffff); } void alignBuffer(std::vector<short>&buf, size_t offset) { @@ -999,7 +999,7 @@ static void installSwitchTables(CompilationUnit* cUnit) alignBuffer(cUnit->codeBuffer, tabRec->offset); int bxOffset = tabRec->bxInst->generic.offset + 4; if (cUnit->printMe) { - LOG(INFO) << "Switch table for offset 0x" /*<< hex*/ << bxOffset; + LOG(INFO) << "Switch table for offset 0x" << std::hex << bxOffset; } if (tabRec->table[0] == kSparseSwitchSignature) { int* keys = (int*)&(tabRec->table[2]); diff --git a/src/compiler/codegen/arm/Thumb2/Gen.cc b/src/compiler/codegen/arm/Thumb2/Gen.cc index 4a2bdb3521..934a303336 100644 --- a/src/compiler/codegen/arm/Thumb2/Gen.cc +++ b/src/compiler/codegen/arm/Thumb2/Gen.cc @@ -710,7 +710,17 @@ static void genLong3Addr(CompilationUnit* cUnit, MIR* mir, OpKind firstOp, OpKind secondOp, RegLocation rlDest, RegLocation rlSrc1, RegLocation rlSrc2) { + /* + * NOTE: This is the one place in the code in which we might have + * as many as six live temporary registers. There are 5 in the normal + * set for Arm. Until we have spill capabilities, temporarily add + * lr to the temp set. It is safe to do this locally, but note that + * lr is used explicitly elsewhere in the code generator and cannot + * normally be used as a general temp register. + */ RegLocation rlResult; + oatMarkTemp(cUnit, rLR); // Add lr to the temp pool + oatFreeTemp(cUnit, rLR); // and make it available rlSrc1 = loadValueWide(cUnit, rlSrc1, kCoreReg); rlSrc2 = loadValueWide(cUnit, rlSrc2, kCoreReg); rlResult = oatEvalLoc(cUnit, rlDest, kCoreReg, true); @@ -718,6 +728,8 @@ static void genLong3Addr(CompilationUnit* cUnit, MIR* mir, OpKind firstOp, opRegRegReg(cUnit, secondOp, rlResult.highReg, rlSrc1.highReg, rlSrc2.highReg); storeValueWide(cUnit, rlDest, rlResult); + oatClobber(cUnit, rLR); + oatUnmarkTemp(cUnit, rLR); // Remove lr from the temp pool } void oatInitializeRegAlloc(CompilationUnit* cUnit) |