Vaibhav Sagar personal blog
Popcount CPU instruction
Most CPU architectures in use today have an instruction called popcount , short for “population count”. Here’s what it does: it counts the number of set bits in a machine word. For example (assuming 8-bit words for simplicity), popcount(00100110) is 3 and popcount(01100000) is 2 .
- Points
- 350
- HN comments
- 347
- Submissions
- 3
- Cited by
- 13 commenters
Systems & PerformanceSoftware Engineering2019
On Hacker News
| Submitted | Title on HN | Points | Comments |
|---|---|---|---|
| Sep 9, 2019 | Popcount CPU instruction by mmastrac | 350 | 162 |
| Jun 11, 2021 | The NSA Instruction (2019) by cjg | 244 | 86 |
| Aug 13, 2023 | Popcount CPU instruction (2019) by softwaredoug | 230 | 99 |
Cited in comments
Linked from 14 Hacker News comments by 13 different people, from Jul 2020 to Oct 2025.
Most recent: