[Bug target/122014] (AArch64) Optimize 8-bit and 16-bit popcount as special cases
Explorer09 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Sep 21 08:44:14 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122014
--- Comment #3 from Kang-Che Sung <Explorer09 at gmail dot com> ---
Acknowledge the popcount_8_bp and popcount_16_bp case.
The point is to recognize the don't-care so that gcc won't need to mask the
upper bits in order to constrain the values to `uint8_t` or `uint16_t`.
Also, because the ADDV instruction adds the values of *all* lanes in a vector,
for the 16-bit case, it would be better to use UADDLP instead as UADDLP would
effectively make the upper bit ignored after extracting the sum of lane 0.
More information about the Gcc-bugs
mailing list