xxmrghw
VSX Vector Merge High Word
Merges the high words of two VSX registers into a target VSX register.
Details
Merges the high-order words (words 0 and 1) from VSX registers XA and XB into XT, interleaving them as: XT[0:31] ← XA[0:31], XT[32:63] ← XB[0:31], XT[64:95] ← XA[32:63], XT[96:127] ← XB[32:63]. This is a VSX instruction with no condition register or status flag updates.
Pseudocode Operation
XT[0:31] ← XA[0:31]
XT[32:63] ← XB[0:31]
XT[64:95] ← XA[32:63]
XT[96:127] ← XB[32:63]
Programming Note
The xxmrghw instruction is commonly used to merge high words from two vector registers into a third register. Ensure that the VSX (Vector Scalar Extensions) are enabled in the MSR register; otherwise, a VSX_Unavailable exception will be raised. This instruction operates on 128-bit vectors and requires proper alignment of the input registers for optimal performance.
Example
Encoding
Operands
-
XT
Target -
XA
Src A -
XB
Src B