Where is the result written?
It is written to scalar integer register rd. VCPOP.M writes a count; VFIRST.M writes the first set element index or -1.
Find lowest-indexed set bit in vs2 mask, writing index to scalar rd (-1 if none).
VFIRST.M finds the lowest-numbered active set bit in mask source vs2 and writes that element index to integer register rd; if none is found, it writes -1.
VFIRST.M is an RVV mask-to-scalar instruction: the result is written to integer register rd, not a vector register.
Understand this scenario with real code like «vsetvli t0, a0, e32, m1, ta, ma vmseq.vv v0, v8, v9 vfirst.m a0, v0».
Understand this scenario with real code like «vsetvli t0, a0, e32, m1, ta, ma vmseq.vv v0, v8, v9 vfirst.m a0, v0».
It is written to scalar integer register rd. VCPOP.M writes a count; VFIRST.M writes the first set element index or -1.