Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
castratikron
on Sept 9, 2019
|
parent
|
context
|
favorite
| on:
Popcount CPU instruction
The GNU __builtin_popcount takes an unsigned int.
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
jayd16
on Sept 9, 2019
[–]
Right. If he naively casts, it will cast to 2^(int bits size) and return 1 but that's wrong. Its not a complete solution.
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html