diff options
| author | Duncan Sands <baldrick@free.fr> | 2008-06-08 20:54:56 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2008-06-08 20:54:56 +0000 |
| commit | 8e4eb09b1e3571965f49edcdfb56b1375b1b7551 (patch) | |
| tree | 8acc21a2f0ac1a2bf76323b94970850c00929db5 /lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp | |
| parent | 7d8ab4efbc340638c8f6748f620550df4065bec6 (diff) | |
Remove comparison methods for MVT. The main cause
of apint codegen failure is the DAG combiner doing
the wrong thing because it was comparing MVT's using
< rather than comparing the number of bits. Removing
the < method makes this mistake impossible to commit.
Instead, add helper methods for comparing bits and use
them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52098 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp index 58fcf10388..c3bde9b129 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp @@ -252,12 +252,10 @@ SDOperand DAGTypeLegalizer::FloatToIntRes_XINT_TO_FP(SDNode *N) { if (DestVT == MVT::f64) { // do nothing Result = Sub; - } else if (DestVT.getSizeInBits() < - MVT(MVT::f64).getSizeInBits()) { + } else if (DestVT.bitsLT(MVT::f64)) { Result = DAG.getNode(ISD::FP_ROUND, DestVT, Sub, DAG.getIntPtrConstant(0)); - } else if (DestVT.getSizeInBits() > - MVT(MVT::f64).getSizeInBits()) { + } else if (DestVT.bitsGT(MVT::f64)) { Result = DAG.getNode(ISD::FP_EXTEND, DestVT, Sub); } return BitConvertToInteger(Result); |
