VCPOP.V
Vector Population Count
VCPOP.V vd, vs2, vm
Counts the number of set bits (1s) in each element.
Details
Counts the number of set bits in mask register vs2 that are active (within vl), writing the count to scalar rd.
Pseudocode Operation
foreach(i < vl): vd[i] = count_set_bits(vs2[i]);
Example
VCPOP.V v1, v4, v0.t
Encoding
Binary Layout
010010
31:26
vm
25
vs2
24:20
01110
19:15
010
14:12
vd
11:7
1010111
6:0
Operands
-
vd
Destination vector register -
vs2
Source vector register 2