[x264-devel] [PATCH] Add emulation for previously unsupported XOP fma instructions.

James Almer jamrial at gmail.com
Sun Feb 16 09:12:42 CET 2014


Allow non-destructive emulation when the fourth argument
is the same as the first by specifying a fifth argument
to be used as temporary.
---
I'm not replacing FMA_INSTR from x86inc because of SUMSUB2_AB 
calling pmacs** in lowercase, making it incompatible with 
capitalized macros like these, and because this is the only 
case where a temp argument might be needed.
---
 common/x86/x86util.asm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/common/x86/x86util.asm b/common/x86/x86util.asm
index 79ff34f..74c9800 100644
--- a/common/x86/x86util.asm
+++ b/common/x86/x86util.asm
@@ -868,3 +868,19 @@
     SWAP       %2, %3
 %endif
 %endmacro
+
+%macro PMA_EMUL 4
+    %macro %1 5 %2, %3, %4
+        %ifnidn %1, %4 || cpuflag(xop)
+            %6 %1, %2, %3, %4
+        %else
+            %7 %5, %2, %3
+            %8 %1, %4, %5
+        %endif
+    %endmacro
+%endmacro
+
+PMA_EMUL PMACSWW,  pmacsww,  pmullw,  paddw
+PMA_EMUL PMACSDD,  pmacsdd,  pmulld,  paddd ; sse4 emulation
+PMA_EMUL PMACSDQL, pmacsdql, pmuldq,  paddq ; sse4 emulation
+PMA_EMUL PMADCSWD, pmadcswd, pmaddwd, paddd
-- 
1.8.3.2



More information about the x264-devel mailing list