Path: blob/main/files/en-us/webassembly/reference/numeric/population_count/index.md
6516 views
------{{WebAssemblySidebar}}
The popcnt instructions, short for population count, are used to count the amount of 1s in a numbers binary representation.
{{EmbedInteractiveExample("pages/wat/popcnt.html", "tabbed-taller")}}
Syntax
| Instruction | Binary opcode |
|---|---|
i32.popcnt | 0x69 |
i64.popcnt | 0x7b |