xxblendvw
VSX Vector Blend Variable Word
Selects words from XA or XB based on the MSB of words in XC.
Details
The xxblendvw instruction performs a vector blend operation on word elements. For each word element, if the least significant bit of the corresponding element in the third source register (XC) is 0, it selects the word from the first source register (XA); otherwise, it selects the word from the second source register (XB). The result is stored in the target register (XT).
Pseudocode Operation
Programming Note
The xxblendvw instruction is commonly used for conditional blending of word elements from two source vectors based on a control vector. Ensure that the VSX (Vector Scalar Extensions) are enabled in the MSR register to avoid exceptions. This instruction operates on 16-word elements, so alignment and ordering of input registers must be correct to prevent data corruption or incorrect results.
Example
Encoding
Operands
-
XT
Target -
XA
Src A -
XB
Src B -
XC
Control