xxmrghw

VSX Vector Merge High Word

xxmrghw XT, XA, XB

Merges the high words of two VSX registers into a target VSX register.

Details

The xxmrghw instruction merges the high words of VSR[XA] and VSR[XB] into VSR[XT]. The contents of word element 0 of VSR[XA] are placed into word element 0 of VSR[XT], the contents of word element 0 of VSR[XB] are placed into word element 1 of VSR[XT], the contents of word element 1 of VSR[XA] are placed into word element 2 of VSR[XT], and the contents of word element 1 of VSR[XB] are placed into word element 3 of VSR[XT].

Pseudocode Operation

if MSR.VSX=0 then VSX_Unavailable()
XT <- (XA).word[0] || (XB).word[0] || (XA).word[1] || (XB).word[1]

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 0xF0000012
Extension VSX
Registers Altered MSR

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B