summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/MethodCodegenDriver.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-03-29 16:44:16 -0700
committer buzbee <buzbee@google.com> 2012-03-29 16:44:16 -0700
commit84fd693103dddd50b6a18522bfb5eaab0e51b6ec (patch)
tree47e3e167fe7b42561b1eafeda2c53329fbad4f58 /src/compiler/codegen/MethodCodegenDriver.cc
parent7cea03edf5f9615cb65af864183f0e8b4d13a79e (diff)
Branch fusing
A belated birthday gift for irogers. Fuse cmp-long/if-XXz, cmp[lg]-[float|double]/if-XXz. Change-Id: I8fa87f620fcf4e6bcf291bbc7a0ea6c8f5535467
Diffstat (limited to 'src/compiler/codegen/MethodCodegenDriver.cc')
-rw-r--r--src/compiler/codegen/MethodCodegenDriver.cc35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/compiler/codegen/MethodCodegenDriver.cc b/src/compiler/codegen/MethodCodegenDriver.cc
index d753fcc1c6..1dc11dac70 100644
--- a/src/compiler/codegen/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/MethodCodegenDriver.cc
@@ -741,10 +741,16 @@ const char* extendedMIROpNames[kMirOpLast - kMirOpFirst] = {
"kMirOpNullNRangeDownCheck",
"kMirOpLowerBound",
"kMirOpCopy",
+ "kMirFusedCmplFloat",
+ "kMirFusedCmpgFloat",
+ "kMirFusedCmplDouble",
+ "kMirFusedCmpgDouble",
+ "kMirFusedCmpLong",
+ "kMirNop",
};
/* Extended MIR instructions like PHI */
-void handleExtendedMethodMIR(CompilationUnit* cUnit, MIR* mir)
+void handleExtendedMethodMIR(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir)
{
int opOffset = mir->dalvikInsn.opcode - kMirOpFirst;
char* msg = NULL;
@@ -771,6 +777,23 @@ void handleExtendedMethodMIR(CompilationUnit* cUnit, MIR* mir)
storeValue(cUnit, rlDest, rlSrc);
break;
}
+#if defined(TARGET_ARM)
+ case kMirOpFusedCmplFloat:
+ genFusedFPCmpBranch(cUnit, bb, mir, false /*gt bias*/, false /*double*/);
+ break;
+ case kMirOpFusedCmpgFloat:
+ genFusedFPCmpBranch(cUnit, bb, mir, true /*gt bias*/, false /*double*/);
+ break;
+ case kMirOpFusedCmplDouble:
+ genFusedFPCmpBranch(cUnit, bb, mir, false /*gt bias*/, true /*double*/);
+ break;
+ case kMirOpFusedCmpgDouble:
+ genFusedFPCmpBranch(cUnit, bb, mir, true /*gt bias*/, true /*double*/);
+ break;
+ case kMirOpFusedCmpLong:
+ genFusedLongCmpBranch(cUnit, bb, mir);
+ break;
+#endif
default:
break;
}
@@ -827,11 +850,6 @@ bool methodBlockCodeGen(CompilationUnit* cUnit, BasicBlock* bb)
cUnit->liveSReg = INVALID_SREG;
#endif
- if ((int)mir->dalvikInsn.opcode >= (int)kMirOpFirst) {
- handleExtendedMethodMIR(cUnit, mir);
- continue;
- }
-
cUnit->currentDalvikOffset = mir->offset;
Instruction::Code dalvikOpcode = mir->dalvikInsn.opcode;
@@ -864,6 +882,11 @@ bool methodBlockCodeGen(CompilationUnit* cUnit, BasicBlock* bb)
newLIR1(cUnit, kPseudoSSARep, (int) ssaString);
}
+ if ((int)mir->dalvikInsn.opcode >= (int)kMirOpFirst) {
+ handleExtendedMethodMIR(cUnit, bb, mir);
+ continue;
+ }
+
bool notHandled = compileDalvikInstruction(cUnit, mir, bb, labelList);
if (notHandled) {
LOG(FATAL) << StringPrintf("%#06x: Opcode %#x (%s) / Fmt %d not handled",