[libc-commits] [libc] Fixed Hypotbf16 build failure (PR #186415)

via libc-commits libc-commits at lists.llvm.org
Fri Mar 13 08:26:36 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Zorojuro (Sukumarsawant)

<details>
<summary>Changes</summary>

added static_cast 

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


1 Files Affected:

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


``````````diff
diff --git a/libc/src/__support/FPUtil/Hypot.h b/libc/src/__support/FPUtil/Hypot.h
index e23f8b52d8220..699d1cab7ba1c 100644
--- a/libc/src/__support/FPUtil/Hypot.h
+++ b/libc/src/__support/FPUtil/Hypot.h
@@ -219,7 +219,7 @@ LIBC_INLINE T hypot(T x, T y) {
   for (StorageType current_bit = leading_one >> 1; current_bit;
        current_bit >>= 1) {
     r = static_cast<StorageType>((r << 1)) +
-        ((tail_bits & current_bit) ? 1 : 0);
+        static_cast<StorageType>((tail_bits & current_bit) ? 1 : 0);
     StorageType tmp = static_cast<StorageType>((y_new << 1)) +
                       current_bit; // 2*y_new(n - 1) + 2^(-n)
     if (r >= tmp) {

``````````

</details>


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


More information about the libc-commits mailing list