legalize a bunch of operations that I missed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19580 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-01-16 00:38:00 +00:00
parent fb849800ea
commit 1713e73b8a

View File

@ -751,7 +751,6 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
case ISD::FP_TO_UINT: case ISD::FP_TO_UINT:
case ISD::SINT_TO_FP: case ISD::SINT_TO_FP:
case ISD::UINT_TO_FP: case ISD::UINT_TO_FP:
switch (getTypeAction(Node->getOperand(0).getValueType())) { switch (getTypeAction(Node->getOperand(0).getValueType())) {
case Legal: case Legal:
Tmp1 = LegalizeOp(Node->getOperand(0)); Tmp1 = LegalizeOp(Node->getOperand(0));
@ -776,19 +775,30 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
case Promote: case Promote:
switch (Node->getOpcode()) { switch (Node->getOpcode()) {
case ISD::ZERO_EXTEND: { case ISD::ZERO_EXTEND:
// Mask out the high bits. Result = PromoteOp(Node->getOperand(0));
uint64_t MaskCst = Result = DAG.getNode(ISD::ZERO_EXTEND_INREG, Result.getValueType(),
1ULL << (MVT::getSizeInBits(Node->getOperand(0).getValueType()))-1; Result, Node->getOperand(0).getValueType());
Tmp1 = PromoteOp(Node->getOperand(0));
Result = DAG.getNode(ISD::AND, Node->getValueType(0), Tmp1,
DAG.getConstant(MaskCst, Node->getValueType(0)));
break; break;
}
case ISD::SIGN_EXTEND: case ISD::SIGN_EXTEND:
Result = PromoteOp(Node->getOperand(0));
Result = DAG.getNode(ISD::SIGN_EXTEND_INREG, Result.getValueType(),
Result, Node->getOperand(0).getValueType());
break;
case ISD::TRUNCATE: case ISD::TRUNCATE:
Result = PromoteOp(Node->getOperand(0));
Result = DAG.getNode(ISD::TRUNCATE, Op.getValueType(), Result);
break;
case ISD::FP_EXTEND: case ISD::FP_EXTEND:
Result = PromoteOp(Node->getOperand(0));
if (Result.getValueType() != Op.getValueType())
// Dynamically dead while we have only 2 FP types.
Result = DAG.getNode(ISD::FP_EXTEND, Op.getValueType(), Result);
break;
case ISD::FP_ROUND: case ISD::FP_ROUND:
Result = PromoteOp(Node->getOperand(0));
Result = DAG.getNode(ISD::FP_ROUND, Op.getValueType(), Result);
break;
case ISD::FP_TO_SINT: case ISD::FP_TO_SINT:
case ISD::FP_TO_UINT: case ISD::FP_TO_UINT:
case ISD::SINT_TO_FP: case ISD::SINT_TO_FP: