summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/GenCommon.cc
diff options
context:
space:
mode:
author jeffhao <jeffhao@google.com> 2012-04-19 15:27:22 -0700
committer jeffhao <jeffhao@google.com> 2012-04-19 16:01:28 -0700
commit174651dea03956e160a2cff0d842954823c49134 (patch)
treecee1f154612afe918a0640ee8aa33644b604c039 /src/compiler/codegen/GenCommon.cc
parent640529bdc78deaeb8d1f3e95da90f9eb5ce9806d (diff)
Fixed x86 division and modulus and merged their entry points.
Also enabled compilation of fill-array-data instructions in x86 (untested), and improved x86 disassembly. Change-Id: Ia3d8d0766080d01f1c228f9283085024cadd528b
Diffstat (limited to 'src/compiler/codegen/GenCommon.cc')
-rw-r--r--src/compiler/codegen/GenCommon.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/compiler/codegen/GenCommon.cc b/src/compiler/codegen/GenCommon.cc
index d3ab039325..e2b8282675 100644
--- a/src/compiler/codegen/GenCommon.cc
+++ b/src/compiler/codegen/GenCommon.cc
@@ -582,20 +582,18 @@ void genFilledNewArray(CompilationUnit* cUnit, MIR* mir, bool isRange)
int rIdx = oatAllocTemp(cUnit);
#if defined(TARGET_ARM)
int rVal = rLR; // Using a lot of temps, rLR is known free here
+#elif defined(TARGET_X86)
+ int rVal = rSrc;
#else
int rVal = oatAllocTemp(cUnit);
#endif
// Set up source pointer
RegLocation rlFirst = oatGetSrc(cUnit, mir, 0);
-#if defined(TARGET_X86)
- UNIMPLEMENTED(FATAL);
-#else
opRegRegImm(cUnit, kOpAdd, rSrc, rSP,
oatSRegOffset(cUnit, rlFirst.sRegLow));
// Set up the target pointer
opRegRegImm(cUnit, kOpAdd, rDst, rRET0,
Array::DataOffset(component_size).Int32Value());
-#endif
// Set up the loop counter (known to be > 0)
loadConstant(cUnit, rIdx, dInsn->vA - 1);
// Generate the copy loop. Going backwards for convenience
@@ -1782,7 +1780,7 @@ bool genArithOpInt(CompilationUnit* cUnit, MIR* mir, RegLocation rlDest,
checkZero = true;
op = kOpDiv;
callOut = true;
- funcOffset = ENTRYPOINT_OFFSET(pIdiv);
+ funcOffset = ENTRYPOINT_OFFSET(pIdivmod);
retReg = rRET0;
break;
/* NOTE: returns in rARG1 */
@@ -2117,12 +2115,11 @@ bool genArithOpIntLit(CompilationUnit* cUnit, MIR* mir, RegLocation rlDest,
oatFlushAllRegs(cUnit); /* Everything to home location */
loadValueDirectFixed(cUnit, rlSrc, rARG0);
oatClobber(cUnit, rARG0);
+ funcOffset = ENTRYPOINT_OFFSET(pIdivmod);
if ((dalvikOpcode == Instruction::DIV_INT_LIT8) ||
(dalvikOpcode == Instruction::DIV_INT_LIT16)) {
- funcOffset = ENTRYPOINT_OFFSET(pIdiv);
isDiv = true;
} else {
- funcOffset = ENTRYPOINT_OFFSET(pIdivmod);
isDiv = false;
}
callRuntimeHelperRegImm(cUnit, funcOffset, rARG0, lit);