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

James Almer jamrial at gmail.com
Sat Feb 22 21:52:23 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.

Signed-off-by: James Almer <jamrial at gmail.com>
---
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 | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/common/x86/x86util.asm b/common/x86/x86util.asm
index 79ff34f..a8e7fbf 100644
--- a/common/x86/x86util.asm
+++ b/common/x86/x86util.asm
@@ -868,3 +868,21 @@
     SWAP       %2, %3
 %endif
 %endmacro
+
+%macro PMA_EMUL 4
+    %macro %1 5 %2, %3, %4
+        %if cpuflag(xop)
+            %6 %1, %2, %3, %4
+        %elifnidn %1, %4
+            %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