From nobody Fri May 29 23:04:36 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gRzT05XWpz6gFtJ for ; Fri, 29 May 2026 23:04:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gRzT02hwsz3HPV for ; Fri, 29 May 2026 23:04:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780095876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rG7y7z066mqZMqgAbNjlh3Vn+abqCYTEZ67uIJUjR48=; b=AmQ6TbLg7mToPCeQUuTmH6aFEAhiKJgClLrvT3i8nfo5IdWNiFeWhMKENV/bOLfwZBhYGc OFbWNvji/RIHDJhJRimuNYZkrf1wicV8L7e6cGEpKuILcNee18pfmBJ023T256KhHmPyPx B/P4jV7mPwsN3tEg2ijsWDe7E4rZEpivW0jsntVKlidGK3dekNBn49dTF3lxlQ5bici5xl 5rxn4ENHnfx6GYSJ0MMlJBnvVQQS4JA9wUsdQtVMAJsW0AfgbfT2GnvqmVTBZzaW330UCR lFoVaSfOcNi5jvpPr62zyy2rlFXh314H8vZxmPvzpvWgon6jkQvDRI2URLwegA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780095876; a=rsa-sha256; cv=none; b=kgn6HV21EEQ2/nzZhrssS5XtCbD0b7ZYgv8dGmkNU9ytkX53HEz/NavM0ZwHC8HYbKpHM0 H8S0YB47rX0z4E24S6TRV+y4VMArkVyH4tZUedO2SLFUqKOHMKXzY2NDuAZqmnWz1tm+N6 I29LbN3xpfuQ5Nm9zj9qBqTjXVwBc5sg8SjwbWP8UvIwIf1iinMYLPtBZSSzXjRcwYMZel Dk/bNi5R/jjan+Tewisckt5iBygId2zRynbHWF8jaxktolM9kepzMLNRs2wJW6CvmpuxpL rLyNMUZQ/lIctjGYBRXOF6IzuG/JxJ2uxI0RVwI3o3fxc82gw/L2PAfJx2dkyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780095876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rG7y7z066mqZMqgAbNjlh3Vn+abqCYTEZ67uIJUjR48=; b=uEGamTIOZv358d2Lw0hyr7zzzDHvf8IoHWe6QMSn6ro6s9J8MlSHyJg8Ys/g9fYLLcRnZo YsONO+4pwQpd7puOHodMlWgyEW+YNUYrqwcrqJ5W9UwYn+V/v+tTgdWrBuk9wl/UTgENEc 3GWFUnMEArK/xlBzVKCunOdDkDMKZFa4E/TbhaUtGk0bArTiDULXfCEqs+M8tPdpmem24R gD2NYCmf8zOUEeuqlxlylfuwCSpguDq6OYDcB6tu+KuAL09LDtWacrQaZygeLcxPqoadoq AwXqiPaiMUwfG38WQ4jRpA+q3Dytp/L8g8fJRvemyVw8LYch0bTOcUGIdiXubQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gRzT02FgWztjH for ; Fri, 29 May 2026 23:04:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40ce7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 29 May 2026 23:04:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Dimitry Andric From: Dimitry Andric Subject: git: b3d1c922b095 - stable/14 - libcxx-compat: revert llvmorg-21-init-8400-g703cfe745b96: List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b3d1c922b095e16898f4209bdc596c917ec9271d Auto-Submitted: auto-generated Date: Fri, 29 May 2026 23:04:36 +0000 Message-Id: <6a1a1b84.40ce7.8a27803@gitrepo.freebsd.org> The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=b3d1c922b095e16898f4209bdc596c917ec9271d commit b3d1c922b095e16898f4209bdc596c917ec9271d Author: Dimitry Andric AuthorDate: 2026-01-05 20:14:13 +0000 Commit: Dimitry Andric CommitDate: 2026-05-29 22:59:36 +0000 libcxx-compat: revert llvmorg-21-init-8400-g703cfe745b96: [libc++] Replace __libcpp_popcount by __builtin_popcountg (#133937) `__libcpp_popcount` was previously used as a fallback for `__builtin_popcountg` to ensure compatibility with older compilers (Clang 18 and earlier), as `__builtin_popcountg` became available in Clang 19. Now that support for Clang 18 has been officially dropped in #130142, we can now safely replace all instances of `__libcpp_popcount` with `__builtin_popcountg` and eliminate the fallback logic. This is part of making libc++ 21 build with clang 18. PR: 292067 MFC after: 1 month (cherry picked from commit 5465db314a03c11b15e00f22be1609027dfc152c) --- .../llvm-project/libcxx/include/__bit/popcount.h | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/contrib/llvm-project/libcxx/include/__bit/popcount.h b/contrib/llvm-project/libcxx/include/__bit/popcount.h index 8d9ba0993848..451b85182e9b 100644 --- a/contrib/llvm-project/libcxx/include/__bit/popcount.h +++ b/contrib/llvm-project/libcxx/include/__bit/popcount.h @@ -11,6 +11,7 @@ #include <__config> #include <__type_traits/integer_traits.h> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -21,10 +22,38 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD +template +[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __popcount_impl(_Tp __t) _NOEXCEPT { + if _LIBCPP_CONSTEXPR (sizeof(_Tp) <= sizeof(unsigned int)) { + return __builtin_popcount(static_cast(__t)); + } else if _LIBCPP_CONSTEXPR (sizeof(_Tp) <= sizeof(unsigned long)) { + return __builtin_popcountl(static_cast(__t)); + } else if _LIBCPP_CONSTEXPR (sizeof(_Tp) <= sizeof(unsigned long long)) { + return __builtin_popcountll(static_cast(__t)); + } else { +#if _LIBCPP_STD_VER == 11 + return __t != 0 ? __builtin_popcountll(static_cast(__t)) + + std::__popcount_impl<_Tp>(__t >> numeric_limits::digits) + : 0; +#else + int __ret = 0; + while (__t != 0) { + __ret += __builtin_popcountll(static_cast(__t)); + __t >>= std::numeric_limits::digits; + } + return __ret; +#endif + } +} + template [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __popcount(_Tp __t) _NOEXCEPT { static_assert(__is_unsigned_integer_v<_Tp>, "__popcount only works with unsigned types"); +#if __has_builtin(__builtin_popcountg) // TODO (LLVM 21): This can be dropped once we only support Clang >= 19. return __builtin_popcountg(__t); +#else + return std::__popcount_impl(__t); +#endif } #if _LIBCPP_STD_VER >= 20