aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/x86/x86inc.asm
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2015-08-03 03:28:37 -0300
committerJames Almer <jamrial@gmail.com>2015-08-03 17:11:13 -0300
commit5750d6c5e9d184488f4dc0f9e81cbcc28cb2f2d1 (patch)
tree41fcfa1cde031405eebbab47c280511c96476d28 /libavutil/x86/x86inc.asm
parent2ca0ed9cfda21c8a6f9884b93613602782dcda71 (diff)
downloadffmpeg-5750d6c5e9d184488f4dc0f9e81cbcc28cb2f2d1.tar.gz
x86: move XOP emulation code back to x86inc
Only two functions that use xop multiply-accumulate instructions where the first operand is the same as the fourth actually took advantage of the macros. This further reduces differences with x264's x86inc. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/x86/x86inc.asm')
-rw-r--r--libavutil/x86/x86inc.asm16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm
index d4c5e698fa..28a2d87f8f 100644
--- a/libavutil/x86/x86inc.asm
+++ b/libavutil/x86/x86inc.asm
@@ -1427,6 +1427,22 @@ AVX_INSTR pfmul, 3dnow, 1, 0, 1
%undef i
%undef j
+%macro FMA_INSTR 3
+ %macro %1 4-7 %1, %2, %3
+ %if cpuflag(xop)
+ v%5 %1, %2, %3, %4
+ %else
+ %6 %1, %2, %3
+ %7 %1, %4
+ %endif
+ %endmacro
+%endmacro
+
+FMA_INSTR pmacsww, pmullw, paddw
+FMA_INSTR pmacsdd, pmulld, paddd ; sse4 emulation
+FMA_INSTR pmacsdql, pmuldq, paddq ; sse4 emulation
+FMA_INSTR pmadcswd, pmaddwd, paddd
+
; tzcnt is equivalent to "rep bsf" and is backwards-compatible with bsf.
; This lets us use tzcnt without bumping the yasm version requirement yet.
%define tzcnt rep bsf