[libcxx-commits] [PATCH] D136393: [libc++][math.h] Use builtins for all the functions

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 24 08:58:03 PST 2022


ldionne added inline comments.


================
Comment at: libcxx/include/math.h:686
+#ifdef _AIX
+  return ::ldexpl(__x, __e);
+#else
----------------
xingxue wrote:
> xingxue wrote:
> > xingxue wrote:
> > > ldionne wrote:
> > > > Is there a reason why this builtin doesn't work correctly on AIX?
> > > > 
> > > > @daltenty @xingxue Can you get someone to fix this? When we try to make those `constexpr`, things could start failing pretty badly on AIX if we're not using builtins.
> > > The issue is that AIX implements math functions `frexpl()`, `ldexpl()`, and `modfl()` as 128-bit `long double` but for other math functions, AIX libm has 64-bit `long double` wrappers. Currently, the Clang compiler on AIX supports 64-bit `long double` only and therefore, `frexpl()`, `ldexpl()`, and `modfl()` would seg-fault. We are looking into a fix.
> > Patch D137986 has been created for the compiler to map `__builtin_frexpl()`, `__builtin_ldexpl()`, and `__builtin_modfl()` to `double` version functions `frexp()`, `ldexp()`, and `modf()` in 64-bit `long double` mode.
> @philnik @ldionne  The compiler on the AIX buildbot for CI has been updated with patch D137986. We should be able to remove the workaround for AIX in `math.h` now.
Nice, thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136393/new/

https://reviews.llvm.org/D136393



More information about the libcxx-commits mailing list