Skip to content

gnu.cfg: __builtin_bitreverse - #8882

Draft
aadanen wants to merge 1 commit into
cppcheck-opensource:mainfrom
aadanen:bitreverse
Draft

aadanen wants to merge 1 commit into
cppcheck-opensource:mainfrom
aadanen:bitreverse

Conversation

@aadanen

@aadanen aadanen commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

It looks like gcc17 will add __builtin_bitreverse when it releases. This implementation mirrors the bswap implementation.

https://gcc.gnu.org/onlinedocs/gcc/Byte-Swapping-Builtins.html

Unfortunately, both __builtin_bitreverse64 and __builtin_bswap64 both don't work quite right because of #14154. ALso, bswap uses the "ul*" suffixes for its hex literals but I think those have no impact and the values are always stored as "bigint" (long long, unless we are able to use a 128 bit integer).

fix and tests

fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant