Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libcxx] Use generic builtins for popcount, clz and ctz (#86563)
Fixes #86556 Use `__builtin_popcountg` instead of `__buildin_popcount{l|ll}` Use `__builtin_clzg instead` of `__buildin_clz{l|ll}` Use `__builtin_ctzg instead` of `__builtin_ctz{l|ll}` The generic variant of the builtins can be used to simplify some logic with >= Clang 19 or >= GCC 14, where these generic variants are available. As for backwards compatibility reasons, we can't completely remove the old logic. Therefore, I left ToDo comments to address this, as soon as support for pre Clang 19 as well as pre GCC 14 is dropped. --------- Co-authored-by: Nick Desaulniers <nickdesaulniers@users.noreply.github.com>
- Loading branch information
1 parent
496de32
commit a6db20f
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters