diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-08 08:08:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-08 08:08:56 +0000 |
commit | ae0aacb8331e1227abea6601e531a10d0e65fdca (patch) | |
tree | 13580885242f488009f74449b97d5814c6de846c /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 1645ed0b93901ec678cd54024c8b09bca632b296 (diff) |
Add support for FP->INT conversions and back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19369 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 4ad651718f..57a66f448b 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -396,6 +396,8 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, case ISD::SIGN_EXTEND: return getConstant(C->getSignExtended(), VT); case ISD::ZERO_EXTEND: return getConstant(Val, VT); case ISD::TRUNCATE: return getConstant(Val, VT); + case ISD::SINT_TO_FP: return getConstantFP(C->getSignExtended(), VT); + case ISD::UINT_TO_FP: return getConstantFP(C->getValue(), VT); } } @@ -404,6 +406,10 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, case ISD::FP_ROUND: case ISD::FP_EXTEND: return getConstantFP(C->getValue(), VT); + case ISD::FP_TO_SINT: + return getConstant((int64_t)C->getValue(), VT); + case ISD::FP_TO_UINT: + return getConstant((uint64_t)C->getValue(), VT); } unsigned OpOpcode = Operand.Val->getOpcode(); @@ -821,6 +827,11 @@ void SDNode::dump() const { case ISD::FP_ROUND: std::cerr << "fp_round"; break; case ISD::FP_EXTEND: std::cerr << "fp_extend"; break; + case ISD::SINT_TO_FP: std::cerr << "sint_to_fp"; break; + case ISD::UINT_TO_FP: std::cerr << "uint_to_fp"; break; + case ISD::FP_TO_SINT: std::cerr << "fp_to_sint"; break; + case ISD::FP_TO_UINT: std::cerr << "fp_to_uint"; break; + // Control flow instructions case ISD::BR: std::cerr << "br"; break; case ISD::BRCOND: std::cerr << "brcond"; break; |