[libc-commits] [libc] [libc] Fix compile error in MPFRWrapper when float128 is long double (PR #131821)

via libc-commits libc-commits at lists.llvm.org
Tue Mar 18 08:11:37 PDT 2025


https://github.com/overmighty created https://github.com/llvm/llvm-project/pull/131821

See https://lab.llvm.org/buildbot/#/builders/104/builds/18422.


>From 2f5c39249ad4aa9398d18f2cf8d8b5db930aab59 Mon Sep 17 00:00:00 2001
From: OverMighty <its.overmighty at gmail.com>
Date: Tue, 18 Mar 2025 16:05:01 +0100
Subject: [PATCH] [libc] Fix compile error in MPFRWrapper when float128 is long
 double

See https://lab.llvm.org/buildbot/#/builders/104/builds/18422.
---
 libc/utils/MPFRWrapper/MPFRUtils.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libc/utils/MPFRWrapper/MPFRUtils.cpp b/libc/utils/MPFRWrapper/MPFRUtils.cpp
index da7e4006d134d..fc260f4abed49 100644
--- a/libc/utils/MPFRWrapper/MPFRUtils.cpp
+++ b/libc/utils/MPFRWrapper/MPFRUtils.cpp
@@ -401,7 +401,8 @@ template void explain_binary_operation_one_output_error(
 template void explain_binary_operation_one_output_error(
     Operation, const BinaryInput<long double> &, float16, double, RoundingMode);
 #endif
-#ifdef LIBC_TYPES_HAS_FLOAT128
+#if defined(LIBC_TYPES_HAS_FLOAT128) &&                                        \
+    defined(LIBC_TYPES_FLOAT128_IS_NOT_LONG_DOUBLE)
 template void explain_binary_operation_one_output_error(
     Operation, const BinaryInput<float128> &, float128, double, RoundingMode);
 #endif
@@ -629,7 +630,8 @@ template bool
 compare_binary_operation_one_output(Operation, const BinaryInput<long double> &,
                                     float16, double, RoundingMode);
 #endif
-#ifdef LIBC_TYPES_HAS_FLOAT128
+#if defined(LIBC_TYPES_HAS_FLOAT128) &&                                        \
+    defined(LIBC_TYPES_FLOAT128_IS_NOT_LONG_DOUBLE)
 template bool compare_binary_operation_one_output(Operation,
                                                   const BinaryInput<float128> &,
                                                   float128, double,



More information about the libc-commits mailing list