Skip to content

Commit 1b7e547

Browse files
committed
AArch64/Darwin work
1 parent cb46afc commit 1b7e547

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

llvm/include/llvm/IR/RuntimeLibcalls.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ struct RuntimeLibcallsInfo {
149149
static const RTLIB::Libcall ImplToLibcall[RTLIB::NumLibcallImpls];
150150

151151
static bool darwinHasSinCosStret(const Triple &TT) {
152-
assert(TT.isOSDarwin() && "should be called with darwin triple");
152+
if (!TT.isOSDarwin())
153+
return false;
154+
153155
// Don't bother with 32 bit x86.
154156
if (TT.getArch() == Triple::x86)
155157
return false;

llvm/include/llvm/IR/RuntimeLibcalls.td

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,16 @@ defvar DefaultLibcallImpls32 = DefaultRuntimeLibcallImpls;
10151015
defvar DefaultLibcallImpls64 = !listconcat(DefaultRuntimeLibcallImpls,
10161016
LibCallsCompilerRT64OrLibGCC);
10171017

1018+
defvar DarwinSinCosStret = LibcallImpls<(add __sincosf_stret, __sincos_stret),
1019+
darwinHasSinCosStret>;
1020+
defvar DarwinExp10 = LibcallImpls<(add __exp10f, __exp10), darwinHasExp10>;
1021+
1022+
defvar LibmHasSinCosF32 = LibcallImpls<(add sincosf), hasSinCos>;
1023+
defvar LibmHasSinCosF64 = LibcallImpls<(add sincos), hasSinCos>;
1024+
defvar LibmHasSinCosF80 = LibcallImpls<(add sincos_f80), hasSinCos>;
1025+
defvar LibmHasSinCosF128 = LibcallImpls<(add sincos_f128), hasSinCos>;
1026+
defvar LibmHasSinCosPPCF128 = LibcallImpls<(add sincos_ppcf128), hasSinCos>;
1027+
10181028
//===----------------------------------------------------------------------===//
10191029
// AArch64 Runtime Libcalls
10201030
//===----------------------------------------------------------------------===//
@@ -1054,7 +1064,9 @@ def AArch64SystemLibrary : SystemRuntimeLibrary<
10541064
(add DefaultRuntimeLibcallImpls,
10551065
AArch64LibcallImpls,
10561066
LibcallImpls<(add LibCallsCompilerRT64OrLibGCC), isAArch64_ILP64>,
1057-
LibcallImpls<(add bzero), isOSDarwin>)
1067+
LibcallImpls<(add bzero), isOSDarwin>,
1068+
DarwinExp10, DarwinSinCosStret,
1069+
LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128)
10581070
>;
10591071

10601072
// Prepend a # to every name

llvm/lib/IR/RuntimeLibcalls.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,6 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
494494
}
495495

496496
bool RuntimeLibcallsInfo::darwinHasExp10(const Triple &TT) {
497-
assert(TT.isOSDarwin() && "should be called with darwin triple");
498-
499497
switch (TT.getOS()) {
500498
case Triple::MacOSX:
501499
return !TT.isMacOSXVersionLT(10, 9);

0 commit comments

Comments
 (0)