[llvm] r192015 - [Sparc] Respect hasHardQuad parameter correctly when lowering SINT_TO_FP with fp128 operand.
Venkatraman Govindaraju
venkatra at cs.wisc.edu
Fri Oct 4 17:31:41 PDT 2013
Author: venkatra
Date: Fri Oct 4 19:31:41 2013
New Revision: 192015
URL: http://llvm.org/viewvc/llvm-project?rev=192015&view=rev
Log:
[Sparc] Respect hasHardQuad parameter correctly when lowering SINT_TO_FP with fp128 operand.
Modified:
llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
llvm/trunk/test/CodeGen/SPARC/fp128.ll
Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=192015&r1=192014&r2=192015&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Fri Oct 4 19:31:41 2013
@@ -2046,7 +2046,7 @@ static SDValue LowerSINT_TO_FP(SDValue O
assert(Op.getOperand(0).getValueType() == MVT::i32);
SDValue Tmp = DAG.getNode(ISD::BITCAST, dl, MVT::f32, Op.getOperand(0));
// Convert the int value to FP in an FP register.
- if (Op.getValueType() == MVT::f128 && hasHardQuad)
+ if (Op.getValueType() == MVT::f128 && !hasHardQuad)
return TLI.LowerF128Op(Op, DAG,
TLI.getLibcallName(RTLIB::SINTTOFP_I32_F128), 1);
return DAG.getNode(SPISD::ITOF, dl, Op.getValueType(), Tmp);
Modified: llvm/trunk/test/CodeGen/SPARC/fp128.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/fp128.ll?rev=192015&r1=192014&r2=192015&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/SPARC/fp128.ll (original)
+++ llvm/trunk/test/CodeGen/SPARC/fp128.ll Fri Oct 4 19:31:41 2013
@@ -113,3 +113,16 @@ entry:
}
declare fp128 @llvm.fabs.f128(fp128) nounwind readonly
+
+; HARD-LABEL: int_to_f128
+; HARD: fitoq
+
+; SOFT-LABEL: int_to_f128
+; SOFT: _Q_itoq
+
+define void @int_to_f128(fp128* noalias sret %scalar.result, i32 %i) {
+entry:
+ %0 = sitofp i32 %i to fp128
+ store fp128 %0, fp128* %scalar.result, align 8
+ ret void
+}
More information about the llvm-commits
mailing list