diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/Sparc/SparcISelLowering.cpp | 2 | ||||
| -rw-r--r-- | llvm/test/CodeGen/SPARC/fp128.ll | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/Target/Sparc/SparcISelLowering.cpp b/llvm/lib/Target/Sparc/SparcISelLowering.cpp index cdba998244c..32e02698f3f 100644 --- a/llvm/lib/Target/Sparc/SparcISelLowering.cpp +++ b/llvm/lib/Target/Sparc/SparcISelLowering.cpp @@ -2046,7 +2046,7 @@ static SDValue LowerSINT_TO_FP(SDValue Op, SelectionDAG &DAG, 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); diff --git a/llvm/test/CodeGen/SPARC/fp128.ll b/llvm/test/CodeGen/SPARC/fp128.ll index e3d361335d8..2406af753fa 100644 --- a/llvm/test/CodeGen/SPARC/fp128.ll +++ b/llvm/test/CodeGen/SPARC/fp128.ll @@ -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 +} |

