diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-16 00:38:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-16 00:38:00 +0000 |
commit | 71d7f6e86f421db90a82f26136e83334bb6a70a7 (patch) | |
tree | 2db3ff50e2ad6b04c281a7defd1bf366ddae302d /llvm | |
parent | a8d34fb8c6819ae9c547ae7958064756add45190 (diff) | |
download | bcm5719-llvm-71d7f6e86f421db90a82f26136e83334bb6a70a7.tar.gz bcm5719-llvm-71d7f6e86f421db90a82f26136e83334bb6a70a7.zip |
legalize a bunch of operations that I missed.
llvm-svn: 19580
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 34d814620d3..bcbaae825ab 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -751,7 +751,6 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { case ISD::FP_TO_UINT: case ISD::SINT_TO_FP: case ISD::UINT_TO_FP: - switch (getTypeAction(Node->getOperand(0).getValueType())) { case Legal: Tmp1 = LegalizeOp(Node->getOperand(0)); @@ -776,19 +775,30 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { case Promote: switch (Node->getOpcode()) { - case ISD::ZERO_EXTEND: { - // Mask out the high bits. - uint64_t MaskCst = - 1ULL << (MVT::getSizeInBits(Node->getOperand(0).getValueType()))-1; - Tmp1 = PromoteOp(Node->getOperand(0)); - Result = DAG.getNode(ISD::AND, Node->getValueType(0), Tmp1, - DAG.getConstant(MaskCst, Node->getValueType(0))); + case ISD::ZERO_EXTEND: + Result = PromoteOp(Node->getOperand(0)); + Result = DAG.getNode(ISD::ZERO_EXTEND_INREG, Result.getValueType(), + Result, Node->getOperand(0).getValueType()); break; - } 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: + Result = PromoteOp(Node->getOperand(0)); + Result = DAG.getNode(ISD::TRUNCATE, Op.getValueType(), Result); + break; 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: + Result = PromoteOp(Node->getOperand(0)); + Result = DAG.getNode(ISD::FP_ROUND, Op.getValueType(), Result); + break; case ISD::FP_TO_SINT: case ISD::FP_TO_UINT: case ISD::SINT_TO_FP: |