vabsduh
Vector Absolute Difference Unsigned Halfword
Computes |A - B| for halfwords.
Details
The vabsduh instruction computes the absolute difference between corresponding unsigned halfword elements of two vector registers and stores the results in a third vector register. It processes each pair of halfwords from the input vectors, calculates the absolute difference, and places the result into the corresponding position in the output vector.
Pseudocode Operation
Programming Note
The vabsduh instruction is commonly used for vectorized image processing tasks where pixel intensity differences need to be calculated. Ensure that the input vectors are properly aligned to halfword boundaries to avoid misaligned access exceptions. This instruction operates at user privilege level and does not generate any exceptions under normal operation, but it will raise a Vector_Unavailable exception if the VEC bit in the MSR is not set.
Example
Encoding
Operands
-
vD
Target -
vA
Src A -
vB
Src B