mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-20 09:24:58 +00:00
- Allow custom lowering for CTPOP, CTTZ, CTLZ.
- Fixed an existing unexpanded tab. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40605 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
81a129c0fb
commit
910b66d8d6
@ -2738,9 +2738,16 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
case ISD::CTLZ:
|
||||
Tmp1 = LegalizeOp(Node->getOperand(0)); // Op
|
||||
switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
|
||||
case TargetLowering::Custom: assert(0 && "Cannot custom handle this yet!");
|
||||
case TargetLowering::Custom:
|
||||
case TargetLowering::Legal:
|
||||
Result = DAG.UpdateNodeOperands(Result, Tmp1);
|
||||
if (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0)) ==
|
||||
TargetLowering::Custom) {
|
||||
Tmp1 = TLI.LowerOperation(Result, DAG);
|
||||
if (Tmp1.Val) {
|
||||
Result = Tmp1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TargetLowering::Promote: {
|
||||
MVT::ValueType OVT = Tmp1.getValueType();
|
||||
@ -2760,7 +2767,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
DAG.getConstant(MVT::getSizeInBits(NVT), NVT),
|
||||
ISD::SETEQ);
|
||||
Result = DAG.getNode(ISD::SELECT, NVT, Tmp2,
|
||||
DAG.getConstant(MVT::getSizeInBits(OVT),NVT), Tmp1);
|
||||
DAG.getConstant(MVT::getSizeInBits(OVT),NVT), Tmp1);
|
||||
break;
|
||||
case ISD::CTLZ:
|
||||
// Tmp1 = Tmp1 - (sizeinbits(NVT) - sizeinbits(Old VT))
|
||||
|
Loading…
Reference in New Issue
Block a user