xxblendvh
VSX Vector Blend Variable Halfword
xxblendvh XT, XA, XB, XC
Selects halfwords from XA or XB based on the MSB of halfwords in XC.
Details
For xxblendvh, the contents of each halfword in the target vector are selected from either the first or second source vector based on the corresponding bit in the control vector.
Pseudocode Operation
Programming Note
Ensure VSX is enabled by checking and setting the appropriate bit in the MSR register. This instruction blends halfwords from two source vectors into a target vector based on a control vector's bits. Be cautious of alignment requirements for vector registers to avoid undefined behavior.
Example
xxblendvh vs1, vs2, vs3, vs4
Encoding
Binary Layout
60
0
XT
6
XA
11
XB
16
XC
21
34
26
Operands
-
XT
Target -
XA
Src A -
XB
Src B -
XC
Control -
VRT
Target VSX Register -
VRA
Source VSX Register -
VRB
Source VSX Register