[libc-commits] [libc] [libc][FPUtil] Make hardware helpers usable in constant expressions (PR #242283)
Muhammad Bassiouni via libc-commits
libc-commits at lists.llvm.org
Sat Nov 14 10:22:52 PST 2026
================
@@ -89,6 +70,59 @@ LIBC_INLINE constexpr double nearest_integer(double x) {
return x;
}
+} // namespace generic
+} // namespace fputil
+} // namespace LIBC_NAMESPACE_DECL
+
+// The target specific headers below define fputil::nearest_integer using the
+// rounding instructions of the target, and dispatch to generic::nearest_integer
+// during constant evaluation.
+#if (defined(LIBC_TARGET_ARCH_IS_X86_64) && \
+ defined(LIBC_TARGET_CPU_HAS_SSE4_2)) && \
+ !defined(LIBC_USE_CONSTEXPR)
----------------
bassiounix wrote:
Same for `LIBC_USE_CONSTEXPR`
https://github.com/llvm/llvm-project/pull/242283
More information about the libc-commits
mailing list