Skip to content

Commit d0d05ae

Browse files
authored
[Darwin] Fix availability of exp10 for watchOS, tvOS, xROS. (#98542)
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: #98542
1 parent 9c1861b commit d0d05ae

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
@@ -246,18 +246,17 @@ void TargetLoweringBase::InitLibcalls(const Triple &TT) {
246246
}
247247
break;
248248
case Triple::IOS:
249-
case Triple::TvOS:
250-
case Triple::WatchOS:
251-
case Triple::XROS:
252-
if (!TT.isWatchOS() &&
253-
(TT.isOSVersionLT(7, 0) || (TT.isOSVersionLT(9, 0) && TT.isX86()))) {
249+
if (TT.isOSVersionLT(7, 0)) {
254250
setLibcallName(RTLIB::EXP10_F32, nullptr);
255251
setLibcallName(RTLIB::EXP10_F64, nullptr);
256-
} else {
257-
setLibcallName(RTLIB::EXP10_F32, "__exp10f");
258-
setLibcallName(RTLIB::EXP10_F64, "__exp10");
252+
break;
259253
}
260-
254+
[[fallthrough]];
255+
case Triple::TvOS:
256+
case Triple::WatchOS:
257+
case Triple::XROS:
258+
setLibcallName(RTLIB::EXP10_F32, "__exp10f");
259+
setLibcallName(RTLIB::EXP10_F64, "__exp10");
261260
break;
262261
default:
263262
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)