xxmrglw

VSX Vector Merge Low Word

xxmrglw XT, XA, XB

Merges low words from two VSRs.

Details

The VSX Vector Merge Low Word instruction (xxmrglw) merges the low words from two source vectors and places them into a destination vector. Specifically, it takes the second word (word element 2) from the first source vector and the third word (word element 3) from the second source vector and combines them into the destination vector.

Pseudocode Operation

if MSR.VSX=0 then VSX_Unavailable()
Let XT be the value 32×TX + T.
Let XA be the value 32×AX + A.
Let XB be the value 32×BX + B.
VSR[XT].word[0] ← VSR[XA].word[2]
VSR[XT].word[1] ← VSR[XB].word[3]

Programming Note

The xxmrglw instruction is commonly used for merging specific word elements from two VSX vectors into a new vector. Ensure that the VSX facility is enabled by checking and setting the appropriate bit in the MSR register. This instruction operates on 128-bit vectors, so source and destination registers must be properly aligned. Be cautious of potential exceptions if the VSX facility is not available or if there are alignment issues with the vector registers.

Example

xxmrglw vs1, vs2, vs3

Encoding

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

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B