vmrghh
Vector Merge High Halfword
Merges the high halfwords of two vector registers into a target vector register.
Details
For vmrghh, the contents of halfword elements 0 to 3 of VSR[VRA+32] are placed into halfword elements 0 to 7 of VSR[VRT+32], and the contents of halfword elements 0 to 3 of VSR[VRB+32] are placed into halfword elements 1 to 8 of VSR[VRT+32].
Pseudocode Operation
Programming Note
The vmrghh instruction is used to merge the high halfwords from two vector registers into a single destination register. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, it will raise an exception. This operation is useful for combining data from two sources into one vector, but be cautious of alignment issues if the data elements are not properly aligned to halfword boundaries.
Example
Encoding
Operands
-
vD
Target -
vA
Src A -
vB
Src B -
VRT
Target Vector Register -
VRA
Source Vector Register -
VRB
Source Vector Register