VCPOP.M

Vector Mask Population Count

VCPOP.M rd, vs2, vm

Counts set bits in the source mask register.

Details

Counts the number of set bits in mask register vs2 that are active (within vl), writing the count to scalar rd.

Pseudocode Operation

rd = count_set_bits(vs2 & vm);

Example

VCPOP.M t0, v4, v0.t

Encoding

Binary Layout
010000
31:26
vm
25
vs2
24:20
10000010
19:12
rd
11:7
1010111
6:0
 
Format OPMVX
Opcode 0x40082057
Extension V

Operands

  • rd
    Dest (Scalar)
  • vs2
    Src Mask