[libc-commits] [libc] [libc] Initial support so that libc-shared-tests can be built with pp64le (PR #188882)

via libc-commits libc-commits at lists.llvm.org
Thu Mar 26 21:07:01 PDT 2026


================
@@ -76,8 +79,10 @@ LIBC_INLINE static constexpr cpp::enable_if_t<
 sqrt(InType x) {
   if constexpr (internal::SpecialLongDouble<OutType>::VALUE &&
                 internal::SpecialLongDouble<InType>::VALUE) {
+#ifdef LIBC_TYPES_LONG_DOUBLE_IS_X86_FLOAT80
----------------
lntue wrote:

The difference is that for `if constexpr`, if it's true, the `else` branch will be discarded, outside of the `else` branch is still kept for codegen, even though it might get dead-code elimination.  And if the code there is not valid for compilation in the `if constexpr` condition, it will fail.  Here is an example demonstrating that:

https://godbolt.org/z/veYxn898x

https://github.com/llvm/llvm-project/pull/188882


More information about the libc-commits mailing list