summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-04-01 02:18:22 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-04-01 02:18:22 +0000
commit9845eb5b033db5ba5213d0b8dba958c1e168ccd3 (patch)
tree464c6c5c80e21da3d38c051bcc3d0b451a4aec00
parentdb45d1c649aa2e7c71accd8ad460aa764886cab3 (diff)
downloadllvm-9845eb5b033db5ba5213d0b8dba958c1e168ccd3.tar.gz
llvm-9845eb5b033db5ba5213d0b8dba958c1e168ccd3.tar.bz2
llvm-9845eb5b033db5ba5213d0b8dba958c1e168ccd3.tar.xz
More soft fp fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49016 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp3
-rw-r--r--test/CodeGen/ARM/fpconv.ll4
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 7812187fa4..5cb13e3f44 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -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.
diff --git a/test/CodeGen/ARM/fpconv.ll b/test/CodeGen/ARM/fpconv.ll
index a2771fea47..23850075d0 100644
--- a/test/CodeGen/ARM/fpconv.ll
+++ b/test/CodeGen/ARM/fpconv.ll
@@ -16,8 +16,10 @@
; 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) {