VMERGE.VIM

Vector Merge Immediate

VMERGE.VIM vd, vs2, imm, v0

Merges immediate 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] ? imm : vs2[i];

Example

VMERGE.VIM v1, v4, 16, v0

Encoding

Binary Layout
010111
31:26
0
25
vs2
24:20
imm
011
19:17
vd
16:12
1010111
11:5
 
Format OPIVI
Opcode 0x57
Extension V

Operands

  • vd
    Destination vector register
  • vs2
    False
  • imm
    True (Imm)