@@ -587,126 +587,6 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM_,
587587 }
588588 }
589589
590- // RTLIB
591- if (TM.isAAPCS_ABI() && (TT.isTargetAEABI() || TT.isTargetGNUAEABI() ||
592- TT.isTargetMuslAEABI() || TT.isAndroid())) {
593- // FIXME: This does not depend on the subtarget and should go directly into
594- // RuntimeLibcalls. This is only here because of missing support for setting
595- // the calling convention of an implementation.
596- // clang-format off
597- static const struct {
598- const RTLIB::Libcall Op;
599- const RTLIB::LibcallImpl Impl;
600- } LibraryCalls[] = {
601- // Double-precision floating-point arithmetic helper functions
602- // RTABI chapter 4.1.2, Table 2
603- { RTLIB::ADD_F64, RTLIB::__aeabi_dadd },
604- { RTLIB::DIV_F64, RTLIB::__aeabi_ddiv },
605- { RTLIB::MUL_F64, RTLIB::__aeabi_dmul },
606- { RTLIB::SUB_F64, RTLIB::__aeabi_dsub },
607-
608- // Double-precision floating-point comparison helper functions
609- // RTABI chapter 4.1.2, Table 3
610- { RTLIB::OEQ_F64, RTLIB::__aeabi_dcmpeq__oeq },
611- { RTLIB::UNE_F64, RTLIB::__aeabi_dcmpeq__une },
612- { RTLIB::OLT_F64, RTLIB::__aeabi_dcmplt },
613- { RTLIB::OLE_F64, RTLIB::__aeabi_dcmple },
614- { RTLIB::OGE_F64, RTLIB::__aeabi_dcmpge },
615- { RTLIB::OGT_F64, RTLIB::__aeabi_dcmpgt },
616- { RTLIB::UO_F64, RTLIB::__aeabi_dcmpun },
617-
618- // Single-precision floating-point arithmetic helper functions
619- // RTABI chapter 4.1.2, Table 4
620- { RTLIB::ADD_F32, RTLIB::__aeabi_fadd },
621- { RTLIB::DIV_F32, RTLIB::__aeabi_fdiv },
622- { RTLIB::MUL_F32, RTLIB::__aeabi_fmul },
623- { RTLIB::SUB_F32, RTLIB::__aeabi_fsub },
624-
625- // Single-precision floating-point comparison helper functions
626- // RTABI chapter 4.1.2, Table 5
627- { RTLIB::OEQ_F32, RTLIB::__aeabi_fcmpeq__oeq },
628- { RTLIB::UNE_F32, RTLIB::__aeabi_fcmpeq__une },
629- { RTLIB::OLT_F32, RTLIB::__aeabi_fcmplt},
630- { RTLIB::OLE_F32, RTLIB::__aeabi_fcmple },
631- { RTLIB::OGE_F32, RTLIB::__aeabi_fcmpge },
632- { RTLIB::OGT_F32, RTLIB::__aeabi_fcmpgt },
633- { RTLIB::UO_F32, RTLIB::__aeabi_fcmpun },
634-
635- // Floating-point to integer conversions.
636- // RTABI chapter 4.1.2, Table 6
637- { RTLIB::FPTOSINT_F64_I32, RTLIB::__aeabi_d2iz },
638- { RTLIB::FPTOUINT_F64_I32, RTLIB::__aeabi_d2uiz },
639- { RTLIB::FPTOSINT_F64_I64, RTLIB::__aeabi_d2lz },
640- { RTLIB::FPTOUINT_F64_I64, RTLIB::__aeabi_d2ulz },
641- { RTLIB::FPTOSINT_F32_I32, RTLIB::__aeabi_f2iz },
642- { RTLIB::FPTOUINT_F32_I32, RTLIB::__aeabi_f2uiz },
643- { RTLIB::FPTOSINT_F32_I64, RTLIB::__aeabi_f2lz },
644- { RTLIB::FPTOUINT_F32_I64, RTLIB::__aeabi_f2ulz },
645-
646- // Conversions between floating types.
647- // RTABI chapter 4.1.2, Table 7
648- { RTLIB::FPROUND_F64_F32, RTLIB::__aeabi_d2f },
649- { RTLIB::FPROUND_F64_F16, RTLIB::__aeabi_d2h },
650- { RTLIB::FPEXT_F32_F64, RTLIB::__aeabi_f2d },
651-
652- // Integer to floating-point conversions.
653- // RTABI chapter 4.1.2, Table 8
654- { RTLIB::SINTTOFP_I32_F64, RTLIB::__aeabi_i2d },
655- { RTLIB::UINTTOFP_I32_F64, RTLIB::__aeabi_ui2d },
656- { RTLIB::SINTTOFP_I64_F64, RTLIB::__aeabi_l2d },
657- { RTLIB::UINTTOFP_I64_F64, RTLIB::__aeabi_ul2d },
658- { RTLIB::SINTTOFP_I32_F32, RTLIB::__aeabi_i2f },
659- { RTLIB::UINTTOFP_I32_F32, RTLIB::__aeabi_ui2f },
660- { RTLIB::SINTTOFP_I64_F32, RTLIB::__aeabi_l2f },
661- { RTLIB::UINTTOFP_I64_F32, RTLIB::__aeabi_ul2f },
662-
663- // Long long helper functions
664- // RTABI chapter 4.2, Table 9
665- { RTLIB::MUL_I64, RTLIB::__aeabi_lmul },
666- { RTLIB::SHL_I64, RTLIB::__aeabi_llsl },
667- { RTLIB::SRL_I64, RTLIB::__aeabi_llsr },
668- { RTLIB::SRA_I64, RTLIB::__aeabi_lasr },
669-
670- // Integer division functions
671- // RTABI chapter 4.3.1
672- { RTLIB::SDIV_I32, RTLIB::__aeabi_idiv },
673- { RTLIB::SDIV_I64, RTLIB::__aeabi_ldivmod },
674- { RTLIB::UDIV_I32, RTLIB::__aeabi_uidiv },
675- { RTLIB::UDIV_I64, RTLIB::__aeabi_uldivmod },
676- };
677- // clang-format on
678-
679- for (const auto &LC : LibraryCalls)
680- setLibcallImpl(LC.Op, LC.Impl);
681-
682- // EABI dependent RTLIB
683- if (TM.Options.EABIVersion == EABI::EABI4 ||
684- TM.Options.EABIVersion == EABI::EABI5) {
685- static const struct {
686- const RTLIB::Libcall Op;
687- const RTLIB::LibcallImpl Impl;
688- } MemOpsLibraryCalls[] = {
689- // Memory operations
690- // RTABI chapter 4.3.4
691- {RTLIB::MEMCPY, RTLIB::__aeabi_memcpy},
692- {RTLIB::MEMMOVE, RTLIB::__aeabi_memmove},
693- {RTLIB::MEMSET, RTLIB::__aeabi_memset},
694- {RTLIB::AEABI_MEMCPY4, RTLIB::__aeabi_memcpy4},
695- {RTLIB::AEABI_MEMCPY8, RTLIB::__aeabi_memcpy8},
696- {RTLIB::AEABI_MEMMOVE4, RTLIB::__aeabi_memmove4},
697- {RTLIB::AEABI_MEMMOVE8, RTLIB::__aeabi_memmove8},
698- {RTLIB::AEABI_MEMSET4, RTLIB::__aeabi_memset4},
699- {RTLIB::AEABI_MEMSET8, RTLIB::__aeabi_memset8},
700- {RTLIB::AEABI_MEMCLR, RTLIB::__aeabi_memclr},
701- {RTLIB::AEABI_MEMCLR4, RTLIB::__aeabi_memclr4},
702- {RTLIB::AEABI_MEMCLR8, RTLIB::__aeabi_memclr8},
703- };
704-
705- for (const auto &LC : MemOpsLibraryCalls)
706- setLibcallImpl(LC.Op, LC.Impl);
707- }
708- }
709-
710590 // In EABI, these functions have an __aeabi_ prefix, but in GNUEABI they have
711591 // a __gnu_ prefix (which is the default).
712592 if (TT.isTargetAEABI()) {
0 commit comments