@@ -1280,6 +1280,9 @@ def AMDGPUSystemLibrary : SystemRuntimeLibrary<isAMDGPU, (add)>;
1280
1280
// ARM Runtime Libcalls
1281
1281
//===----------------------------------------------------------------------===//
1282
1282
1283
+ def isTargetAEABIAndAAPCS_ABI : RuntimeLibcallPredicate<
1284
+ [{TT.isTargetAEABI() && isAAPCS_ABI(TT, ABIName)}]>;
1285
+
1283
1286
// if (isTargetMachO()) {
1284
1287
// if (Subtarget->isThumb() && Subtarget->hasVFP2Base() &&
1285
1288
// Subtarget->hasARMOps() && !Subtarget->useSoftFloat()) {
@@ -1473,13 +1476,23 @@ def __udivmodsi4 : RuntimeLibcallImpl<UDIVREM_I32>;
1473
1476
// a __gnu_ prefix (which is the default).
1474
1477
// isTargetAEABI()
1475
1478
def __aeabi_f2h : RuntimeLibcallImpl<FPROUND_F32_F16>; // CallingConv::ARM_AAPCS
1476
- //def __aeabi_d2h : RuntimeLibcallImpl<FPROUND_F64_F16>; // CallingConv::ARM_AAPCS
1477
1479
def __aeabi_h2f : RuntimeLibcallImpl<FPEXT_F16_F32>; // CallingConv::ARM_AAPCS
1478
1480
1479
1481
// !isTargetMachO()
1480
1482
def __gnu_f2h_ieee : RuntimeLibcallImpl<FPROUND_F32_F16>;
1481
1483
def __gnu_h2f_ieee : RuntimeLibcallImpl<FPEXT_F16_F32>;
1482
1484
1485
+ def GNUEABIHalfConvertCalls :
1486
+ LibcallImpls<(add __gnu_f2h_ieee, __gnu_h2f_ieee),
1487
+ RuntimeLibcallPredicate<[{!TT.isOSBinFormatMachO() &&
1488
+ !TT.isTargetAEABI()}]>>;
1489
+
1490
+ // In EABI, these functions have an __aeabi_ prefix, but in GNUEABI
1491
+ // they have a __gnu_ prefix (which is the default).
1492
+ def EABIHalfConvertCalls : LibcallImpls<(add __aeabi_f2h, __aeabi_h2f),
1493
+ isTargetAEABIAndAAPCS_ABI> {
1494
+ let CallingConv = ARM_AAPCS;
1495
+ }
1483
1496
1484
1497
def WindowARMDivRemCalls : LibcallImpls<
1485
1498
(add __rt_sdiv, __rt_sdiv64, __rt_udiv, __rt_udiv64),
@@ -1553,8 +1566,8 @@ def AEABICalls : LibcallImpls<
1553
1566
// RTABI chapter 4.1.2, Table 7
1554
1567
__aeabi_d2f,
1555
1568
__aeabi_f2d,
1556
- __aeabi_h2f,
1557
- __aeabi_f2h,
1569
+ // __aeabi_h2f added separately
1570
+ // __aeabi_f2h added separately
1558
1571
__aeabi_d2h,
1559
1572
1560
1573
// Integer to floating-point conversions.
@@ -1614,6 +1627,8 @@ def ARMSystemLibrary
1614
1627
1615
1628
AEABICalls,
1616
1629
AEABI45MemCalls,
1630
+ EABIHalfConvertCalls,
1631
+ GNUEABIHalfConvertCalls,
1617
1632
1618
1633
// Use divmod compiler-rt calls for iOS 5.0 and later.
1619
1634
LibcallImpls<(add __divmodsi4, __udivmodsi4),
0 commit comments