Skip to content

[flang] Fold double bessel functions on Windows. #130253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions flang/lib/Evaluate/intrinsics-library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,23 @@ struct HostRuntimeLibrary<long double, LibraryVersion::LibmExtensions> {
#endif // HAS_FLOAT80 || HAS_LDBL128
#endif //_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600

#ifdef _WIN32
template <> struct HostRuntimeLibrary<double, LibraryVersion::LibmExtensions> {
using F = FuncPointer<double, double>;
using FN = FuncPointer<double, int, double>;
static constexpr HostRuntimeFunction table[]{
FolderFactory<F, F{::_j0}>::Create("bessel_j0"),
FolderFactory<F, F{::_j1}>::Create("bessel_j1"),
FolderFactory<FN, FN{::_jn}>::Create("bessel_jn"),
FolderFactory<F, F{::_y0}>::Create("bessel_y0"),
FolderFactory<F, F{::_y1}>::Create("bessel_y1"),
FolderFactory<FN, FN{::_yn}>::Create("bessel_yn"),
};
static constexpr HostRuntimeMap map{table};
static_assert(map.Verify(), "map must be sorted");
};
#endif

/// Define pgmath description
#if LINK_WITH_LIBPGMATH
// Only use libpgmath for folding if it is available.
Expand Down