diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-16 05:06:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-16 05:06:12 +0000 |
commit | f8161d83f0201a32a33a0c875eb43df81d8586ab (patch) | |
tree | 7d908c32e2d51ac3bcc89d7fb208e5407591366c /lib/CodeGen | |
parent | 8102fcde4cad92b0ec7ebfda593ed20ded63f0e0 (diff) |
Implement some more missing promotions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index d71eb7e433..754d5a881c 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -248,9 +248,12 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { SDOperand CPIdx = DAG.getConstantPool(CP->getConstantPoolIndex(LLVMC), TLI.getPointerTy()); - Result = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx); - - if (Extend) Result = DAG.getNode(ISD::FP_EXTEND, MVT::f64, Result); + if (Extend) { + Result = DAG.getNode(ISD::EXTLOAD, MVT::f64, DAG.getEntryNode(), CPIdx, + MVT::f32); + } else { + Result = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx); + } } break; } @@ -745,15 +748,23 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { 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: + Result = PromoteOp(Node->getOperand(0)); + Result = DAG.getNode(Node->getOpcode(), Op.getValueType(), Result); + break; case ISD::SINT_TO_FP: + Result = PromoteOp(Node->getOperand(0)); + Result = DAG.getNode(ISD::SIGN_EXTEND_INREG, Result.getValueType(), + Result, Node->getOperand(0).getValueType()); + Result = DAG.getNode(ISD::SINT_TO_FP, Op.getValueType(), Result); + break; case ISD::UINT_TO_FP: - Node->dump(); - assert(0 && "Do not know how to promote this yet!"); + Result = PromoteOp(Node->getOperand(0)); + Result = DAG.getNode(ISD::ZERO_EXTEND_INREG, Result.getValueType(), + Result, Node->getOperand(0).getValueType()); + Result = DAG.getNode(ISD::UINT_TO_FP, Op.getValueType(), Result); + break; } } break; |