vinserth
Vector Insert Halfword
Inserts a halfword from a GPR into a vector.
Details
Inserts the low-order 16 bits of general-purpose register vB into vD at the halfword position specified by UIM, leaving other halfword elements of vD unchanged. The halfword index (0–7) is provided by the 3-bit immediate UIM. No status flags are affected. This instruction is part of the VMX (AltiVec) extension.
Pseudocode Operation
index ← UIM[1:3]
vD[index*16 : index*16+15] ← vB[48:63]
Programming Note
The vinserth instruction is used to insert a halfword from one vector register into another at a specified index. Ensure that the Vector Facility (MSR.VEC) is enabled; otherwise, a Vector_Unavailable exception will be raised. The destination vector's remaining byte elements remain unchanged after the insertion.
Example
Encoding
Operands
-
vD
Target Vector -
vB
Source GPR -
UIM
Index