Skip to content

Commit 4cb1d91

Browse files
authored
[flang] add folding support for quad bessels (#77314)
This is done using libquadmath and the mappings are only available if libquadmath was found by cmake. Support for non quad bessels is already available on POSIX platform using libm extensions.
1 parent c6bb89f commit 4cb1d91

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

flang/lib/Evaluate/intrinsics-library.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ template <> struct HostRuntimeLibrary<float, LibraryVersion::LibmExtensions> {
321321
template <> struct HostRuntimeLibrary<__float128, LibraryVersion::Libm> {
322322
using F = FuncPointer<__float128, __float128>;
323323
using F2 = FuncPointer<__float128, __float128, __float128>;
324+
using FN = FuncPointer<__float128, int, __float128>;
324325
static constexpr HostRuntimeFunction table[]{
325326
FolderFactory<F, F{::acosq}>::Create("acos"),
326327
FolderFactory<F, F{::acoshq}>::Create("acosh"),
@@ -329,6 +330,12 @@ template <> struct HostRuntimeLibrary<__float128, LibraryVersion::Libm> {
329330
FolderFactory<F, F{::atanq}>::Create("atan"),
330331
FolderFactory<F2, F2{::atan2q}>::Create("atan2"),
331332
FolderFactory<F, F{::atanhq}>::Create("atanh"),
333+
FolderFactory<F, F{::j0q}>::Create("bessel_j0"),
334+
FolderFactory<F, F{::j1q}>::Create("bessel_j1"),
335+
FolderFactory<FN, FN{::jnq}>::Create("bessel_jn"),
336+
FolderFactory<F, F{::y0q}>::Create("bessel_y0"),
337+
FolderFactory<F, F{::y1q}>::Create("bessel_y1"),
338+
FolderFactory<FN, FN{::ynq}>::Create("bessel_yn"),
332339
FolderFactory<F, F{::cosq}>::Create("cos"),
333340
FolderFactory<F, F{::coshq}>::Create("cosh"),
334341
FolderFactory<F, F{::erfq}>::Create("erf"),

0 commit comments

Comments
 (0)