Skip to content

Commit 7b99b1d

Browse files
authored
[Darwin] Fix availability of exp10 for BridgeOS, DriverKit. (llvm#100894)
Same as llvm#98542, but also mark exp10 available on BridgeOS and DriverKit. Note that BridgeOS currently is not included by isOSDarwin, but it probably should. PR: llvm#100894
1 parent b3b390b commit 7b99b1d

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

llvm/lib/IR/RuntimeLibcalls.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
155155
break;
156156
}
157157
[[fallthrough]];
158+
case Triple::DriverKit:
158159
case Triple::TvOS:
159160
case Triple::WatchOS:
160161
case Triple::XROS:
@@ -164,6 +165,10 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
164165
default:
165166
break;
166167
}
168+
} else if (TT.getOS() == Triple::BridgeOS) {
169+
// TODO: BridgeOS should be included in isOSDarwin.
170+
setLibcallName(RTLIB::EXP10_F32, "__exp10f");
171+
setLibcallName(RTLIB::EXP10_F64, "__exp10");
167172
} else {
168173
setLibcallName(RTLIB::FPEXT_F16_F32, "__gnu_h2f_ieee");
169174
setLibcallName(RTLIB::FPROUND_F32_F16, "__gnu_f2h_ieee");

llvm/test/CodeGen/AArch64/exp10-libcall-names.ll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
; RUN: llc -mtriple=aarch64-apple-tvos6.0 < %s | FileCheck -check-prefix=APPLE %s
88
; RUN: llc -mtriple=aarch64-apple-xros6.0 < %s | FileCheck -check-prefix=APPLE %s
99
; RUN: llc -mtriple=aarch64-apple-xros1.0 < %s | FileCheck -check-prefix=APPLE %s
10-
; RUN: llc -mtriple=arm64-apple-driverkit < %s | FileCheck -check-prefix=MISSED %s
11-
; RUN: llc -mtriple=arm64-apple-driverkit1.0 < %s | FileCheck -check-prefix=MISSED %s
12-
; RUN: llc -mtriple=arm64-apple-driverkit24.0 < %s | FileCheck -check-prefix=MISSED %s
13-
; RUN: llc -mtriple=arm64-apple-bridgeos < %s | FileCheck -check-prefix=LINUX %s
14-
; RUN: llc -mtriple=arm64-apple-bridgeos1.0 < %s | FileCheck -check-prefix=LINUX %s
15-
; RUN: llc -mtriple=arm64-apple-bridgeos9.0 < %s | FileCheck -check-prefix=LINUX %s
10+
; RUN: llc -mtriple=arm64-apple-driverkit < %s | FileCheck -check-prefix=APPLE %s
11+
; RUN: llc -mtriple=arm64-apple-driverkit1.0 < %s | FileCheck -check-prefix=APPLE %s
12+
; RUN: llc -mtriple=arm64-apple-driverkit24.0 < %s | FileCheck -check-prefix=APPLE %s
13+
; RUN: llc -mtriple=arm64-apple-bridgeos < %s | FileCheck -check-prefix=BRIDGEOS %s
14+
; RUN: llc -mtriple=arm64-apple-bridgeos1.0 < %s | FileCheck -check-prefix=BRIDGEOS %s
15+
; RUN: llc -mtriple=arm64-apple-bridgeos9.0 < %s | FileCheck -check-prefix=BRIDGEOS %s
1616

1717
; RUN: not llc -mtriple=aarch64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
1818
; RUN: not llc -mtriple=aarch64-apple-ios6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
@@ -30,9 +30,9 @@ define float @test_exp10_f32(float %x) {
3030
; APPLE: ; %bb.0:
3131
; APPLE-NEXT: b ___exp10f
3232
;
33-
; MISSED-LABEL: test_exp10_f32:
34-
; MISSED: ; %bb.0:
35-
; MISSED-NEXT: b _exp10f
33+
; BRIDGEOS-LABEL: test_exp10_f32:
34+
; BRIDGEOS: // %bb.0:
35+
; BRIDGEOS-NEXT: b __exp10f
3636
;
3737
%ret = call float @llvm.exp10.f32(float %x)
3838
ret float %ret
@@ -47,9 +47,9 @@ define double @test_exp10_f64(double %x) {
4747
; APPLE: ; %bb.0:
4848
; APPLE-NEXT: b ___exp10
4949
;
50-
; MISSED-LABEL: test_exp10_f64:
51-
; MISSED: ; %bb.0:
52-
; MISSED-NEXT: b _exp10
50+
; BRIDGEOS-LABEL: test_exp10_f64:
51+
; BRIDGEOS: // %bb.0:
52+
; BRIDGEOS-NEXT: b __exp10
5353
;
5454
%ret = call double @llvm.exp10.f64(double %x)
5555
ret double %ret

llvm/test/CodeGen/X86/exp10-libcall-names.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
; RUN: llc -mtriple=x86_64-apple-ios8.0 < %s | FileCheck -check-prefix=APPLE %s
99
; RUN: llc -mtriple=x86_64-apple-tvos8.0 < %s | FileCheck -check-prefix=APPLE %s
1010
; RUN: llc -mtriple=x86_64-apple-xros8.0 < %s | FileCheck -check-prefix=APPLE %s
11-
; RUN: llc -mtriple=x86_64-apple-driverkit < %s | FileCheck -check-prefix=MISSED %s
12-
; RUN: llc -mtriple=x86_64-apple-driverkit24.0 < %s | FileCheck -check-prefix=MISSED %s
11+
; RUN: llc -mtriple=x86_64-apple-driverkit < %s | FileCheck -check-prefix=APPLE %s
12+
; RUN: llc -mtriple=x86_64-apple-driverkit24.0 < %s | FileCheck -check-prefix=APPLE %s
1313

1414
; RUN: not llc -mtriple=x86_64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
1515
; Check exp10/exp10f is emitted as __exp10/__exp10f on assorted systems.

0 commit comments

Comments
 (0)