vinsertd

Vector Insert Doubleword

vinsertd vD, vB, UIM

Inserts a doubleword from a GPR into a vector.

Details

Inserts the contents of general-purpose register vB into vD at the doubleword position specified by UIM, leaving the other doubleword element of vD unchanged. The doubleword index (0–1) is provided by the 1-bit immediate UIM. No status flags are affected. This instruction is part of the VMX (AltiVec) extension.

Pseudocode Operation

index ← UIM[0:1]
vD[index*64 : index*64+63] ← vB[0:63]

Programming Note

The vinsertd instruction is used to insert a doubleword from one vector register into another, with specific byte alignment. Ensure that the UIM value does not exceed 8 to avoid undefined behavior. This instruction requires the VEC bit in the MSR (Machine State Register) to be set; otherwise, it will raise an exception.

Example

vinsertd vd, vb, uim

Encoding

Binary Layout
4
0
vD
6
UIM
11
vB
16
973
21
 
Format VX-form
Opcode 0x100003CD
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vD
    Target Vector
  • vB
    Source GPR
  • UIM
    Index