xxmrghw

VSX Vector Merge High Word

xxmrghw XT, XA, XB

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

xxmrghw vs1, vs2, vs3

Encoding

Binary Layout
18
0
T
6
A
11
B
16
AX
21
BX
29
TX
30
 
Format XX3-form
Opcode 0xF0000090
Extension VSX
Registers Altered MSR

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B