xxinsertw
VSX Vector Insert Word
xxinsertw XT, RB, UIM
Inserts a 32-bit word from a GPR into a specific element of a VSR.
Details
The xxinsertw instruction inserts the word element from VSR[XB] into the specified byte elements of VSR[XT]. The remaining byte elements in VSR[XT] are not modified. If UIM is greater than 12, the results are undefined.
Pseudocode Operation
if MSR.VSX=0 then VSX_Unavailable()
Let XT be the value 32×TX + T.
Let XB be the value 32×BX + B.
VSR[XT].byte[UIM:UIM+3] ← VSR[XB].bit[32:63]
The contents of word element 1 of VSR[XB] are placed into byte elements UIM:UIM+3 of VSR[XT]. The contents of the remaining byte elements of VSR[XT] are not modified.
If the value of UIM is greater than 12, the results are undefined.
Programming Note
The xxinsertw instruction is used to insert a word from one vector register into another at a specified byte offset. Ensure that the UIM (Upper Immediate) field does not exceed 12 to avoid undefined behavior. This instruction requires VSX (Vector Scalar Extensions) to be enabled in the MSR.VSX bit; otherwise, it will raise an exception.
Example
xxinsertw vs1, r5, uim
Encoding
Binary Layout
60
0
XT
6
UIM
11
RB
16
181
21
Operands
-
XT
Target VSR -
RB
Source GPR -
UIM
Element Index