summaryrefslogtreecommitdiff
path: root/libavutil/x86
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2012-07-15 17:59:26 +0200
committerDiego Biurrun <diego@biurrun.de>2012-11-05 14:51:10 +0100
commitdbb37e77117466edfc146f9f0df4c70bef6239d6 (patch)
tree070f9fe54543fcfeb415b2ba484e4e85e1e0ac47 /libavutil/x86
parent6c104826bd6e46ff5a02a3f1dcbd6e0b6bf8743a (diff)
x86: PABSW: port to cpuflags
Diffstat (limited to 'libavutil/x86')
-rw-r--r--libavutil/x86/x86util.asm22
1 files changed, 10 insertions, 12 deletions
diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
index 9183d38595..b35d5945d8 100644
--- a/libavutil/x86/x86util.asm
+++ b/libavutil/x86/x86util.asm
@@ -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