VMERGE.VXM

Vector Merge Scalar

VMERGE.VXM vd, vs2, rs1, v0

Merges integer scalar vs vector based on mask.

Details

Merges elements from vs1 and vs2 (or an immediate) according to the mask: masked-on elements come from vs1, masked-off from vs2.

Pseudocode Operation

vd[i] = v0[i] ? rs1 : vs2[i];

Example

VMERGE.VXM v1, v4, a0, v0

Encoding

Binary Layout
010111
31:26
0
25
vs2
24:20
rs1
19:15
100
14:12
vd
11:7
1010111
6:0
 
Format OPIVX
Opcode 0x57
Extension V

Operands

  • vd
    Destination vector register
  • vs2
    False
  • rs1
    True (Scalar)