vadduhs
Vector Add Unsigned Halfword Saturate
Adds the contents of two vector registers and saturates the result.
Details
The vadduhs instruction performs an unsigned addition of each pair of halfwords from the source registers VRA and VRB, saturating the result to fit within a halfword. The results are stored in the destination register VRT.
Pseudocode Operation
Programming Note
The vadduhs instruction is commonly used for adding pairs of unsigned halfwords with saturation, which prevents overflow by clamping results to the maximum representable value. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. The operation processes 8 halfword elements in parallel, and both source registers must be properly aligned for optimal performance.
Example
Encoding
Operands
-
vD
Target -
vA
Src A -
vB
Src B -
VRT
Target Vector Register -
VRA
Source Vector Register -
VRB
Source Vector Register