Skip to content

Conversation

@lntue
Copy link
Contributor

@lntue lntue commented Oct 16, 2025

Fix #163711.

@llvmbot
Copy link
Member

llvmbot commented Oct 16, 2025

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

Fix #163711.


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

1 Files Affected:

  • (modified) libc/src/__support/FPUtil/double_double.h (+3-3)
diff --git a/libc/src/__support/FPUtil/double_double.h b/libc/src/__support/FPUtil/double_double.h
index 8e54e845de493..9affced3d2cee 100644
--- a/libc/src/__support/FPUtil/double_double.h
+++ b/libc/src/__support/FPUtil/double_double.h
@@ -77,9 +77,9 @@ LIBC_INLINE constexpr NumberPair<T> split(T a) {
   NumberPair<T> r{0.0, 0.0};
   // CN = 2^N.
   constexpr T CN = static_cast<T>(1 << N);
-  constexpr T C = CN + 1.0;
-  double t1 = C * a;
-  double t2 = a - t1;
+  constexpr T C = CN + T(1);
+  T t1 = C * a;
+  T t2 = a - t1;
   r.hi = t1 + t2;
   r.lo = a - r.hi;
   return r;

Copy link
Member

@petrhosek petrhosek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

@lntue lntue merged commit e6afe2a into llvm:main Oct 16, 2025
22 checks passed
@lntue lntue deleted the double_double branch October 16, 2025 16:56
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.

[libc] Enabling LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT breaks the 32-bit baremetal build

4 participants