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.
Encoding
Binary Layout
60
0:5
XT
6:10
XA
11:15
XB
16:20
XC
21:25
34
26:31
Operands
-
XT
Target -
XA
Src A -
XB
Src B -
XC
Control -
VRT
Target VSX Register -
VRA
Source VSX Register -
VRB
Source VSX Register
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
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.
Operation
if MSR.VSX=0 then VSX_Unavailable()
do i = 0 to 7
if VSR[32×CX+C].hword[i].bit[0]=0 then
VSR[32×TX+T].hword[i] ←VSR[32×AX+A].hword[i]
else
VSR[32×TX+T].hword[i] ←VSR[32×BX+B].hword[i]
end
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.