mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
Allow targets to custom lower expanded BIT_CONVERT's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30217 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
94be248dbb
commit
f3f333dbd6
@ -4457,8 +4457,21 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ISD::BIT_CONVERT: {
|
case ISD::BIT_CONVERT: {
|
||||||
SDOperand Tmp = ExpandBIT_CONVERT(Node->getValueType(0),
|
SDOperand Tmp;
|
||||||
Node->getOperand(0));
|
if (TLI.getOperationAction(ISD::BIT_CONVERT, VT) == TargetLowering::Custom){
|
||||||
|
// If the target wants to, allow it to lower this itself.
|
||||||
|
switch (getTypeAction(Node->getOperand(0).getValueType())) {
|
||||||
|
case Expand: assert(0 && "cannot expand FP!");
|
||||||
|
case Legal: Tmp = LegalizeOp(Node->getOperand(0)); break;
|
||||||
|
case Promote: Tmp = PromoteOp (Node->getOperand(0)); break;
|
||||||
|
}
|
||||||
|
Tmp = TLI.LowerOperation(DAG.getNode(ISD::BIT_CONVERT, VT, Tmp), DAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Turn this into a load/store pair by default.
|
||||||
|
if (Tmp.Val == 0)
|
||||||
|
Tmp = ExpandBIT_CONVERT(Node->getValueType(0), Node->getOperand(0));
|
||||||
|
|
||||||
ExpandOp(Tmp, Lo, Hi);
|
ExpandOp(Tmp, Lo, Hi);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user