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

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


Author: OverMighty
Date: 2025-05-14T15:59:24+02:00
New Revision: 6a125afdd586411e02f85f6cf078acbd855a2724

URL: https://github.com/llvm/llvm-project/commit/6a125afdd586411e02f85f6cf078acbd855a2724
DIFF: https://github.com/llvm/llvm-project/commit/6a125afdd586411e02f85f6cf078acbd855a2724.diff

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

Added: 
    

Modified: 
    libc/src/__support/FPUtil/dyadic_float.h

Removed: 
    


################################################################################
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;


        


More information about the libc-commits mailing list