vpkshss
Vector Pack Signed Halfword Signed Saturate
Packs signed halfwords from two vector registers into a single vector register with signed saturation.
Details
The instruction concatenates the contents of VSR[VRA+32] and VSR[VRB+32], then for each integer value i from 0 to 15, it places the signed integer value in halfword element i of the concatenated source into byte element i of VSR[VRT+32] in signed integer format. If the value is greater than 2^7 - 1 or less than -2^7, it saturates and sets SAT to 1.
Pseudocode Operation
Programming Note
This instruction is useful for packing signed halfwords into bytes with saturation. Ensure that the source vectors are correctly aligned and that the vector facility (MSR.VEC) is enabled to avoid exceptions. Be aware of saturation conditions, as they will set the SAT bit in VSCR.
Example
Encoding
Operands
-
vD
Target -
vA
Src A -
vB
Src B -
VRT
Target Vector Register -
VRA
Source Vector Register -
VRB
Source Vector Register