popcntb
Population Count Bytes
popcntb RA,RS
Counts the number of one bits in each byte of a register.
Details
A count of the number of one bits in each byte of register RS is placed into the corresponding byte of register RA. This number ranges from 0 to 8, inclusive.
Pseudocode Operation
for i = 0 to 7
n ← 0
for j = 0 to 7
if (RS)(i×8)+j = 1 then
n ← n+1
RA(i×8):(i×8)+7 ← n
Programming Note
None
Example
popcntb r4, r3
Encoding
Binary Layout
0
0
RS
6
RA
11
6
16
11
21
16
31
21
31
Operands
-
RA
Target General Purpose Register -
RS
Source General Purpose Register