vinsertd
Vector Insert Doubleword
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
Encoding
Operands
-
vD
Target Vector -
vB
Source GPR -
UIM
Index