vextsh2d
Vector Extend Sign Halfword To Doubleword
Extends the sign of each halfword in a vector to doubleword.
Details
Sign-extends each of two 16-bit halfwords in the source vector to 64-bit doublewords, filling the upper bits with the sign bit, and stores the result in the destination vector. The instruction operates on the two halfwords in the lower 32 bits of the source. No condition flags are affected; this is a VMX/AltiVec instruction.
Pseudocode Operation
vD[0:63] ← (vB[0] replicated to 48 bits) || vB[0:15]
vD[64:127] ← (vB[16] replicated to 48 bits) || vB[16:31]
Programming Note
This instruction is used for sign-extending the upper 16 bits of each doubleword in a vector from VRB to VRT. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, it will raise an exception. The operation processes two elements per instruction execution.
Example
Encoding
Operands
-
vD
Target -
vB
Source -
VRT
Target Vector Register -
VSRC
Source Vector Register