Daniel Lemire personal blog
The surprising cleverness of modern compilers
I wanted to know how a modern C compiler like clang would process the following C code: #include <stdint.h> int count(uint64_t x) { int v = 0; while(x != 0) { x &= x - 1; v++; } return v; } Can you guess? popcntq %rdi, %rax That is right. A fairly sophisticated C function, … Continue reading The surprising cleverness…
- Points
- 144
- HN comments
- 83
- Submissions
- 1
- Cited by
- 4 commenters
Systems & PerformanceSoftware Engineering2016
On Hacker News
| Submitted | Title on HN | Points | Comments |
|---|---|---|---|
| May 24, 2016 | The surprising cleverness of modern compilers by kiyanwang | 144 | 83 |
Cited in comments
Linked from 4 Hacker News comments by 4 different people, from Jul 2016 to Jan 2025.
Most recent: