Assembly x64 Intro - XMM ABS


%macro WELS_AbsW 2
    pxor        %2, %2
    psubw       %2, %1
    pmaxsw      %1, %2
%endmacro


WELS_AbsW  xmm0, xmm3


展开如下:


pxor xmm3, xmm3     => xmm3 = 0

psubw xmm3, xmm0  => xmm3 = -xmm0

pmaxsw xmm0, xmm3  => (Maximum of Packed Signed Word Integers)  xmm0 = max(xmm0, xmm3) = max(xmm0, -xmm0) = abs(xmm0)






你可能感兴趣的:(Assembly x64 Intro - XMM ABS)