vexpandhm
Vector Expand Halfword Mask
Expands bits from a GPR mask into a halfword-element vector.
Details
The Vector Expand Halfword Mask instruction (vexpandhm) replicates the contents of bit 0 of each halfword element in the source VSR to all bits in the corresponding halfword element in the target VSR. If bit 0 is set, the target halfword is filled with all 1s; otherwise, it is filled with all 0s.
Pseudocode Operation
Programming Note
The vexpandhm instruction is useful for creating masks based on the least significant bit of each halfword in the source vector. Ensure that the Vector Facility (VEC) bit in the Machine State Register (MSR) is set to 1 before using this instruction, as attempting to execute it with VEC=0 will result in a Vector Unavailable exception. This instruction operates on 8 halfwords per vector register and does not require any specific alignment of the data.
Example
Encoding
Operands
-
vD
Target -
vB
Source