_mm512_sad_epu8
Classification
AVX-512, Miscellaneous, CPUID Test: AVX512BW
Header File
Instruction
VPSADBW zmm, zmm, zmm
Synopsis
_mm512_sad_epu8(__m512i a, __m512i b);
Description
Compute the absolute differences of packed unsigned 8-bit integers in "a" and "b", then horizontally sum each consecutive 8 differences to produce eight unsigned 16-bit integers, and pack these unsigned 16-bit integers in the low 16 bits of 64-bit elements in "dst".
Operation
FOR j := 0 to 63
i := j*8
tmp[i+7:i] := ABS(a[i+7:i] - b[i+7:i])
ENDFOR
FOR j := 0 to 7
i := j*64
dst[i+15:i] := tmp[i+7:i] + tmp[i+15:i+8] + tmp[i+23:i+16] + tmp[i+31:i+24] + \
tmp[i+39:i+32] + tmp[i+47:i+40] + tmp[i+55:i+48] + tmp[i+63:i+56]
dst[i+63:i+16] := 0
ENDFOR
dst[MAX:512] := 0