[libc-commits] [libc] [libc][NFC] Rename SPECIAL_X86_LONG_DOUBLE in LIBC_LONG_DOUBLE_IS_X86_BIN80 (PR #73950)
Guillaume Chatelet via libc-commits
libc-commits at lists.llvm.org
Thu Nov 30 07:06:15 PST 2023
https://github.com/gchatelet created https://github.com/llvm/llvm-project/pull/73950
None
>From a301b44c0ccb9563bd9846b8c848d85ad6037b6c Mon Sep 17 00:00:00 2001
From: Guillaume Chatelet <gchatelet at google.com>
Date: Thu, 30 Nov 2023 15:04:45 +0000
Subject: [PATCH] [libc][NFC] Rename SPECIAL_X86_LONG_DOUBLE in
LIBC_LONG_DOUBLE_IS_X86_BIN80
---
libc/src/__support/FPUtil/FPBits.h | 2 +-
.../__support/FPUtil/ManipulationFunctions.h | 4 +-
libc/src/__support/FPUtil/NormalFloat.h | 4 +-
libc/src/__support/FPUtil/generic/sqrt.h | 6 +-
.../FPUtil/generic/sqrt_80_bit_long_double.h | 4 +-
libc/src/__support/macros/properties/float.h | 3 +-
libc/src/__support/str_to_float.h | 4 +-
libc/test/src/__support/str_to_float_test.cpp | 2 +-
libc/test/src/stdio/sprintf_test.cpp | 56 +++++++++----------
libc/test/src/stdlib/strtold_test.cpp | 2 +-
10 files changed, 43 insertions(+), 44 deletions(-)
diff --git a/libc/src/__support/FPUtil/FPBits.h b/libc/src/__support/FPUtil/FPBits.h
index 76a9fc6d772bf9c..b9d44bbd2d704f1 100644
--- a/libc/src/__support/FPUtil/FPBits.h
+++ b/libc/src/__support/FPUtil/FPBits.h
@@ -249,7 +249,7 @@ template <typename T> struct FPBits {
} // namespace fputil
} // namespace LIBC_NAMESPACE
-#ifdef SPECIAL_X86_LONG_DOUBLE
+#ifdef LIBC_LONG_DOUBLE_IS_X86_BIN80
#include "x86_64/LongDoubleBits.h"
#endif
diff --git a/libc/src/__support/FPUtil/ManipulationFunctions.h b/libc/src/__support/FPUtil/ManipulationFunctions.h
index 9286deee2d92c47..a8077baa0ed4fa7 100644
--- a/libc/src/__support/FPUtil/ManipulationFunctions.h
+++ b/libc/src/__support/FPUtil/ManipulationFunctions.h
@@ -186,8 +186,8 @@ LIBC_INLINE T nextafter(T from, U to) {
} // namespace fputil
} // namespace LIBC_NAMESPACE
-#ifdef SPECIAL_X86_LONG_DOUBLE
+#ifdef LIBC_LONG_DOUBLE_IS_X86_BIN80
#include "x86_64/NextAfterLongDouble.h"
-#endif // SPECIAL_X86_LONG_DOUBLE
+#endif // LIBC_LONG_DOUBLE_IS_X86_BIN80
#endif // LLVM_LIBC_SRC___SUPPORT_FPUTIL_MANIPULATIONFUNCTIONS_H
diff --git a/libc/src/__support/FPUtil/NormalFloat.h b/libc/src/__support/FPUtil/NormalFloat.h
index afbf97cc2b6386d..bec05cc382e91e8 100644
--- a/libc/src/__support/FPUtil/NormalFloat.h
+++ b/libc/src/__support/FPUtil/NormalFloat.h
@@ -170,7 +170,7 @@ template <typename T> struct NormalFloat {
}
};
-#ifdef SPECIAL_X86_LONG_DOUBLE
+#ifdef LIBC_LONG_DOUBLE_IS_X86_BIN80
template <>
LIBC_INLINE void
NormalFloat<long double>::init_from_bits(FPBits<long double> bits) {
@@ -259,7 +259,7 @@ template <> LIBC_INLINE NormalFloat<long double>::operator long double() const {
result.set_implicit_bit(1);
return static_cast<long double>(result);
}
-#endif // SPECIAL_X86_LONG_DOUBLE
+#endif // LIBC_LONG_DOUBLE_IS_X86_BIN80
} // namespace fputil
} // namespace LIBC_NAMESPACE
diff --git a/libc/src/__support/FPUtil/generic/sqrt.h b/libc/src/__support/FPUtil/generic/sqrt.h
index 63e8329b066074a..08279904202b8ec 100644
--- a/libc/src/__support/FPUtil/generic/sqrt.h
+++ b/libc/src/__support/FPUtil/generic/sqrt.h
@@ -28,11 +28,11 @@ template <typename T> struct SpecialLongDouble {
static constexpr bool VALUE = false;
};
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
template <> struct SpecialLongDouble<long double> {
static constexpr bool VALUE = true;
};
-#endif // SPECIAL_X86_LONG_DOUBLE
+#endif // LIBC_LONG_DOUBLE_IS_X86_BIN80
template <typename T>
LIBC_INLINE void normalize(int &exponent,
@@ -48,7 +48,7 @@ template <>
LIBC_INLINE void normalize<long double>(int &exponent, uint64_t &mantissa) {
normalize<double>(exponent, mantissa);
}
-#elif !defined(SPECIAL_X86_LONG_DOUBLE)
+#elif !defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
template <>
LIBC_INLINE void normalize<long double>(int &exponent, UInt128 &mantissa) {
const uint64_t hi_bits = static_cast<uint64_t>(mantissa >> 64);
diff --git a/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h b/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
index 713c3389051096f..a7533ae948522bc 100644
--- a/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
+++ b/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
@@ -34,7 +34,7 @@ LIBC_INLINE long double sqrt(long double x);
// Correctly rounded SQRT for all rounding modes.
// Shift-and-add algorithm.
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
LIBC_INLINE long double sqrt(long double x) {
using UIntType = typename FPBits<long double>::UIntType;
constexpr UIntType ONE = UIntType(1)
@@ -135,7 +135,7 @@ LIBC_INLINE long double sqrt(long double x) {
return out;
}
}
-#endif // SPECIAL_X86_LONG_DOUBLE
+#endif // LIBC_LONG_DOUBLE_IS_X86_BIN80
} // namespace x86
} // namespace fputil
diff --git a/libc/src/__support/macros/properties/float.h b/libc/src/__support/macros/properties/float.h
index 7e00ddc8f0cd327..e2ee06a081c8b83 100644
--- a/libc/src/__support/macros/properties/float.h
+++ b/libc/src/__support/macros/properties/float.h
@@ -23,8 +23,7 @@
#define LONG_DOUBLE_IS_DOUBLE
#endif
#if (LDBL_MANT_DIG == 64)
-// TODO: Replace with LIBC_LONG_DOUBLE_IS_X86_BIN80
-#define SPECIAL_X86_LONG_DOUBLE
+#define LIBC_LONG_DOUBLE_IS_X86_BIN80
#elif (LDBL_MANT_DIG == 113)
#define LIBC_LONG_DOUBLE_IS_IEEE754_BIN128
#endif
diff --git a/libc/src/__support/str_to_float.h b/libc/src/__support/str_to_float.h
index 81ab36dbf9471fb..2384b1d966473f6 100644
--- a/libc/src/__support/str_to_float.h
+++ b/libc/src/__support/str_to_float.h
@@ -89,7 +89,7 @@ template <class T> LIBC_INLINE void set_implicit_bit(fputil::FPBits<T> &) {
return;
}
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
template <>
LIBC_INLINE void
set_implicit_bit<long double>(fputil::FPBits<long double> &result) {
@@ -529,7 +529,7 @@ template <> class ClingerConsts<long double> {
static constexpr long double MAX_EXACT_INT =
ClingerConsts<double>::MAX_EXACT_INT;
};
-#elif defined(SPECIAL_X86_LONG_DOUBLE)
+#elif defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
template <> class ClingerConsts<long double> {
public:
static constexpr long double POWERS_OF_TEN_ARRAY[] = {
diff --git a/libc/test/src/__support/str_to_float_test.cpp b/libc/test/src/__support/str_to_float_test.cpp
index ae729418ebe3639..bc48128b0aa9b64 100644
--- a/libc/test/src/__support/str_to_float_test.cpp
+++ b/libc/test/src/__support/str_to_float_test.cpp
@@ -283,7 +283,7 @@ TEST(LlvmLibcStrToFloatTest, SimpleDecimalConversionExtraTypes) {
TEST_F(LlvmLibcStrToFloatTest, EiselLemireFloat64AsLongDouble) {
eisel_lemire_test<long double>(123, 0, 0x1EC00000000000, 1029);
}
-#elif defined(SPECIAL_X86_LONG_DOUBLE)
+#elif defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
TEST_F(LlvmLibcStrToFloatTest, EiselLemireFloat80Simple) {
eisel_lemire_test<long double>(123, 0, 0xf600000000000000, 16389);
eisel_lemire_test<long double>(12345678901234568192u, 0, 0xab54a98ceb1f0c00,
diff --git a/libc/test/src/stdio/sprintf_test.cpp b/libc/test/src/stdio/sprintf_test.cpp
index e41579a20656b72..66071c1ea31a85f 100644
--- a/libc/test/src/stdio/sprintf_test.cpp
+++ b/libc/test/src/stdio/sprintf_test.cpp
@@ -642,7 +642,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatHexExpConv) {
// Length Modifier Tests.
written = LIBC_NAMESPACE::sprintf(buff, "%La", 0.1L);
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xc.ccccccccccccccdp-7");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x1.999999999999ap-4");
@@ -651,7 +651,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatHexExpConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%La", 1.0e1000L);
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xf.38db1f9dd3dac05p+3318");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "inf");
@@ -660,7 +660,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatHexExpConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%La", 1.0e-1000L);
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0x8.68a9188a89e1467p-3325");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x0p+0");
@@ -766,7 +766,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatHexExpConv) {
ASSERT_STREQ_LEN(written, buff, "0x0p+0");
written = LIBC_NAMESPACE::sprintf(buff, "%.1La", 0.1L);
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xc.dp-7");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x1.ap-4");
@@ -775,7 +775,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatHexExpConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%.1La", 0xf.fffffffffffffffp16380L);
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0x1.0p+16384");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "inf");
@@ -1024,7 +1024,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatDecimalConv) {
// Some float128 systems (specifically the ones used for aarch64 buildbots)
// don't respect signs for long double NaNs.
-#if defined(SPECIAL_X86_LONG_DOUBLE) || defined(LONG_DOUBLE_IS_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80) || defined(LONG_DOUBLE_IS_DOUBLE)
written = LIBC_NAMESPACE::sprintf(buff, "%LF", -ld_nan);
ASSERT_STREQ_LEN(written, buff, "-NAN");
#endif
@@ -1042,7 +1042,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatDecimalConv) {
written = LIBC_NAMESPACE::sprintf(buff, "%.Lf", -2.5L);
ASSERT_STREQ_LEN(written, buff, "-2");
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
written = LIBC_NAMESPACE::sprintf(buff, "%Lf", 1e100L);
ASSERT_STREQ_LEN(written, buff,
@@ -1327,11 +1327,11 @@ TEST_F(LlvmLibcSPrintfTest, FloatDecimalConv) {
"570449525088342437216896462077260223998756027453411520977536701491759878"
"422771447006016890777855573925295187921971811871399320142563330377888532"
"179817332113");
-#endif // SPECIAL_X86_LONG_DOUBLE
+#endif // LIBC_LONG_DOUBLE_IS_X86_BIN80
/*
written = LIBC_NAMESPACE::sprintf(buff, "%La", 0.1L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xc.ccccccccccccccdp-7");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x1.999999999999ap-4");
@@ -1340,7 +1340,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatDecimalConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%La", 1.0e1000L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xf.38db1f9dd3dac05p+3318");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "inf");
@@ -1349,7 +1349,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatDecimalConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%La", 1.0e-1000L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0x8.68a9188a89e1467p-3325");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x0p+0");
@@ -1548,7 +1548,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatDecimalConv) {
/*
written = LIBC_NAMESPACE::sprintf(buff, "%.1La", 0.1L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xc.dp-7");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x1.ap-4");
@@ -1557,7 +1557,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatDecimalConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%.1La",
- 0xf.fffffffffffffffp16380L); #if defined(SPECIAL_X86_LONG_DOUBLE)
+ 0xf.fffffffffffffffp16380L); #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0x1.0p+16384");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "inf");
@@ -1858,7 +1858,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatExponentConv) {
// Length Modifier Tests.
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
written = LIBC_NAMESPACE::sprintf(buff, "%.9Le", 1000000000500000000.1L);
ASSERT_STREQ_LEN(written, buff, "1.000000001e+18");
@@ -1975,7 +1975,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatExponentConv) {
*/
/*
written = LIBC_NAMESPACE::sprintf(buff, "%La", 0.1L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xc.ccccccccccccccdp-7");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x1.999999999999ap-4");
@@ -1984,7 +1984,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatExponentConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%La", 1.0e1000L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xf.38db1f9dd3dac05p+3318");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "inf");
@@ -1993,7 +1993,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatExponentConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%La", 1.0e-1000L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0x8.68a9188a89e1467p-3325");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x0p+0");
@@ -2171,7 +2171,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatExponentConv) {
/*
written = LIBC_NAMESPACE::sprintf(buff, "%.1La", 0.1L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xc.dp-7");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x1.ap-4");
@@ -2180,7 +2180,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatExponentConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%.1La",
- 0xf.fffffffffffffffp16380L); #if defined(SPECIAL_X86_LONG_DOUBLE)
+ 0xf.fffffffffffffffp16380L); #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0x1.0p+16384");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "inf");
@@ -2499,7 +2499,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatAutoConv) {
// Length Modifier Tests.
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
written = LIBC_NAMESPACE::sprintf(buff, "%Lg", 0xf.fffffffffffffffp+16380L);
ASSERT_STREQ_LEN(written, buff, "1.18973e+4932");
@@ -2507,7 +2507,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatAutoConv) {
written = LIBC_NAMESPACE::sprintf(buff, "%Lg", 0xa.aaaaaaaaaaaaaabp-7L);
ASSERT_STREQ_LEN(written, buff, "0.0833333");
-#endif // SPECIAL_X86_LONG_DOUBLE
+#endif // LIBC_LONG_DOUBLE_IS_X86_BIN80
// TODO: Uncomment the below tests after long double support is added
/*
@@ -2614,7 +2614,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatAutoConv) {
*/
/*
written = LIBC_NAMESPACE::sprintf(buff, "%La", 0.1L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xc.ccccccccccccccdp-7");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x1.999999999999ap-4");
@@ -2623,7 +2623,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatAutoConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%La", 1.0e1000L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xf.38db1f9dd3dac05p+3318");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "inf");
@@ -2632,7 +2632,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatAutoConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%La", 1.0e-1000L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0x8.68a9188a89e1467p-3325");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x0p+0");
@@ -2806,21 +2806,21 @@ TEST_F(LlvmLibcSPrintfTest, FloatAutoConv) {
written = LIBC_NAMESPACE::sprintf(buff, "%.10g", 0x1.0p-1074);
ASSERT_STREQ_LEN(written, buff, "4.940656458e-324");
-#if defined(SPECIAL_X86_LONG_DOUBLE)
+#if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
written = LIBC_NAMESPACE::sprintf(buff, "%.60Lg", 0xa.aaaaaaaaaaaaaabp-7L);
ASSERT_STREQ_LEN(
written, buff,
"0.0833333333333333333355920878593448009041821933351457118988037");
-#endif // SPECIAL_X86_LONG_DOUBLE
+#endif // LIBC_LONG_DOUBLE_IS_X86_BIN80
// Long double precision tests.
// These are currently commented out because they require long double support
// that isn't ready yet.
/*
written = LIBC_NAMESPACE::sprintf(buff, "%.1La", 0.1L);
- #if defined(SPECIAL_X86_LONG_DOUBLE)
+ #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0xc.dp-7");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "0x1.ap-4");
@@ -2829,7 +2829,7 @@ TEST_F(LlvmLibcSPrintfTest, FloatAutoConv) {
#endif
written = LIBC_NAMESPACE::sprintf(buff, "%.1La",
- 0xf.fffffffffffffffp16380L); #if defined(SPECIAL_X86_LONG_DOUBLE)
+ 0xf.fffffffffffffffp16380L); #if defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
ASSERT_STREQ_LEN(written, buff, "0x1.0p+16384");
#elif defined(LONG_DOUBLE_IS_DOUBLE)
ASSERT_STREQ_LEN(written, buff, "inf");
diff --git a/libc/test/src/stdlib/strtold_test.cpp b/libc/test/src/stdlib/strtold_test.cpp
index 680a93188c76d1d..c415ac481b05df4 100644
--- a/libc/test/src/stdlib/strtold_test.cpp
+++ b/libc/test/src/stdlib/strtold_test.cpp
@@ -18,7 +18,7 @@
#if defined(LONG_DOUBLE_IS_DOUBLE)
#define SELECT_CONST(val, _, __) val
-#elif defined(SPECIAL_X86_LONG_DOUBLE)
+#elif defined(LIBC_LONG_DOUBLE_IS_X86_BIN80)
#define SELECT_CONST(_, val, __) val
#else
#define SELECT_CONST(_, __, val) val
More information about the libc-commits
mailing list