[libc-commits] [libc] c386d6e - [libc] Fix precision constants for long double in MPFRUtils.cpp.

Tue Ly via libc-commits libc-commits at lists.llvm.org
Thu Jan 13 18:33:48 PST 2022


Author: Tue Ly
Date: 2022-01-13T21:33:05-05:00
New Revision: c386d6eb2d323b6458f9c2ebfaeb20c7a55d6c26

URL: https://github.com/llvm/llvm-project/commit/c386d6eb2d323b6458f9c2ebfaeb20c7a55d6c26
DIFF: https://github.com/llvm/llvm-project/commit/c386d6eb2d323b6458f9c2ebfaeb20c7a55d6c26.diff

LOG: [libc] Fix precision constants for long double in MPFRUtils.cpp.

Added: 
    

Modified: 
    libc/utils/MPFRWrapper/MPFRUtils.cpp

Removed: 
    


################################################################################
diff  --git a/libc/utils/MPFRWrapper/MPFRUtils.cpp b/libc/utils/MPFRWrapper/MPFRUtils.cpp
index 5339df7a43ac3..794f60bdd0531 100644
--- a/libc/utils/MPFRWrapper/MPFRUtils.cpp
+++ b/libc/utils/MPFRWrapper/MPFRUtils.cpp
@@ -10,7 +10,7 @@
 
 #include "src/__support/CPP/StringView.h"
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/architectures.h"
+#include "src/__support/FPUtil/PlatformDefs.h"
 #include "utils/UnitTest/FPMatcher.h"
 
 #include <cmath>
@@ -47,7 +47,11 @@ template <> struct Precision<double> {
   static constexpr unsigned int VALUE = 53;
 };
 
-#if !(defined(LLVM_LIBC_ARCH_X86))
+#if defined(LONG_DOUBLE_IS_DOUBLE)
+template <> struct Precision<long double> {
+  static constexpr unsigned int VALUE = 53;
+};
+#elif defined(SPECIAL_X86_LONG_DOUBLE)
 template <> struct Precision<long double> {
   static constexpr unsigned int VALUE = 64;
 };


        


More information about the libc-commits mailing list