llvm.org GIT mirror llvm / 15c94d0
Few targets like PIC16 wants libcall generation for illegal type i16. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62467 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjiv Gupta 11 years ago
3 changed file(s) with 20 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2828 ///
2929 enum Libcall {
3030 // Integer
31 SHL_I16,
3132 SHL_I32,
3233 SHL_I64,
3334 SHL_I128,
35 SRL_I16,
3436 SRL_I32,
3537 SRL_I64,
3638 SRL_I128,
39 SRA_I16,
3740 SRA_I32,
3841 SRA_I64,
3942 SRA_I128,
43 MUL_I16,
4044 MUL_I32,
4145 MUL_I64,
4246 MUL_I128,
15851585
15861586 // If nothing else, we can make a libcall.
15871587 RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
1588 if (VT == MVT::i32)
1588 if (VT == MVT::i16)
1589 LC = RTLIB::MUL_I16;
1590 else if (VT == MVT::i32)
15891591 LC = RTLIB::MUL_I32;
15901592 else if (VT == MVT::i64)
15911593 LC = RTLIB::MUL_I64;
16611663 bool isSigned;
16621664 if (N->getOpcode() == ISD::SHL) {
16631665 isSigned = false; /*sign irrelevant*/
1664 if (VT == MVT::i32)
1666 if (VT == MVT::i16)
1667 LC = RTLIB::SHL_I16;
1668 else if (VT == MVT::i32)
16651669 LC = RTLIB::SHL_I32;
16661670 else if (VT == MVT::i64)
16671671 LC = RTLIB::SHL_I64;
16691673 LC = RTLIB::SHL_I128;
16701674 } else if (N->getOpcode() == ISD::SRL) {
16711675 isSigned = false;
1672 if (VT == MVT::i32)
1676 if (VT == MVT::i16)
1677 LC = RTLIB::SRL_I16;
1678 else if (VT == MVT::i32)
16731679 LC = RTLIB::SRL_I32;
16741680 else if (VT == MVT::i64)
16751681 LC = RTLIB::SRL_I64;
16781684 } else {
16791685 assert(N->getOpcode() == ISD::SRA && "Unknown shift!");
16801686 isSigned = true;
1681 if (VT == MVT::i32)
1687 if (VT == MVT::i16)
1688 LC = RTLIB::SRA_I16;
1689 else if (VT == MVT::i32)
16821690 LC = RTLIB::SRA_I32;
16831691 else if (VT == MVT::i64)
16841692 LC = RTLIB::SRA_I64;
2828 /// InitLibcallNames - Set default libcall names.
2929 ///
3030 static void InitLibcallNames(const char **Names) {
31 Names[RTLIB::SHL_I16] = "__ashli16";
3132 Names[RTLIB::SHL_I32] = "__ashlsi3";
3233 Names[RTLIB::SHL_I64] = "__ashldi3";
3334 Names[RTLIB::SHL_I128] = "__ashlti3";
35 Names[RTLIB::SRL_I16] = "__lshri16";
3436 Names[RTLIB::SRL_I32] = "__lshrsi3";
3537 Names[RTLIB::SRL_I64] = "__lshrdi3";
3638 Names[RTLIB::SRL_I128] = "__lshrti3";
39 Names[RTLIB::SRA_I16] = "__ashri16";
3740 Names[RTLIB::SRA_I32] = "__ashrsi3";
3841 Names[RTLIB::SRA_I64] = "__ashrdi3";
3942 Names[RTLIB::SRA_I128] = "__ashrti3";
43 Names[RTLIB::MUL_I16] = "__muli16";
4044 Names[RTLIB::MUL_I32] = "__mulsi3";
4145 Names[RTLIB::MUL_I64] = "__muldi3";
4246 Names[RTLIB::MUL_I128] = "__multi3";