@@ -1494,6 +1494,28 @@ def EABIHalfConvertCalls : LibcallImpls<(add __aeabi_f2h, __aeabi_h2f),
14941494 let CallingConv = ARM_AAPCS;
14951495}
14961496
1497+ // The half <-> float conversion functions are always soft-float on
1498+ // non-watchos platforms, but are needed for some targets which use a
1499+ // hard-float calling convention by default.
1500+ def ARMHalfConvertLibcallCallingConv : LibcallCallingConv<
1501+ [{TT.isWatchABI() ? DefaultCC :
1502+ (isAAPCS_ABI(TT, ABIName) ? CallingConv::ARM_AAPCS : CallingConv::ARM_APCS)}]
1503+ >;
1504+
1505+ def GNUEABIHalfConvertCalls :
1506+ LibcallImpls<(add __gnu_f2h_ieee, __gnu_h2f_ieee),
1507+ RuntimeLibcallPredicate<[{!TT.isOSBinFormatMachO() &&
1508+ !TT.isTargetAEABI()}]>> {
1509+ let CallingConv = ARMHalfConvertLibcallCallingConv;
1510+ }
1511+
1512+ // In EABI, these functions have an __aeabi_ prefix, but in GNUEABI
1513+ // they have a __gnu_ prefix (which is the default).
1514+ def EABIHalfConvertCalls : LibcallImpls<(add __aeabi_f2h, __aeabi_h2f),
1515+ isTargetAEABIAndAAPCS_ABI> {
1516+ let CallingConv = ARM_AAPCS;
1517+ }
1518+
14971519def WindowARMDivRemCalls : LibcallImpls<
14981520 (add __rt_sdiv, __rt_sdiv64, __rt_udiv, __rt_udiv64),
14991521 isOSWindows> {
0 commit comments