[libcxx-commits] [libcxxabi] [libcxxabi] Fix the long double demangling for PowerPC (PR #135332)
Martin Storsjö via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Apr 11 01:58:58 PDT 2025
https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/135332
PowerPC uses a slightly different type of floats for their 128 bit long doubles, as "double-double", with __LDBL_MANT_DIG__ == 106 rather than __LDBL_MANT_DIG__ == 113 for IEEE 128 bit floats.
This fixes compiling libcxxabi for PowerPC after
3b70715c13876c51542ebfe2e3f4ee908f6785cb.
>From aeb137904313f374a0a2f514385f6e9990ab0ca4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Fri, 11 Apr 2025 11:32:33 +0300
Subject: [PATCH] [libcxxabi] Fix the long double demangling for PowerPC
PowerPC uses a slightly different type of floats for their 128
bit long doubles, as "double-double", with __LDBL_MANT_DIG__ == 106
rather than __LDBL_MANT_DIG__ == 113 for IEEE 128 bit floats.
This fixes compiling libcxxabi for PowerPC after
3b70715c13876c51542ebfe2e3f4ee908f6785cb.
---
libcxxabi/src/demangle/ItaniumDemangle.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h
index b9d17060c04f9..eca9ddad66f92 100644
--- a/libcxxabi/src/demangle/ItaniumDemangle.h
+++ b/libcxxabi/src/demangle/ItaniumDemangle.h
@@ -5741,7 +5741,7 @@ struct FloatData<double>
template <>
struct FloatData<long double>
{
-#if __LDBL_MANT_DIG__ == 113
+#if __LDBL_MANT_DIG__ == 113 || __LDBL_MANT_DIG__ == 106
static const size_t mangled_size = 32;
#elif __LDBL_MANT_DIG__ == 53 || defined(_MSC_VER)
// MSVC doesn't define __LDBL_MANT_DIG__, but it has long double equal to
More information about the libcxx-commits
mailing list