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
diff --git a/src/compiler/codegen/GenCommon.cc b/src/compiler/codegen/GenCommon.cc
index d3ab039..e2b8282 100644
--- a/src/compiler/codegen/GenCommon.cc
+++ b/src/compiler/codegen/GenCommon.cc
@@ -582,20 +582,18 @@
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 @@
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 @@
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);