Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
pbsd
17 days ago
|
parent
|
context
|
favorite
| on:
You can't fool the optimizer
Because the function is not quite correct. It should be
return n ? (1u + popcount(n & n - 1u)) : 0u;
which both Clang and GCC promptly optimize to a single popcnt.
1718627440
16 days ago
[–]
There should be testsuites, which are based on testing which compilation passes the compiler chose.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: