vadduhm
Vector Add Unsigned Halfword Modulo
Adds 8 halfwords modulo 65536.
Details
The Vector Add Unsigned Halfword Modulo instruction adds corresponding unsigned halfword elements from two source vectors and places the results in a destination vector. The addition is performed modulo, meaning that if the sum exceeds the maximum value for an unsigned halfword (65535), it wraps around to zero.
Pseudocode Operation
Programming Note
This instruction is commonly used for vectorized addition of unsigned 16-bit integers with modulo behavior, useful in applications like image processing or cryptography. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. The operation processes each halfword element independently, so there are no ordering requirements between elements, but alignment of input vectors to 16-byte boundaries can improve performance.
Example
Encoding
Operands
-
vD
Target -
vA
Src A -
vB
Src B