void-packages/srcpkgs/llvm15/patches/libcxx-ppc.patch

23 lines
971 B
Diff

This ensures `is_iec559` is defined correctly under all long double ABIs,
including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
is not defined on gcc.
--- a/libcxx/include/limits
+++ b/libcxx/include/limits
@@ -426,8 +426,14 @@ protected:
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
-#if (defined(__ppc__) || defined(__ppc64__))
+#if defined(__powerpc__) || defined(__powerpc64__)
+#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
+ /* IEEE 754 quadruple or double precision */
+ static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+#else
+ /* 128-bit IBM double-double */
static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
+#endif
#else
static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
#endif