VFIRST.M

Vector Find First Set Mask Bit

VFIRST.M rd, vs2, vm

Finds the index of the first set bit in the mask.

Details

Finds the index of the lowest-numbered active set bit in mask register vs2, writing the index to rd. Returns −1 if no bit is set.

Pseudocode Operation

rd = find_first_set(vs2 & vm);

Example

VFIRST.M t0, v4, v0.t

Encoding

Binary Layout
010000
31:26
vm
25
vs2
24:20
10001
19:15
010
14:12
rd
11:7
1010111
6:0
 
Format OPMVX
Opcode 0x57
Extension V

Operands

  • rd
    Dest (Index)
  • vs2
    Src Mask