[x264-devel] x86inc: Avoid creating unnecessary local labels

Henrik Gramner git at videolan.org
Sun Jan 17 22:17:54 CET 2016


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Fri Oct 16 21:28:49 2015 +0200| [70c3ba42e610b4182edda4fdeb10b37a2a70eb8f] | committer: Henrik Gramner

x86inc: Avoid creating unnecessary local labels

The REP_RET workaround is only needed on old AMD cpus, and the labels clutter
up the symbol table and confuse debugging/profiling tools, so use EQU to
create SHN_ABS symbols instead of creating local labels. Furthermore, skip
the workaround completely in functions that definitely won't run on such cpus.

This patch doesn't modify any emitted instructions, and doesn't actually affect
x264 at all. It's only for other projects that use x86inc.asm without an
appropriate `strip` command in their buildsystem.

Note that EQU is just creating a local label when using nasm instead of yasm.
This is probably a bug, but at least it doesn't break anything.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=70c3ba42e610b4182edda4fdeb10b37a2a70eb8f
---

 common/x86/x86inc.asm |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/x86/x86inc.asm b/common/x86/x86inc.asm
index 71629db..2043b67 100644
--- a/common/x86/x86inc.asm
+++ b/common/x86/x86inc.asm
@@ -635,8 +635,10 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
     %rep %0
         %macro %1 1-2 %1
             %2 %1
-            %%branch_instr:
-            %xdefine last_branch_adr %%branch_instr
+            %if notcpuflag(ssse3)
+                %%branch_instr equ $
+                %xdefine last_branch_adr %%branch_instr
+            %endif
         %endmacro
         %rotate 1
     %endrep



More information about the x264-devel mailing list