[llvm] r228765 - Fix makeLibCall argument (signed) in SoftenFloatRes_XINT_TO_FP function
Petar Jovanovic
petar.jovanovic at imgtec.com
Tue Feb 10 15:30:14 PST 2015
Author: petarj
Date: Tue Feb 10 17:30:14 2015
New Revision: 228765
URL: http://llvm.org/viewvc/llvm-project?rev=228765&view=rev
Log:
Fix makeLibCall argument (signed) in SoftenFloatRes_XINT_TO_FP function
The isSigned argument of makeLibCall function was hard-coded to false
(unsigned). This caused zero extension on MIPS64 soft float.
As the result SingleSource/Benchmarks/Stanford/FloatMM test and
SingleSource/UnitTests/2005-07-17-INT-To-FP test failed.
The solution was to use the proper argument.
Patch by Strahinja Petrovic.
Differential Revision: http://reviews.llvm.org/D7292
Added:
llvm/trunk/test/CodeGen/Mips/mips64sinttofpsf.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=228765&r1=228764&r2=228765&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Tue Feb 10 17:30:14 2015
@@ -658,7 +658,7 @@ SDValue DAGTypeLegalizer::SoftenFloatRes
NVT, N->getOperand(0));
return TLI.makeLibCall(DAG, LC,
TLI.getTypeToTransformTo(*DAG.getContext(), RVT),
- &Op, 1, false, dl).first;
+ &Op, 1, Signed, dl).first;
}
Added: llvm/trunk/test/CodeGen/Mips/mips64sinttofpsf.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/mips64sinttofpsf.ll?rev=228765&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/mips64sinttofpsf.ll (added)
+++ llvm/trunk/test/CodeGen/Mips/mips64sinttofpsf.ll Tue Feb 10 17:30:14 2015
@@ -0,0 +1,15 @@
+; RUN: llc -march=mips64 -mcpu=mips64r2 -soft-float -O0 < %s | FileCheck %s
+
+
+define double @foo() #0 {
+entry:
+ %x = alloca i32, align 4
+ store volatile i32 -32, i32* %x, align 4
+ %0 = load volatile i32* %x, align 4
+ %conv = sitofp i32 %0 to double
+ ret double %conv
+
+; CHECK-NOT: dsll
+; CHECK-NOT: dsrl
+
+}
More information about the llvm-commits
mailing list