[llvm] Enable logf128 constant folding for hosts with 128bit long double (PR #104929)
Matthew Devereau via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 29 06:26:58 PDT 2024
================
@@ -271,6 +260,13 @@ if(C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unguarded-availability-new")
endif()
+check_cxx_symbol_exists(logf128 cmath HAS_LOGF128)
+check_symbol_exists(__powerpc64le__ "" __PPC64LE)
+if(HAS_LOGF128 AND NOT __PPC64LE)
+ set(LLVM_HAS_LOGF128 On)
+ add_compile_definitions(HAS_LOGF128)
----------------
MDevereau wrote:
This was meant to always be enabled if available, and thus cmake would do a test and define the cmake variable LLVM_HAS_LOGF128 if the test passed. This patch has been reverted now, but what is likely to happen is this behaviour will be enabled by default, but be eligible to opt-out via a cmake definition which will have an entry in `llvm/Config/config.h.cmake`
https://github.com/llvm/llvm-project/pull/104929
More information about the llvm-commits
mailing list