VRGATHER.VV

Vector Register Gather

VRGATHER.VV vd, vs2, vs1, vm

Gathers elements from a vector register using indices from another vector register.

Details

Gathers elements from vs2 using indices in vs1 (or an immediate), writing to vd. Out-of-range indices produce zero.

Pseudocode Operation

foreach(i < vl): vd[i] = (vs1[i] >= vlmax) ? 0 : vs2[vs1[i]];

Example

VRGATHER.VV v1, v4, v2, v0.t

Encoding

Binary Layout
001100
31:26
vm
25
vs2
24:20
vs1
19:15
000
14:12
vd
11:7
1010111
6:0
 
Format OPIVV
Opcode 0x57
Extension V

Operands

  • vd
    Destination vector register
  • vs2
    Source Table
  • vs1
    Indices