]> git.sesse.net Git - ffmpeg/commitdiff
x86: PABSW: port to cpuflags
authorDiego Biurrun <diego@biurrun.de>
Sun, 15 Jul 2012 15:59:26 +0000 (17:59 +0200)
committerDiego Biurrun <diego@biurrun.de>
Mon, 5 Nov 2012 13:51:10 +0000 (14:51 +0100)
libavcodec/x86/vc1dsp.asm
libavutil/x86/x86util.asm

index 4b56c31e4ee5a07511f60e59ead94af7e757e455..adf08d7d84355835432641f93aa885a96eedfb3c 100644 (file)
@@ -268,7 +268,6 @@ cglobal vc1_h_loop_filter8, 3,5,0
 %endmacro
 
 INIT_MMX mmxext
-%define PABSW PABSW_MMXEXT
 VC1_LF
 
 INIT_XMM sse2
@@ -284,8 +283,6 @@ cglobal vc1_h_loop_filter8, 3,6,8
     VC1_H_LOOP_FILTER 8, r5
     RET
 
-%define PABSW PABSW_SSSE3
-
 INIT_MMX ssse3
 ; void ff_vc1_v_loop_filter4_ssse3(uint8_t *src, int stride, int pq)
 cglobal vc1_v_loop_filter4, 3,5,0
index 9183d38595143528bd7d3f7dd8a4a3488cd0d9eb..b35d5945d8d44b64018b0939676aa7abc174d0ad 100644 (file)
 %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
     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