[libc-commits] [libc] [libc] Enable Float80-type for x86_32 (PR #221408)
via libc-commits
libc-commits at lists.llvm.org
Fri Sep 4 23:52:58 PDT 2026
https://github.com/Sukumarsawant created https://github.com/llvm/llvm-project/pull/221408
Enables for x86_32 by using Uint<96>
```CPP
struct Float80 {
#if __SIZEOF_LONG_DOUBLE__ == 12
UInt<96> bits;
#else
UInt128 bits;
#endif
```
for testing it on x86_32
it needs -m32 and --msse2 extra flags other than your usual cmake for x86_32
>From bd8c5adad870e15cb7f53765dd3bc5c1bdb62bdc Mon Sep 17 00:00:00 2001
From: Sukumarsawant <sawantsukumar at gmail.com>
Date: Sat, 5 Sep 2026 12:19:36 +0530
Subject: [PATCH] enable for x86_32
---
libc/src/__support/FPUtil/float80.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libc/src/__support/FPUtil/float80.h b/libc/src/__support/FPUtil/float80.h
index 25c7ba9251a96..c0bc40cd6c1aa 100644
--- a/libc/src/__support/FPUtil/float80.h
+++ b/libc/src/__support/FPUtil/float80.h
@@ -26,8 +26,11 @@ namespace LIBC_NAMESPACE_DECL {
namespace fputil {
struct Float80 {
+#if __SIZEOF_LONG_DOUBLE__ == 12
+ UInt<96> bits;
+#else
UInt128 bits;
-
+#endif
LIBC_INLINE Float80() = default;
LIBC_INLINE constexpr Float80(const Float80 &) = default;
LIBC_INLINE constexpr Float80(Float80 &&) = default;
More information about the libc-commits
mailing list