summaryrefslogtreecommitdiff
path: root/libavutil/x86
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2012-07-15 18:23:40 +0200
committerDiego Biurrun <diego@biurrun.de>2013-01-14 21:56:55 +0100
commit51969a652c2e9e330393c9ad40f919516a4795d1 (patch)
tree64150d59901c08935ec7dd65b1d2560283dce31b /libavutil/x86
parent171f1446f05440c9f5ffb986e3dcc828e50d440a (diff)
x86: ABS2: port to cpuflags
Diffstat (limited to 'libavutil/x86')
-rw-r--r--libavutil/x86/x86util.asm29
1 files changed, 13 insertions, 16 deletions
diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
index e24acdd940..1451500534 100644
--- a/libavutil/x86/x86util.asm
+++ b/libavutil/x86/x86util.asm
@@ -187,7 +187,18 @@
%endif
%endmacro
-%macro ABS2_MMX 4 ; a, b, tmp0, tmp1
+%macro ABS2 4
+%if cpuflag(ssse3)
+ pabsw %1, %1
+ pabsw %2, %2
+%elif cpuflag(mmxext) ; a, b, tmp0, tmp1
+ pxor %3, %3
+ pxor %4, %4
+ psubw %3, %1
+ psubw %4, %2
+ pmaxsw %1, %3
+ pmaxsw %2, %4
+%else ; a, b, tmp0, tmp1
pxor %3, %3
pxor %4, %4
pcmpgtw %3, %1
@@ -196,20 +207,7 @@
pxor %2, %4
psubw %1, %3
psubw %2, %4
-%endmacro
-
-%macro ABS2_MMXEXT 4 ; a, b, tmp0, tmp1
- pxor %3, %3
- pxor %4, %4
- psubw %3, %1
- psubw %4, %2
- pmaxsw %1, %3
- pmaxsw %2, %4
-%endmacro
-
-%macro ABS2_SSSE3 4
- pabsw %1, %1
- pabsw %2, %2
+%endif
%endmacro
%macro ABSB_MMX 2
@@ -252,7 +250,6 @@
ABS2 %3, %4, %5, %6
%endmacro
-%define ABS2 ABS2_MMX
%define ABSB ABSB_MMX
%define ABSB2 ABSB2_MMX