mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-16 11:30:51 +00:00
Fix types in PromoteNode handling of CTPOP and friends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75418 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ee787ff01a
commit
9a4ba45f4c
@ -2983,10 +2983,10 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node,
|
||||
// Zero extend the argument.
|
||||
Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, dl, NVT, Node->getOperand(0));
|
||||
// Perform the larger operation.
|
||||
Tmp1 = DAG.getNode(Node->getOpcode(), dl, Node->getValueType(0), Tmp1);
|
||||
Tmp1 = DAG.getNode(Node->getOpcode(), dl, NVT, Tmp1);
|
||||
if (Node->getOpcode() == ISD::CTTZ) {
|
||||
//if Tmp1 == sizeinbits(NVT) then Tmp1 = sizeinbits(Old VT)
|
||||
Tmp2 = DAG.getSetCC(dl, TLI.getSetCCResultType(Tmp1.getValueType()),
|
||||
Tmp2 = DAG.getSetCC(dl, TLI.getSetCCResultType(NVT),
|
||||
Tmp1, DAG.getConstant(NVT.getSizeInBits(), NVT),
|
||||
ISD::SETEQ);
|
||||
Tmp1 = DAG.getNode(ISD::SELECT, dl, NVT, Tmp2,
|
||||
@ -2997,7 +2997,7 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node,
|
||||
DAG.getConstant(NVT.getSizeInBits() -
|
||||
OVT.getSizeInBits(), NVT));
|
||||
}
|
||||
Results.push_back(Tmp1);
|
||||
Results.push_back(DAG.getNode(ISD::TRUNCATE, dl, OVT, Tmp1));
|
||||
break;
|
||||
case ISD::BSWAP: {
|
||||
unsigned DiffBits = NVT.getSizeInBits() - OVT.getSizeInBits();
|
||||
|
Loading…
Reference in New Issue
Block a user