Skip to content

Commit 991967e

Browse files
authored
[Darwin] Fix availability of exp10 for watchOS, tvOS, xROS. (llvm#98542) (#8981)
Update availability information added in 1eb7f05. exp10 is available on iOS >= 7.0 and macOS >= 10.9. On all other platforms, it is available on any version. Also drop the x86 check, as the availability only depends on the OS version, not the target platform. PR: llvm#98542 (cherry-picked from d0d05ae)
1 parent 900b6fc commit 991967e

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,17 @@ void TargetLoweringBase::InitLibcalls(const Triple &TT) {
240240
}
241241
break;
242242
case Triple::IOS:
243-
case Triple::TvOS:
244-
case Triple::WatchOS:
245-
case Triple::XROS:
246-
if (!TT.isWatchOS() &&
247-
(TT.isOSVersionLT(7, 0) || (TT.isOSVersionLT(9, 0) && TT.isX86()))) {
243+
if (TT.isOSVersionLT(7, 0)) {
248244
setLibcallName(RTLIB::EXP10_F32, nullptr);
249245
setLibcallName(RTLIB::EXP10_F64, nullptr);
250-
} else {
251-
setLibcallName(RTLIB::EXP10_F32, "__exp10f");
252-
setLibcallName(RTLIB::EXP10_F64, "__exp10");
246+
break;
253247
}
254-
248+
[[fallthrough]];
249+
case Triple::TvOS:
250+
case Triple::WatchOS:
251+
case Triple::XROS:
252+
setLibcallName(RTLIB::EXP10_F32, "__exp10f");
253+
setLibcallName(RTLIB::EXP10_F64, "__exp10");
255254
break;
256255
default:
257256
break;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
; RUN: llc -mtriple=aarch64-apple-tvos7.0 < %s | FileCheck -check-prefix=APPLE %s
55
; RUN: llc -mtriple=aarch64-apple-watchos7.0 < %s | FileCheck -check-prefix=APPLE %s
66
; RUN: llc -mtriple=aarch64-apple-xros7.0 < %s | FileCheck -check-prefix=APPLE %s
7+
; RUN: llc -mtriple=aarch64-apple-tvos6.0 < %s | FileCheck -check-prefix=APPLE %s
8+
; RUN: llc -mtriple=aarch64-apple-xros6.0 < %s | FileCheck -check-prefix=APPLE %s
9+
; RUN: llc -mtriple=aarch64-apple-xros1.0 < %s | FileCheck -check-prefix=APPLE %s
710

811
; RUN: not llc -mtriple=aarch64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
912
; RUN: not llc -mtriple=aarch64-apple-ios6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
10-
; RUN: not llc -mtriple=aarch64-apple-tvos6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
11-
; RUN: not llc -mtriple=aarch64-apple-xros6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
1213

1314
; Check exp10/exp10f is emitted as __exp10/__exp10f on assorted systems.
1415

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
; RUN: llc -mtriple=armv7-apple-tvos7.0 < %s | FileCheck -check-prefix=APPLE %s
55
; RUN: llc -mtriple=armv7-apple-watchos7.0 < %s | FileCheck -check-prefix=APPLE %s
66
; RUN: llc -mtriple=armv7-apple-xros7.0 < %s | FileCheck -check-prefix=APPLE %s
7+
; RUN: llc -mtriple=armv7-apple-tvos6.0 < %s | FileCheck -check-prefix=APPLE %s
8+
; RUN: llc -mtriple=armv7-apple-xros6.0 < %s | FileCheck -check-prefix=APPLE %s
9+
710

811
; RUN: not llc -mtriple=armv7-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
912
; RUN: not llc -mtriple=armv7-apple-ios6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
10-
; RUN: not llc -mtriple=armv7-apple-tvos6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
11-
; RUN: not llc -mtriple=armv7-apple-xros6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
1213

1314
; Check exp10/exp10f is emitted as __exp10/__exp10f on assorted systems.
1415

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
; RUN: llc -mtriple=x86_64-apple-tvos9.0 < %s | FileCheck -check-prefix=APPLE %s
66
; RUN: llc -mtriple=x86_64-apple-watchos9.0 < %s | FileCheck -check-prefix=APPLE %s
77
; RUN: llc -mtriple=x86_64-apple-xros9.0 < %s | FileCheck -check-prefix=APPLE %s
8+
; RUN: llc -mtriple=x86_64-apple-ios8.0 < %s | FileCheck -check-prefix=APPLE %s
9+
; RUN: llc -mtriple=x86_64-apple-tvos8.0 < %s | FileCheck -check-prefix=APPLE %s
10+
; RUN: llc -mtriple=x86_64-apple-xros8.0 < %s | FileCheck -check-prefix=APPLE %s
811

912
; RUN: not llc -mtriple=x86_64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
10-
; RUN: not llc -mtriple=x86_64-apple-ios8.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
11-
; RUN: not llc -mtriple=x86_64-apple-tvos8.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
12-
; RUN: not llc -mtriple=x86_64-apple-xros8.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
13-
1413
; Check exp10/exp10f is emitted as __exp10/__exp10f on assorted systems.
1514

1615
; ERR: no libcall available for fexp10

0 commit comments

Comments
 (0)