vpopcntb
Vector Population Count Byte
vpopcntb vD, vB
Counts the number of bits set to 1 in each byte of a vector register.
Details
For vpopcntb, the number of bits set to 1 in each byte element of VSR[VRB+32] is counted and placed into the corresponding byte element of VSR[VRT+32].
Pseudocode Operation
Programming Note
This instruction is used to count the number of set bits (1s) in each byte of a vector register. Ensure that the Vector Facility is enabled by checking and setting the VEC bit in the MSR register. The operation processes 16 bytes, and the result is stored in another vector register. This instruction is available at user privilege level.
Example
vpopcntb vd, vb
Encoding
Binary Layout
4
0
vD
6
0
11
vB
16
1795
Operands
-
vD
Target -
vB
Source -
VRT
Target Vector Register -
VRB
Source Vector Register