Performs multiple sum of absolute differences on extended packed unsigned integer values ofs two vectors. The corresponding Intel® AVX2 instruction is VMPSADBW.


extern __m256i _mm256_mpsadbw_epu8(__m256i s1, __m256i s2, const int mask);



integer source vector used for the operation


integer source vector used for the operation


integer constant specifying offset


Performs multiple sum operations of the absolute difference of blocks of four packed unsigned bytes of vector s2 with sequential blocks of four packed unsigned bytes in vector s1. The offset granularity in both vectors is 32 bits.

The sum-absolute-difference (SAD) operation is repeated 16 times by the intrinsic between the s2 vector with a fixed offset and a variable s1 vector where the offset is shifted by eight bits for each SAD operation. The integer constant specified in mask provides bit fields that specify the initial offset for s2 and s1 vectors. Each 16-bit result of eight SAD operations is written to the respective word in the result vector.


Result of the multiple sum-absolute-difference operation.

Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.