diff options
Diffstat (limited to 'src/compiler/codegen')
| -rw-r--r-- | src/compiler/codegen/GenCommon.cc | 12 | ||||
| -rw-r--r-- | src/compiler/codegen/mips/FP/MipsFP.cc | 8 | ||||
| -rw-r--r-- | src/compiler/codegen/mips/MipsLIR.h | 2 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/compiler/codegen/GenCommon.cc b/src/compiler/codegen/GenCommon.cc index c1d46611a5..21f824dfd6 100644 --- a/src/compiler/codegen/GenCommon.cc +++ b/src/compiler/codegen/GenCommon.cc @@ -1321,6 +1321,10 @@ void genInstanceof(CompilationUnit* cUnit, uint32_t type_idx, RegLocation rlDest } } /* rARG0 is ref, rARG2 is class. If ref==null, use directly as bool result */ + RegLocation rlResult = oatGetReturn(cUnit, false); +#if defined(TARGET_MIPS) + opRegCopy(cUnit, rlResult.lowReg, r_ZERO); // store false result for if branch is taken +#endif LIR* branch1 = opCmpImmBranch(cUnit, kCondEq, rARG0, 0, NULL); /* load object->klass_ */ DCHECK_EQ(Object::ClassOffset().Int32Value(), 0); @@ -1339,7 +1343,7 @@ void genInstanceof(CompilationUnit* cUnit, uint32_t type_idx, RegLocation rlDest oatFreeTemp(cUnit, rTgt); #else /* Uses branchovers */ - loadConstant(cUnit, rARG0, 1); // assume true + loadConstant(cUnit, rlResult.lowReg, 1); // assume true LIR* branchover = opCmpBranch(cUnit, kCondEq, rARG1, rARG2, NULL); #if !defined(TARGET_X86) int rTgt = loadHelper(cUnit, @@ -1356,7 +1360,6 @@ void genInstanceof(CompilationUnit* cUnit, uint32_t type_idx, RegLocation rlDest oatClobberCalleeSave(cUnit); /* branch targets here */ LIR* target = newLIR0(cUnit, kPseudoTargetLabel); - RegLocation rlResult = oatGetReturn(cUnit, false); storeValue(cUnit, rlDest, rlResult); branch1->target = target; #if !defined(TARGET_ARM) @@ -1884,9 +1887,10 @@ bool genArithOpInt(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation storeValue(cUnit, rlDest, rlResult); } else { #if defined(TARGET_MIPS) + rlSrc1 = loadValue(cUnit, rlSrc1, kCoreReg); rlSrc2 = loadValue(cUnit, rlSrc2, kCoreReg); if (checkZero) { - genNullCheck(cUnit, rlSrc2.sRegLow, rlSrc2.lowReg, 0); + genImmedCheck(cUnit, kCondEq, rlSrc2.lowReg, 0, kThrowDivZero); } newLIR4(cUnit, kMipsDiv, r_HI, r_LO, rlSrc1.lowReg, rlSrc2.lowReg); rlResult = oatEvalLoc(cUnit, rlDest, kCoreReg, true); @@ -1918,8 +1922,8 @@ bool genArithOpInt(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation rlResult = oatGetReturn(cUnit, false); else rlResult = oatGetReturnAlt(cUnit); - storeValue(cUnit, rlDest, rlResult); #endif + storeValue(cUnit, rlDest, rlResult); } return false; } diff --git a/src/compiler/codegen/mips/FP/MipsFP.cc b/src/compiler/codegen/mips/FP/MipsFP.cc index f121a5434f..437f1ed2d8 100644 --- a/src/compiler/codegen/mips/FP/MipsFP.cc +++ b/src/compiler/codegen/mips/FP/MipsFP.cc @@ -197,11 +197,11 @@ static bool genCmpFP(CompilationUnit *cUnit, Instruction::Code opcode, RegLocati oatFlushAllRegs(cUnit); oatLockCallTemps(cUnit); if (wide) { - loadValueDirectWideFixed(cUnit, rlSrc1, rARG0, rARG1); - loadValueDirectWideFixed(cUnit, rlSrc2, rARG2, rARG3); + loadValueDirectWideFixed(cUnit, rlSrc1, r_FARG0, r_FARG1); + loadValueDirectWideFixed(cUnit, rlSrc2, r_FARG2, r_FARG3); } else { - loadValueDirectFixed(cUnit, rlSrc1, rARG0); - loadValueDirectFixed(cUnit, rlSrc2, rARG1); + loadValueDirectFixed(cUnit, rlSrc1, r_FARG0); + loadValueDirectFixed(cUnit, rlSrc2, r_FARG2); } int rTgt = loadHelper(cUnit, offset); // NOTE: not a safepoint diff --git a/src/compiler/codegen/mips/MipsLIR.h b/src/compiler/codegen/mips/MipsLIR.h index 5e5147a96b..5077c9fa40 100644 --- a/src/compiler/codegen/mips/MipsLIR.h +++ b/src/compiler/codegen/mips/MipsLIR.h @@ -141,6 +141,8 @@ namespace art { /* These are the same for both big and little endian. */ #define r_FARG0 r_F12 #define r_FARG1 r_F13 +#define r_FARG2 r_F14 +#define r_FARG3 r_F15 #define r_FRESULT0 r_F0 #define r_FRESULT1 r_F1 |