From 11b37d6bbdfff436ac44b197e2f573bcadce154a Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Thu, 11 Jul 2024 21:08:58 +0100 Subject: [PATCH 1/2] [Darwin] Fix availability of exp10 for watchOS, tvOS, xROS. Update availability information added in 1eb7f055d9a. exp10 is available on iOS >= 7.0 and macOS >= 10.9. On all 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. --- llvm/lib/CodeGen/TargetLoweringBase.cpp | 13 ++++++------- llvm/test/CodeGen/AArch64/exp10-libcall-names.ll | 5 +++-- llvm/test/CodeGen/ARM/exp10-libcall-names.ll | 5 +++-- llvm/test/CodeGen/X86/exp10-libcall-names.ll | 7 +++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index 353b0cafbd72e0..8f490190c029e7 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -240,18 +240,17 @@ void TargetLoweringBase::InitLibcalls(const Triple &TT) { } break; case Triple::IOS: + if (TT.isOSVersionLT(7, 0)) { + setLibcallName(RTLIB::EXP10_F32, nullptr); + setLibcallName(RTLIB::EXP10_F64, nullptr); + break; + } + [[fallthrough]]; case Triple::TvOS: case Triple::WatchOS: case Triple::XROS: - if (!TT.isWatchOS() && - (TT.isOSVersionLT(7, 0) || (TT.isOSVersionLT(9, 0) && TT.isX86()))) { - setLibcallName(RTLIB::EXP10_F32, nullptr); - setLibcallName(RTLIB::EXP10_F64, nullptr); - } else { setLibcallName(RTLIB::EXP10_F32, "__exp10f"); setLibcallName(RTLIB::EXP10_F64, "__exp10"); - } - break; default: break; diff --git a/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll b/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll index 1220aec447abda..f53fd441781a53 100644 --- a/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll +++ b/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll @@ -4,11 +4,12 @@ ; RUN: llc -mtriple=aarch64-apple-tvos7.0 < %s | FileCheck -check-prefix=APPLE %s ; RUN: llc -mtriple=aarch64-apple-watchos7.0 < %s | FileCheck -check-prefix=APPLE %s ; RUN: llc -mtriple=aarch64-apple-xros7.0 < %s | FileCheck -check-prefix=APPLE %s +; RUN: llc -mtriple=aarch64-apple-tvos6.0 < %s | FileCheck -check-prefix=APPLE %s +; RUN: llc -mtriple=aarch64-apple-xros6.0 < %s | FileCheck -check-prefix=APPLE %s +; RUN: llc -mtriple=aarch64-apple-xros1.0 < %s | FileCheck -check-prefix=APPLE %s ; RUN: not llc -mtriple=aarch64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s ; RUN: not llc -mtriple=aarch64-apple-ios6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s -; RUN: not llc -mtriple=aarch64-apple-tvos6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s -; RUN: not llc -mtriple=aarch64-apple-xros6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s ; Check exp10/exp10f is emitted as __exp10/__exp10f on assorted systems. diff --git a/llvm/test/CodeGen/ARM/exp10-libcall-names.ll b/llvm/test/CodeGen/ARM/exp10-libcall-names.ll index 0ac68b3e8c4662..934f813ead0738 100644 --- a/llvm/test/CodeGen/ARM/exp10-libcall-names.ll +++ b/llvm/test/CodeGen/ARM/exp10-libcall-names.ll @@ -4,11 +4,12 @@ ; RUN: llc -mtriple=armv7-apple-tvos7.0 < %s | FileCheck -check-prefix=APPLE %s ; RUN: llc -mtriple=armv7-apple-watchos7.0 < %s | FileCheck -check-prefix=APPLE %s ; RUN: llc -mtriple=armv7-apple-xros7.0 < %s | FileCheck -check-prefix=APPLE %s +; RUN: llc -mtriple=armv7-apple-tvos6.0 < %s | FileCheck -check-prefix=APPLE %s +; RUN: llc -mtriple=armv7-apple-xros6.0 < %s | FileCheck -check-prefix=APPLE %s + ; RUN: not llc -mtriple=armv7-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s ; RUN: not llc -mtriple=armv7-apple-ios6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s -; RUN: not llc -mtriple=armv7-apple-tvos6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s -; RUN: not llc -mtriple=armv7-apple-xros6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s ; Check exp10/exp10f is emitted as __exp10/__exp10f on assorted systems. diff --git a/llvm/test/CodeGen/X86/exp10-libcall-names.ll b/llvm/test/CodeGen/X86/exp10-libcall-names.ll index ce26a0e738e90a..52f0f4ac15a1b5 100644 --- a/llvm/test/CodeGen/X86/exp10-libcall-names.ll +++ b/llvm/test/CodeGen/X86/exp10-libcall-names.ll @@ -5,12 +5,11 @@ ; RUN: llc -mtriple=x86_64-apple-tvos9.0 < %s | FileCheck -check-prefix=APPLE %s ; RUN: llc -mtriple=x86_64-apple-watchos9.0 < %s | FileCheck -check-prefix=APPLE %s ; RUN: llc -mtriple=x86_64-apple-xros9.0 < %s | FileCheck -check-prefix=APPLE %s +; RUN: llc -mtriple=x86_64-apple-ios8.0 < %s | FileCheck -check-prefix=APPLE %s +; RUN: llc -mtriple=x86_64-apple-tvos8.0 < %s | FileCheck -check-prefix=APPLE %s +; RUN: llc -mtriple=x86_64-apple-xros8.0 < %s | FileCheck -check-prefix=APPLE %s ; RUN: not llc -mtriple=x86_64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s -; RUN: not llc -mtriple=x86_64-apple-ios8.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s -; RUN: not llc -mtriple=x86_64-apple-tvos8.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s -; RUN: not llc -mtriple=x86_64-apple-xros8.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s - ; Check exp10/exp10f is emitted as __exp10/__exp10f on assorted systems. ; ERR: no libcall available for fexp10 From 89673f0afd44d3dc890624d00725ad035c690af8 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Thu, 11 Jul 2024 21:44:24 +0100 Subject: [PATCH 2/2] !fixu fix formatting. --- llvm/lib/CodeGen/TargetLoweringBase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index 8f490190c029e7..3eabea74087488 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -249,8 +249,8 @@ void TargetLoweringBase::InitLibcalls(const Triple &TT) { case Triple::TvOS: case Triple::WatchOS: case Triple::XROS: - setLibcallName(RTLIB::EXP10_F32, "__exp10f"); - setLibcallName(RTLIB::EXP10_F64, "__exp10"); + setLibcallName(RTLIB::EXP10_F32, "__exp10f"); + setLibcallName(RTLIB::EXP10_F64, "__exp10"); break; default: break;