vmhaddshs
Vector Multiply-High-Add Signed Halfword Saturate
Performs a vector multiply-high-add signed halfword operation with saturation.
Details
For each integer value i from 0 to 7, the signed integer value in halfword element i of VSR[VRA+32] is multiplied by the signed integer value in halfword element i of VSR[VRB+32], producing a 32-bit signed integer product. Bits 0:16 of the product are added to the signed integer value in halfword element i of VSR[VRC+32]. The low-order 16 bits of the result are placed into halfword element i of VSR[VRT+32]. If the intermediate result is greater than 2^15-1, the result saturates to 2^15 -1 and SAT is set to 1. If the intermediate result is less than -2^15, the result saturates to -2^15 and SAT is set to 1.
Pseudocode Operation
Programming Note
This instruction is commonly used in applications requiring vectorized operations on signed halfwords, such as audio processing or graphics rendering. Ensure that the input vectors are properly aligned to avoid performance penalties. Be aware of saturation conditions; if any result exceeds the 16-bit signed integer range, it will be clamped and the VSCR.SAT flag will be set. This instruction operates at user privilege level.
Example
Encoding
Operands
-
VRT
Target Vector Register -
VRA
Source Vector Register -
VRB
Source Vector Register -
VRC
Source Vector Register