llvm.org GIT mirror llvm / 9bed0f5
Add two missing SINT_TO_FP libcalls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53460 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan Sands 12 years ago
3 changed file(s) with 24 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
124124 FPTOUINT_PPCF128_I128,
125125 SINTTOFP_I32_F32,
126126 SINTTOFP_I32_F64,
127 SINTTOFP_I32_F80,
128 SINTTOFP_I32_PPCF128,
127129 SINTTOFP_I64_F32,
128130 SINTTOFP_I64_F64,
129131 SINTTOFP_I64_F80,
17701770 }
17711771
17721772 SDOperand DAGTypeLegalizer::ExpandIntOp_SINT_TO_FP(SDOperand Source,
1773 MVT DestTy) {
1773 MVT DestTy) {
17741774 // We know the destination is legal, but that the input needs to be expanded.
17751775 MVT SourceVT = Source.getValueType();
17761776
17771777 // Check to see if the target has a custom way to lower this. If so, use it.
1778 // This can trigger when called from ExpandIntOp_UINT_TO_FP.
17781779 switch (TLI.getOperationAction(ISD::SINT_TO_FP, SourceVT)) {
17791780 default: assert(0 && "This action not implemented for this operation!");
17801781 case TargetLowering::Legal:
17881789 }
17891790
17901791 RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
1791 if (SourceVT == MVT::i64) {
1792 if (SourceVT == MVT::i32) {
1793 if (DestTy == MVT::f32)
1794 LC = RTLIB::SINTTOFP_I32_F32;
1795 else if (DestTy == MVT::f64)
1796 LC = RTLIB::SINTTOFP_I32_F64;
1797 else if (DestTy == MVT::f80)
1798 LC = RTLIB::SINTTOFP_I32_F80;
1799 else if (DestTy == MVT::ppcf128)
1800 LC = RTLIB::SINTTOFP_I32_PPCF128;
1801 } else if (SourceVT == MVT::i64) {
17921802 if (DestTy == MVT::f32)
17931803 LC = RTLIB::SINTTOFP_I64_F32;
1794 else {
1795 assert(DestTy == MVT::f64 && "Unknown fp value type!");
1804 else if (DestTy == MVT::f64)
17961805 LC = RTLIB::SINTTOFP_I64_F64;
1797 }
1806 else if (DestTy == MVT::f80)
1807 LC = RTLIB::SINTTOFP_I64_F80;
1808 else if (DestTy == MVT::ppcf128)
1809 LC = RTLIB::SINTTOFP_I64_PPCF128;
17981810 } else if (SourceVT == MVT::i128) {
17991811 if (DestTy == MVT::f32)
18001812 LC = RTLIB::SINTTOFP_I128_F32;
18021814 LC = RTLIB::SINTTOFP_I128_F64;
18031815 else if (DestTy == MVT::f80)
18041816 LC = RTLIB::SINTTOFP_I128_F80;
1805 else {
1806 assert(DestTy == MVT::ppcf128 && "Unknown fp value type!");
1817 else if (DestTy == MVT::ppcf128)
18071818 LC = RTLIB::SINTTOFP_I128_PPCF128;
1808 }
1809 } else {
1810 assert(0 && "Unknown int value type!");
1811 }
1812
1819 }
18131820 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
18141821 "Don't know how to expand this SINT_TO_FP!");
1822
18151823 return MakeLibCall(LC, DestTy, &Source, 1, true);
18161824 }
18171825
122122 Names[RTLIB::FPTOUINT_PPCF128_I128] = "__fixunstfti";
123123 Names[RTLIB::SINTTOFP_I32_F32] = "__floatsisf";
124124 Names[RTLIB::SINTTOFP_I32_F64] = "__floatsidf";
125 Names[RTLIB::SINTTOFP_I32_F80] = "__floatsixf";
126 Names[RTLIB::SINTTOFP_I32_PPCF128] = "__floatsitf";
125127 Names[RTLIB::SINTTOFP_I64_F32] = "__floatdisf";
126128 Names[RTLIB::SINTTOFP_I64_F64] = "__floatdidf";
127129 Names[RTLIB::SINTTOFP_I64_F80] = "__floatdixf";