[libc-commits] [libc] [libc] Fix missing LIBC_TYPES_HAS_FLOAT16 guard around DyadicFloat::generic_as() (PR #109697)

via libc-commits libc-commits at lists.llvm.org
Mon Sep 23 10:57:06 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: OverMighty (overmighty)

<details>
<summary>Changes</summary>

See Buildbot failure: https://lab.llvm.org/buildbot/#/builders/93/builds/6872.

---
Full diff: https://github.com/llvm/llvm-project/pull/109697.diff


1 Files Affected:

- (modified) libc/src/__support/FPUtil/dyadic_float.h (+2) 


``````````diff
diff --git a/libc/src/__support/FPUtil/dyadic_float.h b/libc/src/__support/FPUtil/dyadic_float.h
index f2de70f344607a..165ffc7c922025 100644
--- a/libc/src/__support/FPUtil/dyadic_float.h
+++ b/libc/src/__support/FPUtil/dyadic_float.h
@@ -101,6 +101,7 @@ template <size_t Bits> struct DyadicFloat {
     return exponent + (Bits - 1);
   }
 
+#ifdef LIBC_TYPES_HAS_FLOAT16
   template <typename T, bool ShouldSignalExceptions>
   LIBC_INLINE constexpr cpp::enable_if_t<
       cpp::is_floating_point_v<T> && (FPBits<T>::FRACTION_LEN < Bits), T>
@@ -207,6 +208,7 @@ template <size_t Bits> struct DyadicFloat {
 
     return FPBits(result).get_val();
   }
+#endif // LIBC_TYPES_HAS_FLOAT16
 
   template <typename T, bool ShouldSignalExceptions,
             typename = cpp::enable_if_t<cpp::is_floating_point_v<T> &&

``````````

</details>


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


More information about the libc-commits mailing list