[libc-commits] [libc] [libc] Stub handling for the PPC double double type (PR #136614)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Wed Apr 23 07:00:26 PDT 2025


https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/136614

>From 1b485c0f32734c4611b3bd908057bc2bf0c19d00 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Wed, 23 Apr 2025 08:59:51 -0500
Subject: [PATCH] [libc] Special case PPC double double handling for printf

Summary:
Hard code this to a uint128 so it can be built on PPC.
---
 libc/src/stdio/printf_core/core_structs.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libc/src/stdio/printf_core/core_structs.h b/libc/src/stdio/printf_core/core_structs.h
index 4c3b81ff018ab..bab4fe75058a0 100644
--- a/libc/src/stdio/printf_core/core_structs.h
+++ b/libc/src/stdio/printf_core/core_structs.h
@@ -55,8 +55,13 @@ struct FormatSection {
   int min_width = 0;
   int precision = -1;
 
-  // Needs to be large enough to hold a long double.
+  // Needs to be large enough to hold a long double. Special case handling for
+  // the PowerPC double double type because it has no FPBits interface.
+#ifdef LIBC_TYPES_LONG_DOUBLE_IS_DOUBLE_DOUBLE
+  Uint128 conv_val_raw;
+#else
   fputil::FPBits<long double>::StorageType conv_val_raw;
+#endif // LIBC_TYPES_LONG_DOUBLE_IS_DOUBLE_DOUBLE
   void *conv_val_ptr;
 
   char conv_name;



More information about the libc-commits mailing list