diff options
author | Chris Lattner <sabre@nondot.org> | 2008-03-09 07:47:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-03-09 07:47:22 +0000 |
commit | 83b3473dd84107f85de35be5ce03b108bc446ef6 (patch) | |
tree | fc171ed4f955d6e7d6e58b1ce15d4740ce3c21d5 /llvm/lib/CodeGen | |
parent | f3d637fa141de3038b206bda5937e2cd2939362a (diff) | |
download | bcm5719-llvm-83b3473dd84107f85de35be5ce03b108bc446ef6.tar.gz bcm5719-llvm-83b3473dd84107f85de35be5ce03b108bc446ef6.zip |
extend fp values with FP_EXTEND not FP_ROUND.
llvm-svn: 48097
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 1140e20a440..97e12a4a0e9 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -759,9 +759,12 @@ static SDOperand getCopyFromParts(SelectionDAG &DAG, } } - if (MVT::isFloatingPoint(PartVT) && MVT::isFloatingPoint(ValueVT)) - return DAG.getNode(ISD::FP_ROUND, ValueVT, Val, - DAG.getIntPtrConstant(TruncExact)); + if (MVT::isFloatingPoint(PartVT) && MVT::isFloatingPoint(ValueVT)) { + if (ValueVT < Val.getValueType()) + return DAG.getNode(ISD::FP_ROUND, ValueVT, Val, + DAG.getIntPtrConstant(TruncExact)); + return DAG.getNode(ISD::FP_EXTEND, ValueVT, Val); + } if (MVT::getSizeInBits(PartVT) == MVT::getSizeInBits(ValueVT)) return DAG.getNode(ISD::BIT_CONVERT, ValueVT, Val); |