Remove all TARGET_[ARM|X86|MIPS] #ifdefs
Two steps forward, one step back towards elimination of the
"#include" build model for target-specific compilers. This CL
does some restructuring to eliminate all of the TARGET_xxx #ifdefs
and convert them to run-time tests.
Considerable work is still required to fully eliminate the multiple
builds. In particular, much of the "common" codegen code relies on
macros defined by the target-specific [Arm|X86|Mips]Lir.h include file.
Next step is more restructuring to better isolate target-independent
code generation code.
Change-Id: If6efbde65c48031a48423344d8dc3e2ff2c4ad9d
diff --git a/src/compiler/codegen/MethodBitcode.cc b/src/compiler/codegen/MethodBitcode.cc
index 7920883..f3ebf09 100644
--- a/src/compiler/codegen/MethodBitcode.cc
+++ b/src/compiler/codegen/MethodBitcode.cc
@@ -1722,23 +1722,22 @@
}
break;
-#if defined(TARGET_ARM)
+ // TODO: need GBC intrinsic to take advantage of fused operations
case kMirOpFusedCmplFloat:
- UNIMPLEMENTED(WARNING) << "unimp kMirOpFusedCmpFloat";
+ UNIMPLEMENTED(FATAL) << "kMirOpFusedCmpFloat unsupported";
break;
case kMirOpFusedCmpgFloat:
- UNIMPLEMENTED(WARNING) << "unimp kMirOpFusedCmgFloat";
+ UNIMPLEMENTED(FATAL) << "kMirOpFusedCmgFloat unsupported";
break;
case kMirOpFusedCmplDouble:
- UNIMPLEMENTED(WARNING) << "unimp kMirOpFusedCmplDouble";
+ UNIMPLEMENTED(FATAL) << "kMirOpFusedCmplDouble unsupported";
break;
case kMirOpFusedCmpgDouble:
- UNIMPLEMENTED(WARNING) << "unimp kMirOpFusedCmpgDouble";
+ UNIMPLEMENTED(FATAL) << "kMirOpFusedCmpgDouble unsupported";
break;
case kMirOpFusedCmpLong:
- UNIMPLEMENTED(WARNING) << "unimp kMirOpLongCmpBranch";
+ UNIMPLEMENTED(FATAL) << "kMirOpLongCmpBranch unsupported";
break;
-#endif
default:
break;
}
@@ -1863,12 +1862,6 @@
Instruction::Format dalvikFormat =
Instruction::FormatOf(mir->dalvikInsn.opcode);
- /* If we're compiling for the debugger, generate an update callout */
- if (cUnit->genDebugger) {
- UNIMPLEMENTED(FATAL) << "Need debug codegen";
- //genDebuggerUpdate(cUnit, mir->offset);
- }
-
if (opcode == kMirOpCheck) {
// Combine check and work halves of throwing instruction.
MIR* workHalf = mir->meta.throwInsn;
@@ -2521,13 +2514,10 @@
RegLocation rlSrc1 = getLoc(cUnit, inst->getOperand(0));
rlSrc1 = loadValue(cUnit, rlSrc1, kCoreReg);
llvm::Value* rhs = inst->getOperand(1);
-#if defined(TARGET_MIPS)
- // Compare and branch in one shot
- (void)taken;
- (void)cond;
- (void)rhs;
- UNIMPLEMENTED(FATAL);
-#else
+ if (cUnit->instructionSet == kMips) {
+ // Compare and branch in one shot
+ UNIMPLEMENTED(FATAL);
+ }
//Compare, then branch
// TODO: handle fused CMP_LONG/IF_xxZ case
if (llvm::ConstantInt* src2 = llvm::dyn_cast<llvm::ConstantInt>(rhs)) {
@@ -2540,7 +2530,6 @@
opRegReg(cUnit, kOpCmp, rlSrc1.lowReg, rlSrc2.lowReg);
}
opCondBranch(cUnit, cond, taken);
-#endif
// Fallthrough
opUnconditionalBranch(cUnit, fallThrough);
}