[llvm] Enable logf128 constant folding for hosts with 128bit long double (PR #96287)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 22 22:07:30 PDT 2024
================
@@ -9,18 +9,17 @@
#ifndef LLVM_FLOAT128
#define LLVM_FLOAT128
+#include <cmath>
+
namespace llvm {
-#if defined(__clang__) && defined(__FLOAT128__) && \
- defined(__SIZEOF_INT128__) && !defined(__LONG_DOUBLE_IBM128__)
-#define HAS_IEE754_FLOAT128
-typedef __float128 float128;
-#elif defined(__FLOAT128__) && defined(__SIZEOF_INT128__) && \
- !defined(__LONG_DOUBLE_IBM128__) && \
- (defined(__GNUC__) || defined(__GNUG__))
+#ifdef HAS_LOGF128
+#if (__LDBL_MANT_DIG__ == 113) && !defined(__LONG_DOUBLE_IBM128__) && \
----------------
efriedma-quic wrote:
(I was suggesting __LDBL_MANT_DIG__ with the old version that explicitly wrote out the type "long double". It should be safe to assume that if logf128 returns a long double, then long double is actually an IEEE 128-bit float.)
https://github.com/llvm/llvm-project/pull/96287
More information about the llvm-commits
mailing list