vinsertd

Vector Insert Doubleword

vinsertd vD, vB, UIM

Inserts a doubleword from a GPR into a vector.

Encoding

Binary Layout
4
0:5
vD
6:10
UIM
11:15
vB
16:20
973
21:31
 
Format VX-form
Opcode 0x100003CD
Extension VMX (AltiVec)

Operands

  • vD
    Target Vector
  • vB
    Source GPR
  • UIM
    Index

Example

vinsertd vd, vb, uim

Registers Altered

MSR

Related

More in VMX (AltiVec)

Reference

Description

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.

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.