Landing: c564a8be8a15
Project / Subsystem
gcc / gcc
Date
2026-05-15
Author
Jakub Jelinek
Commit
c564a8be8a15389e8a5119e51d5929f0689044be
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc
- patch_id
- —
- commit_hash
- c564a8be8a15389e8a5119e51d5929f0689044be
- source_type
- github
- headline
- Adds __builtin_bitreverse{8,16,32,64} builtins.
- tldr
- GCC now provides built-in functions for bit reversal of 8, 16, 32, and 64-bit integers, potentially optimized for specific targets.
- author
- Jakub Jelinek
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • builtins
- • bit manipulation
- • optimization
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-05-15T00:00:00.000Z
GCC now includes __builtin_bitreverse{8,16,32,64} built-in functions for reversing the order of bits in integer types. These builtins will be optimized for specific targets, such as ARM (RBIT instruction) and x86 with GFNI (vgf2p8affineqb instruction) in future work. The patch adds the builtins, handles constant folding, and adds documentation and test cases.