[libc-commits] [libc] [libc] Fix DyadicFloat::generic_as() using FPBits<float16> not FPBits<T> (PR #139899)

via libc-commits libc-commits at lists.llvm.org
Wed May 14 06:33:26 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: OverMighty (overmighty)

<details>
<summary>Changes</summary>



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


1 Files Affected:

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


``````````diff
diff --git a/libc/src/__support/FPUtil/dyadic_float.h b/libc/src/__support/FPUtil/dyadic_float.h
index f18ace7419940..6c3e1520e5aff 100644
--- a/libc/src/__support/FPUtil/dyadic_float.h
+++ b/libc/src/__support/FPUtil/dyadic_float.h
@@ -175,7 +175,7 @@ template <size_t Bits> struct DyadicFloat {
   LIBC_INLINE constexpr cpp::enable_if_t<
       cpp::is_floating_point_v<T> && (FPBits<T>::FRACTION_LEN < Bits), T>
   generic_as() const {
-    using FPBits = FPBits<float16>;
+    using FPBits = FPBits<T>;
     using StorageType = typename FPBits::StorageType;
 
     constexpr int EXTRA_FRACTION_LEN = Bits - 1 - FPBits::FRACTION_LEN;

``````````

</details>


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


More information about the libc-commits mailing list