Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2025

Conversation

overmighty
Copy link
Member

No description provided.

@overmighty overmighty requested a review from lntue May 14, 2025 13:32
@llvmbot llvmbot added the libc label May 14, 2025
@llvmbot
Copy link
Member

llvmbot commented May 14, 2025

@llvm/pr-subscribers-libc

Author: OverMighty (overmighty)

Changes

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

@overmighty overmighty merged commit 6a125af into llvm:main May 14, 2025
18 checks passed
@overmighty overmighty deleted the libc-fix-dyadicfloat-generic_as branch May 14, 2025 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants