llvm.org GIT mirror llvm / be1ad4d
Add a mysteriously missing libcall, FPTOSINT_F80_I32. Be nice to 16 bit machines by supporting FP_TO_XINT expansion for these. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53407 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan Sands 12 years ago
5 changed file(s) with 35 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
9696 FPTOSINT_F64_I32,
9797 FPTOSINT_F64_I64,
9898 FPTOSINT_F64_I128,
99 FPTOSINT_F80_I32,
99100 FPTOSINT_F80_I64,
100101 FPTOSINT_F80_I128,
101102 FPTOSINT_PPCF128_I32,
37693769 LC = RTLIB::FPTOSINT_F32_I32;
37703770 else if (OVT == MVT::f64)
37713771 LC = RTLIB::FPTOSINT_F64_I32;
3772 else if (OVT == MVT::f80)
3773 LC = RTLIB::FPTOSINT_F80_I32;
3774 else if (OVT == MVT::ppcf128)
3775 LC = RTLIB::FPTOSINT_PPCF128_I32;
37723776 else
37733777 assert(0 && "Unexpected i32-to-fp conversion!");
37743778 } else if (VT == MVT::i64) {
535535 case MVT::f64:
536536 LC = RTLIB::FPTOSINT_F64_I32;
537537 break;
538 case MVT::f80:
539 LC = RTLIB::FPTOSINT_F80_I32;
540 break;
538541 case MVT::ppcf128:
539542 LC = RTLIB::FPTOSINT_PPCF128_I32;
540543 break;
443443 return Tmp;
444444 }
445445
446
446447 //===----------------------------------------------------------------------===//
447448 // Integer Operand Promotion
448449 //===----------------------------------------------------------------------===//
994995 MVT VT = N->getValueType(0);
995996 SDOperand Op = N->getOperand(0);
996997 RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
997 if (VT == MVT::i64) {
998
999 if (VT == MVT::i32) {
1000 if (Op.getValueType() == MVT::f32)
1001 LC = RTLIB::FPTOSINT_F32_I32;
1002 else if (Op.getValueType() == MVT::f64)
1003 LC = RTLIB::FPTOSINT_F64_I32;
1004 else if (Op.getValueType() == MVT::f80)
1005 LC = RTLIB::FPTOSINT_F80_I32;
1006 else if (Op.getValueType() == MVT::ppcf128)
1007 LC = RTLIB::FPTOSINT_PPCF128_I32;
1008 } else if (VT == MVT::i64) {
9981009 if (Op.getValueType() == MVT::f32)
9991010 LC = RTLIB::FPTOSINT_F32_I64;
10001011 else if (Op.getValueType() == MVT::f64)
10121023 LC = RTLIB::FPTOSINT_F80_I128;
10131024 else if (Op.getValueType() == MVT::ppcf128)
10141025 LC = RTLIB::FPTOSINT_PPCF128_I128;
1015 } else {
1016 assert(0 && "Unexpected fp-to-sint conversion!");
1017 }
1026 }
1027 assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unexpected fp-to-sint conversion!");
10181028 SplitInteger(MakeLibCall(LC, VT, &Op, 1, true/*sign irrelevant*/), Lo, Hi);
10191029 }
10201030
10231033 MVT VT = N->getValueType(0);
10241034 SDOperand Op = N->getOperand(0);
10251035 RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
1026 if (VT == MVT::i64) {
1036 if (VT == MVT::i32) {
1037 if (Op.getValueType() == MVT::f32)
1038 LC = RTLIB::FPTOUINT_F32_I32;
1039 else if (Op.getValueType() == MVT::f64)
1040 LC = RTLIB::FPTOUINT_F64_I32;
1041 else if (Op.getValueType() == MVT::f80)
1042 LC = RTLIB::FPTOUINT_F80_I32;
1043 else if (Op.getValueType() == MVT::ppcf128)
1044 LC = RTLIB::FPTOUINT_PPCF128_I32;
1045 } else if (VT == MVT::i64) {
10271046 if (Op.getValueType() == MVT::f32)
10281047 LC = RTLIB::FPTOUINT_F32_I64;
10291048 else if (Op.getValueType() == MVT::f64)
10411060 LC = RTLIB::FPTOUINT_F80_I128;
10421061 else if (Op.getValueType() == MVT::ppcf128)
10431062 LC = RTLIB::FPTOUINT_PPCF128_I128;
1044 } else {
1045 assert(0 && "Unexpected fp-to-uint conversion!");
1046 }
1063 }
1064 assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unexpected fp-to-uint conversion!");
10471065 SplitInteger(MakeLibCall(LC, VT, &Op, 1, false/*sign irrelevant*/), Lo, Hi);
10481066 }
10491067
9494 Names[RTLIB::FPTOSINT_F64_I32] = "__fixdfsi";
9595 Names[RTLIB::FPTOSINT_F64_I64] = "__fixdfdi";
9696 Names[RTLIB::FPTOSINT_F64_I128] = "__fixdfti";
97 Names[RTLIB::FPTOSINT_F80_I32] = "__fixxfsi";
9798 Names[RTLIB::FPTOSINT_F80_I64] = "__fixxfdi";
9899 Names[RTLIB::FPTOSINT_F80_I128] = "__fixxfti";
99100 Names[RTLIB::FPTOSINT_PPCF128_I32] = "__fixtfsi";