xxmrghd

VSX Vector Merge High Doubleword

xxmrghd XT, XA, XB

Merges high doublewords from XA and XB.

Details

The VSX Vector Merge High Doubleword instruction (xxmrghd) merges the high doubleword from two source vector registers into a target vector register. If DM.bit[0]=0, the contents of doubleword element 1 of VSR[XA] are placed into doubleword element 0 of VSR[XT]. Otherwise, the contents of doubleword element 1 of VSR[XB] are placed into doubleword element 0 of VSR[XT].

Pseudocode Operation

if MSR.VSX=0 then VSX_Unavailable()
VSR[32×TX+T].dword[0] ←VSR[32×AX+A].dword[DM.bit[0]]
VSR[32×TX+T].dword[1] ←VSR[32×BX+B].dword[DM.bit[1]]

Programming Note

The xxmrghd instruction is used to merge the high doublewords from two source vector registers into a target vector register. Ensure that the VSX facility is enabled by checking and setting the appropriate bit in the MSR register. Be cautious with the DM bits, as they determine which source doubleword is merged into the target register. This instruction operates at the user privilege level and will raise an exception if the VSX facility is not available.

Example

xxmrghd vs1, vs2, vs3

Encoding

Binary Layout
60
0
XT
6
XA
11
XB
16
144
21
 
Format XX3-form
Opcode 0xF0000090
Extension VSX
Registers Altered MSR

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B