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

SubmittedTitle on HNPointsComments
Sep 9, 2019Popcount CPU instruction by mmastrac350162
Jun 11, 2021The NSA Instruction (2019) by cjg24486
Aug 13, 2023Popcount CPU instruction (2019) by softwaredoug23099

Cited in comments

Linked from 14 Hacker News comments by 13 different people, from Jul 2020 to Oct 2025.

Most recent:

Search every comment that links here →

More from Vaibhav Sagar

All 4 posts →

Related posts from the same era