vmrgow

Vector Merge Odd Word

vmrgow vD, vA, vB

Merges odd words from two vectors.

Details

The Vector Merge Odd Word instruction (vmrgow) merges the odd-numbered words from two source vectors into a destination vector. Specifically, it takes the first word from the second source vector and the second word from the first source vector to form the first half of the destination vector, and similarly for the third and fourth words.

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
VSR[VRT+32].word[0] ← VSR[VRA+32].word[1]
VSR[VRT+32].word[1] ← VSR[VRB+32].word[1]
VSR[VRT+32].word[2] ← VSR[VRA+32].word[3]
VSR[VRT+32].word[3] ← VSR[VRB+32].word[3]

Programming Note

The vmrgow instruction is used to merge odd-numbered words from two source vectors into a destination vector. Ensure that the Vector Facility (VEC) bit in the Machine State Register (MSR) is set; otherwise, a Vector_Unavailable exception will be raised. This instruction operates on 128-bit vectors and requires proper alignment of the source and destination registers.

Example

vmrgow vd, va, vb

Encoding

Binary Layout
4
0
vD
6
vA
11
vB
16
1676
21
 
Format VX-form
Opcode 0x1000068C
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vD
    Target
  • vA
    Src A
  • vB
    Src B