x86: PABSW: port to cpuflags

This commit is contained in:
Diego Biurrun
2012-07-15 17:59:26 +02:00
parent 6c104826bd
commit dbb37e7711
2 changed files with 10 additions and 15 deletions

View File

@ -145,13 +145,21 @@
%endif
%endmacro
; PABSW macros assume %1 != %2, while ABS1/2 macros work in-place
%macro PABSW_MMX 2
; PABSW macro assumes %1 != %2, while ABS1/2 macros work in-place
%macro PABSW 2
%if cpuflag(ssse3)
pabsw %1, %2
%elif cpuflag(mmxext)
pxor %1, %1
psubw %1, %2
pmaxsw %1, %2
%else
pxor %1, %1
pcmpgtw %1, %2
pxor %2, %1
psubw %2, %1
SWAP %1, %2
%endif
%endmacro
%macro PSIGNW_MMX 2
@ -159,16 +167,6 @@
psubw %1, %2
%endmacro
%macro PABSW_MMXEXT 2
pxor %1, %1
psubw %1, %2
pmaxsw %1, %2
%endmacro
%macro PABSW_SSSE3 2
pabsw %1, %2
%endmacro
%macro PSIGNW_SSSE3 2
psignw %1, %2
%endmacro