From b046e16d8b8da318d6055f9308950131f1255e08 Mon Sep 17 00:00:00 2001 From: buzbee Date: Tue, 30 Oct 2012 15:48:42 -0700 Subject: 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 --- src/compiler/codegen/MethodBitcode.cc | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'src/compiler/codegen/MethodBitcode.cc') diff --git a/src/compiler/codegen/MethodBitcode.cc b/src/compiler/codegen/MethodBitcode.cc index 79208833f1..f3ebf09ab1 100644 --- a/src/compiler/codegen/MethodBitcode.cc +++ b/src/compiler/codegen/MethodBitcode.cc @@ -1722,23 +1722,22 @@ void convertExtendedMIR(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir, } 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 @@ bool methodBlockBitcodeConversion(CompilationUnit* cUnit, BasicBlock* bb) 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 @@ void cvtICmpBr(CompilationUnit* cUnit, llvm::Instruction* inst, 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(rhs)) { @@ -2540,7 +2530,6 @@ void cvtICmpBr(CompilationUnit* cUnit, llvm::Instruction* inst, opRegReg(cUnit, kOpCmp, rlSrc1.lowReg, rlSrc2.lowReg); } opCondBranch(cUnit, cond, taken); -#endif // Fallthrough opUnconditionalBranch(cUnit, fallThrough); } -- cgit v1.2.3-59-g8ed1b