cnt
CNT <Wd>, <Wn>
Population Count (Scalar)
Pseudocode Operation
No pseudocode available.
Encoding
Binary Layout
0
31
1
30
0
29
11010110
28:21
00000
20:16
000111
15:10
Rn
9:5
Rd
4:0
Related
Other forms of cnt
- cnt Vector Population Count
Across architectures
Population Count : how x86, ARM, RISC-V, and PowerISA each do this.
More in CSSC
Reference
View in Arm A64 ISA Reference ↗
Arm A64 ISA
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x5AC01C00 | CNT <Wd>, <Wn> | A64 | 0 | 1 | 0 | 11010110 | 00000 | 000111 | Rn | Rd | ||
| 0xDAC01C00 | CNT <Xd>, <Xn> | A64 | 1 | 1 | 0 | 11010110 | 00000 | 000111 | Rn | Rd | ||
| 0x0E205800 | CNT <Vd>.<T>, <Vn>.<T> | A64 | 0 | Q | 0 | 01110 | size | 10000 | 00101 | 10 | Rn | Rd | ||
| 0x041AA000 | CNT <Zd>.<T>, <Pg>/M, <Zn>.<T> | A64 | 00000100 | size | 011 | 01 | 0 | 101 | Pg | Zn | Zd |
Description
Count bits counts the number of binary one bits in the value of the source register, and writes the result to the destination register.
Operation
bits(datasize) operand1 = X[n, datasize]; integer result = BitCount(operand1); X[d, datasize] = result<datasize-1:0>;