How does VID.V handle masking?
With vm=0, v0 selects active elements; with vm=1, all body elements participate. Inactive and tail elements follow the current policies.
Write each active element index i to destination integer vector vd.
VID.V is a RISC-V V element-index generation instruction. For each active element i, it writes the unsigned index value i to vd, starting at 0 and bounded by the current vl.
VID.V generates element numbers; it does not read memory or an ordinary source vector.
Understand this scenario with real code like «vsetvli t0, a0, e32, m1, ta, ma vid.v v1 # v1[i] = i».
Understand this scenario with real code like «vsetvli t0, a0, e32, m1, ta, ma vid.v v1 # v1[i] = i».
Understand this scenario with real code like «vsetvli t0, a0, e32, m1, ta, ma vid.v v1 # v1[i] = i».
With vm=0, v0 selects active elements; with vm=1, all body elements participate. Inactive and tail elements follow the current policies.