summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/GenCommon.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-03-23 15:14:29 -0700
committer buzbee <buzbee@google.com> 2012-03-26 16:06:01 -0700
commitfc9e6fabed89d948fa8c0e9d673e430076712c60 (patch)
tree12e01ab3a937729d9482ab7fded1f1e0ab73dbd7 /src/compiler/codegen/GenCommon.cc
parent67d920071fe4a0aa8b8bc339e93b18276238c320 (diff)
Compiler intrinsics
Add intrinsic support. Some of these appear to be of limited value, so we may end up removing a few. In general, the instrinsics provide small, but measurable, gains. Only Arm is currently supported, but most of these should work for our other targets as well. This is an interim solution. My plan is to the intrinsic recognition action up into the basic block building phase once we start doing inlining. Change-Id: Ia2913f2cdecaa4e80469caf69dbf8e2f61d4506a
Diffstat (limited to 'src/compiler/codegen/GenCommon.cc')
-rw-r--r--src/compiler/codegen/GenCommon.cc26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/compiler/codegen/GenCommon.cc b/src/compiler/codegen/GenCommon.cc
index 3ca0450e1c..0ef1641858 100644
--- a/src/compiler/codegen/GenCommon.cc
+++ b/src/compiler/codegen/GenCommon.cc
@@ -21,7 +21,8 @@ namespace art {
* be applicable to most targets. Only mid-level support utilities
* and "op" calls may be used here.
*/
-
+void genInvoke(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir,
+ InvokeType type, bool isRange);
#if defined(TARGET_ARM)
LIR* opIT(CompilationUnit* cUnit, ArmConditionCode cond, const char* guide);
#endif
@@ -835,6 +836,7 @@ void handleSuspendLaunchpads(CompilationUnit *cUnit)
int numElems = cUnit->suspendLaunchpads.numUsed;
for (int i = 0; i < numElems; i++) {
oatResetRegPool(cUnit);
+ oatResetDefTracking(cUnit);
LIR* lab = suspendLabel[i];
LIR* resumeLab = (LIR*)lab->operands[0];
cUnit->currentDalvikOffset = lab->operands[1];
@@ -851,12 +853,34 @@ void handleSuspendLaunchpads(CompilationUnit *cUnit)
}
}
+void handleIntrinsicLaunchpads(CompilationUnit *cUnit)
+{
+ LIR** intrinsicLabel = (LIR **)cUnit->intrinsicLaunchpads.elemList;
+ int numElems = cUnit->intrinsicLaunchpads.numUsed;
+ for (int i = 0; i < numElems; i++) {
+ oatResetRegPool(cUnit);
+ oatResetDefTracking(cUnit);
+ LIR* lab = intrinsicLabel[i];
+ MIR* mir = (MIR*)lab->operands[0];
+ InvokeType type = (InvokeType)lab->operands[1];
+ BasicBlock* bb = (BasicBlock*)lab->operands[3];
+ cUnit->currentDalvikOffset = mir->offset;
+ oatAppendLIR(cUnit, lab);
+ genInvoke(cUnit, bb, mir, type, false /* isRange */);
+ LIR* resumeLab = (LIR*)lab->operands[2];
+ if (resumeLab != NULL) {
+ opUnconditionalBranch(cUnit, resumeLab);
+ }
+ }
+}
+
void handleThrowLaunchpads(CompilationUnit *cUnit)
{
LIR** throwLabel = (LIR **)cUnit->throwLaunchpads.elemList;
int numElems = cUnit->throwLaunchpads.numUsed;
for (int i = 0; i < numElems; i++) {
oatResetRegPool(cUnit);
+ oatResetDefTracking(cUnit);
LIR* lab = throwLabel[i];
cUnit->currentDalvikOffset = lab->operands[1];
oatAppendLIR(cUnit, lab);