More soft fp fixes.
authorEvan Cheng <evan.cheng@apple.com>
Tue, 1 Apr 2008 02:18:22 +0000 (02:18 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 1 Apr 2008 02:18:22 +0000 (02:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49016 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
test/CodeGen/ARM/fpconv.ll

index 7812187fa43406e5eb50bc82750f410d8fe1b75c..5cb13e3f44c7e83dc27e6a67c71ad2eb86d0344a 100644 (file)
@@ -5369,7 +5369,8 @@ ExpandIntToFP(bool isSigned, MVT::ValueType DestTy, SDOperand Source) {
   MVT::ValueType SourceVT = Source.getValueType();
   bool ExpandSource = getTypeAction(SourceVT) == Expand;
 
-  if (!isSigned) {
+  // Special case for i32 source to take advantage of UINTTOFP_I32_F32, etc.
+  if (!isSigned && SourceVT != MVT::i32) {
     // The integer value loaded will be incorrectly if the 'sign bit' of the
     // incoming integer is set.  To handle this, we dynamically test to see if
     // it is set, and, if so, add a fudge factor.
index a2771fea4725ca3cf7b6cbb321d75d62947be571..23850075d0dc94987c1d4d1862b759d17bfcd1f8 100644 (file)
 ; RUN: grep fixunssfsi %t
 ; RUN: grep fixdfsi %t
 ; RUN: grep fixunsdfsi %t
-; RUN: grep floatdisf %t
+; RUN: grep floatsisf %t
 ; RUN: grep floatsidf %t
+; RUN: grep floatunsisf %t
+; RUN: grep floatunsidf %t
 ; RUN: llvm-as < %s | llc -march=thumb
 
 define float @f1(double %x) {