-
Notifications
You must be signed in to change notification settings - Fork 14k
[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
Conversation
@llvm/pr-subscribers-flang-semantics Author: مهدي شينون (Mehdi Chinoune) (MehdiChinoune) ChangesThere are no functions for Full diff: https://github.com/llvm/llvm-project/pull/130253.diff 1 Files Affected:
diff --git a/flang/lib/Evaluate/intrinsics-library.cpp b/flang/lib/Evaluate/intrinsics-library.cpp
index d2c1be65dca44..971c8d2b67e9b 100644
--- a/flang/lib/Evaluate/intrinsics-library.cpp
+++ b/flang/lib/Evaluate/intrinsics-library.cpp
@@ -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.
|
|
f1d8d3a
to
0a46916
Compare
ping! |
There are no functions for `float`. see: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/bessel-functions-j0-j1-jn-y0-y1-yn
d291b76
to
e6722bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not familiar with windows, but change looks good, thanks.
I don't have commit access, could someone push changes, please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM too so I will merge, thanks!
There are no functions for
float
.see: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/bessel-functions-j0-j1-jn-y0-y1-yn