https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128459
Bug ID: 128459
Summary: Add support for __builtin_bitcompressg and
__builtin_bitexpandg
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
https://wg21.link/P3104R6 added std::bit_compress and std::bit_expand function
templates and I've implemented it purely in software using Hacker's delight
algorithms.
Some CPUs implement these in hardware though, e.g. x86 with BMI2 pext/pdep,
SVE2 has bext/bdep, RISCV vcompress/viota/vrgather?, etc.
We should add type-generic builtins for these operations similarly to how we
have them now for carry-less product.