[libc-commits] [libc] [libc][support][UInt] implement 128b math helpers (PR #86531)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Mon Mar 25 10:42:03 PDT 2024


================
@@ -242,6 +242,14 @@ LIBC_INLINE constexpr To bit_or_static_cast(const From &from) {
 /// Count number of 1's aka population count or Hamming weight.
 ///
 /// Only unsigned integral types are allowed.
+// clang-19+, gcc-14+
+#if __has_builtin(__builtin_popcountg)
----------------
nickdesaulniers wrote:

gcc-10+ supports `__has_builtin`. While wrapping the use of `__has_builtin` used to be necessary to support older compilers, this is no longer necessary since we only support gcc-12+ . https://libc.llvm.org/compiler_support.html I'll leave this out, and file a bug about removing it.

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


More information about the libc-commits mailing list