mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-17 03:24:34 +00:00
Add support for fast isel of zext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55396 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -330,6 +330,35 @@ FastISel::SelectInstructions(BasicBlock::iterator Begin,
|
|||||||
// or attempt constant folding.
|
// or attempt constant folding.
|
||||||
return I;
|
return I;
|
||||||
|
|
||||||
|
case Instruction::ZExt:
|
||||||
|
if (!isa<ConstantInt>(I->getOperand(0))) {
|
||||||
|
MVT SrcVT = MVT::getMVT(I->getOperand(0)->getType());
|
||||||
|
MVT DstVT = MVT::getMVT(I->getType());
|
||||||
|
|
||||||
|
if (SrcVT == MVT::Other || !SrcVT.isSimple() ||
|
||||||
|
DstVT == MVT::Other || !DstVT.isSimple() ||
|
||||||
|
!TLI.isTypeLegal(SrcVT) || !TLI.isTypeLegal(DstVT))
|
||||||
|
// Unhandled type. Halt "fast" selection and bail.
|
||||||
|
return I;
|
||||||
|
|
||||||
|
unsigned InputReg = ValueMap[I->getOperand(0)];
|
||||||
|
if (!InputReg)
|
||||||
|
// Unhandled operand. Halt "fast" selection and bail.
|
||||||
|
return I;
|
||||||
|
|
||||||
|
unsigned ResultReg = FastEmit_r(SrcVT.getSimpleVT(),
|
||||||
|
DstVT.getSimpleVT(),
|
||||||
|
ISD::ZERO_EXTEND,
|
||||||
|
InputReg);
|
||||||
|
if (!ResultReg)
|
||||||
|
return I;
|
||||||
|
|
||||||
|
ValueMap[I] = ResultReg;
|
||||||
|
break;
|
||||||
|
} else
|
||||||
|
// TODO: Support constant operands
|
||||||
|
return I;
|
||||||
|
|
||||||
case Instruction::SIToFP:
|
case Instruction::SIToFP:
|
||||||
if (!isa<ConstantInt>(I->getOperand(0))) {
|
if (!isa<ConstantInt>(I->getOperand(0))) {
|
||||||
MVT SrcVT = MVT::getMVT(I->getOperand(0)->getType());
|
MVT SrcVT = MVT::getMVT(I->getOperand(0)->getType());
|
||||||
|
Reference in New Issue
Block a user