3-546
INSTRUCTION SET REFERENCE
PSADBWPacked Sum of Absolute Differences (Continued)
Operation
TEMP1 = abs(DEST[7-0] - SRC/m64[7-0]);
TEMP2 = abs(DEST[15-8] - SRC/m64[15-8]);
TEMP3 = abs(DEST[23-16] - SRC/m64[23-16]);
TEMP4 = abs(DEST[31-24] - SRC/m64[31-24]);
TEMP5 = abs(DEST[39-32] - SRC/m64[39-32]);
TEMP6 = abs(DEST[47-40] - SRC/m64[47-40]);
TEMP7 = abs(DEST[55-48] - SRC/m64[55-48]);
TEMP8 = abs(DEST[63-56] - SRC/m64[63-56]);
DEST[15:0] = TEMP1 + TEMP2 + TEMP3 + TEMP4 + TEMP5 + TEMP6 + TEMP7 + TEMP8;
DEST[31:16] = 0X00000000;
DEST[47:32] = 0X00000000;
DEST[63:48] = 0X00000000;
Intel C/C++ Compiler Intrinsic Equivalent
Pre-4.0 Intel C/C++ Compiler intrinsic:
__m64_m_psadbw(__m64 a,__m64 b)
Version 4.0 and later Intel C/C++ Compiler intrinsic:
__m64_mm_sad_pu8(__m64 a,__m64 b)
Computes the sum of the absolute differences of the unsigned bytes in a and b, returning the
value in the lower word. The upper three words are cleared.
Numeric Exceptions
None.
Protected Mode Exceptions
#GP(0)
For an illegal memory operand effective address in the CS, DS, ES, FS, or
GS segments.
#SS(0)
For an illegal address in the SS segment.
#PF (fault-code)For a page fault.
#UD
If CR0.EM = 1.
#NM
If TS bit in CR0 is set.
#MF
If there is a pending FPU exception.
#AC
For unaligned memory reference. To enable #AC exceptions, three condi-
tions must be true(CR0.AM is set; EFLAGS.AC is set; current CPL is 3).