Skip to content

Commit f64690c

Browse files
authored
[Darwin] Fix availability of exp10 for BridgeOS, DriverKit. (#9022)
* [Darwin] Add exp10(f) tests for BridgeOS & Driverkit. (chery-picked from e83ba1e) * [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 (cherry-picked from 7b99b1d)
1 parent 8ed2747 commit f64690c

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
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: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +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=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
1016

1117
; RUN: not llc -mtriple=aarch64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
1218
; RUN: not llc -mtriple=aarch64-apple-ios6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
@@ -23,6 +29,11 @@ define float @test_exp10_f32(float %x) {
2329
; APPLE-LABEL: test_exp10_f32:
2430
; APPLE: ; %bb.0:
2531
; APPLE-NEXT: b ___exp10f
32+
;
33+
; BRIDGEOS-LABEL: test_exp10_f32:
34+
; BRIDGEOS: // %bb.0:
35+
; BRIDGEOS-NEXT: b __exp10f
36+
;
2637
%ret = call float @llvm.exp10.f32(float %x)
2738
ret float %ret
2839
}
@@ -35,6 +46,11 @@ define double @test_exp10_f64(double %x) {
3546
; APPLE-LABEL: test_exp10_f64:
3647
; APPLE: ; %bb.0:
3748
; APPLE-NEXT: b ___exp10
49+
;
50+
; BRIDGEOS-LABEL: test_exp10_f64:
51+
; BRIDGEOS: // %bb.0:
52+
; BRIDGEOS-NEXT: b __exp10
53+
;
3854
%ret = call double @llvm.exp10.f64(double %x)
3955
ret double %ret
4056
}

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +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=APPLE %s
12+
; RUN: llc -mtriple=x86_64-apple-driverkit24.0 < %s | FileCheck -check-prefix=APPLE %s
1113

1214
; RUN: not llc -mtriple=x86_64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
1315
; Check exp10/exp10f is emitted as __exp10/__exp10f on assorted systems.
@@ -22,6 +24,11 @@ define float @test_exp10_f32(float %x) {
2224
; APPLE-LABEL: test_exp10_f32:
2325
; APPLE: ## %bb.0:
2426
; APPLE-NEXT: jmp ___exp10f ## TAILCALL
27+
;
28+
; MISSED-LABEL: test_exp10_f32:
29+
; MISSED: ## %bb.0:
30+
; MISSED-NEXT: jmp _exp10f ## TAILCALL
31+
2532
%ret = call float @llvm.exp10.f32(float %x)
2633
ret float %ret
2734
}
@@ -34,6 +41,11 @@ define double @test_exp10_f64(double %x) {
3441
; APPLE-LABEL: test_exp10_f64:
3542
; APPLE: ## %bb.0:
3643
; APPLE-NEXT: jmp ___exp10 ## TAILCALL
44+
;
45+
; MISSED-LABEL: test_exp10_f64:
46+
; MISSED: ## %bb.0:
47+
; MISSED-NEXT: jmp _exp10 ## TAILCALL
48+
;
3749
%ret = call double @llvm.exp10.f64(double %x)
3850
ret double %ret
3951
}

0 commit comments

Comments
 (0)