mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
[PowerPC] Handle selection of compare instructions in fast-isel.
Mostly trivial patch adding support for compares. The meat of the work was added with the branch support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189639 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -108,6 +108,7 @@ class PPCFastISel : public FastISel {
|
||||
bool SelectStore(const Instruction *I);
|
||||
bool SelectBranch(const Instruction *I);
|
||||
bool SelectIndirectBr(const Instruction *I);
|
||||
bool SelectCmp(const Instruction *I);
|
||||
bool SelectBinaryIntOp(const Instruction *I, unsigned ISDOpcode);
|
||||
bool SelectRet(const Instruction *I);
|
||||
bool SelectIntExt(const Instruction *I);
|
||||
@ -1065,6 +1066,23 @@ bool PPCFastISel::SelectIndirectBr(const Instruction *I) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Attempt to fast-select a compare instruction.
|
||||
bool PPCFastISel::SelectCmp(const Instruction *I) {
|
||||
const CmpInst *CI = cast<CmpInst>(I);
|
||||
Optional<PPC::Predicate> OptPPCPred = getComparePred(CI->getPredicate());
|
||||
if (!OptPPCPred)
|
||||
return false;
|
||||
|
||||
unsigned CondReg = createResultReg(&PPC::CRRCRegClass);
|
||||
|
||||
if (!PPCEmitCmp(CI->getOperand(0), CI->getOperand(1), CI->isUnsigned(),
|
||||
CondReg))
|
||||
return false;
|
||||
|
||||
UpdateValueMap(I, CondReg);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Attempt to fast-select an integer extend instruction.
|
||||
bool PPCFastISel::SelectIntExt(const Instruction *I) {
|
||||
Type *DestTy = I->getType();
|
||||
|
Reference in New Issue
Block a user