Commit d463a92e authored by Henrik Gramner's avatar Henrik Gramner Committed by Anton Mitrofanov
Browse files

x86inc: Support creating global symbols from local labels

On ELF platforms such symbols needs to be flagged as functions with the
correct visibility to please certain linkers in some scenarios.
parent 67b5c961
......@@ -161,8 +161,7 @@ cextern hsub_mul
%macro SUB8x8_DCT8 0
cglobal sub8x8_dct8, 3,3,8
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
LOAD_DIFF8x4 0,1,2,3, none,none, r1, r2
LOAD_DIFF8x4 4,5,6,7, none,none, r1, r2
......@@ -211,8 +210,7 @@ SUB8x8_DCT8
%macro ADD8x8_IDCT8 0
cglobal add8x8_idct8, 2,2
add r1, 128
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
UNSPILL_SHUFFLE r1, 1,2,3,5,6,7, -6,-4,-2,2,4,6
IDCT8_1D d,0,1,2,3,4,5,6,7,[r1-128],[r1+0]
mova [r1+0], m4
......@@ -443,8 +441,7 @@ global add8x8_idct8_mmx.skip_prologue
%macro DCT_SUB8 0
cglobal sub8x8_dct, 3,3
add r2, 4*FDEC_STRIDE
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
%if cpuflag(ssse3)
mova m7, [hsub_mul]
%endif
......@@ -476,8 +473,7 @@ global current_function %+ .skip_prologue
;-----------------------------------------------------------------------------
cglobal sub8x8_dct8, 3,3
add r2, 4*FDEC_STRIDE
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
%if cpuflag(ssse3)
mova m7, [hsub_mul]
LOAD_DIFF8x4 0, 1, 2, 3, 4, 7, r1, r2-4*FDEC_STRIDE
......@@ -525,8 +521,7 @@ DCT_SUB8
%macro ADD8x8 0
cglobal add8x8_idct, 2,2
add r0, 4*FDEC_STRIDE
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
UNSPILL_SHUFFLE r1, 0,2,1,3, 0,1,2,3
SBUTTERFLY qdq, 0, 1, 4
SBUTTERFLY qdq, 2, 3, 4
......@@ -569,8 +564,7 @@ ADD8x8
%macro ADD8x8_IDCT8 0
cglobal add8x8_idct8, 2,2
add r0, 4*FDEC_STRIDE
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
UNSPILL r1, 1,2,3,5,6,7
IDCT8_1D w,0,1,2,3,4,5,6,7,[r1+0],[r1+64]
SPILL r1, 6
......
......@@ -142,8 +142,7 @@ cextern hsub_mul
%macro SUB8x8_DCT8 0
cglobal sub8x8_dct8, 3,3,14
TAIL_CALL .skip_prologue, 0
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
LOAD_DIFF8x4 0,1,2,3, none,none, r1, r2
LOAD_DIFF8x4 4,5,6,7, none,none, r1, r2
......@@ -192,8 +191,7 @@ SUB8x8_DCT8
cglobal add8x8_idct8, 2,2,16
add r1, 128
TAIL_CALL .skip_prologue, 0
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
mova m0, [r1-128]
mova m1, [r1-96]
mova m2, [r1-64]
......@@ -255,8 +253,7 @@ cglobal sub8x8_dct, 3,3,10
mova m7, [hsub_mul]
%endif
TAIL_CALL .skip_prologue, 0
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
SWAP 7, 9
LOAD_DIFF8x4 0, 1, 2, 3, 8, 9, r1, r2-4*FDEC_STRIDE
LOAD_DIFF8x4 4, 5, 6, 7, 8, 9, r1, r2-4*FDEC_STRIDE
......@@ -279,8 +276,7 @@ cglobal sub8x8_dct8, 3,3,11
mova m7, [hsub_mul]
%endif
TAIL_CALL .skip_prologue, 0
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
SWAP 7, 10
LOAD_DIFF8x4 0, 1, 2, 3, 4, 10, r1, r2-4*FDEC_STRIDE
LOAD_DIFF8x4 4, 5, 6, 7, 8, 10, r1, r2-4*FDEC_STRIDE
......@@ -355,8 +351,7 @@ cglobal add8x8_idct8, 2,2,11
add r0, 4*FDEC_STRIDE
pxor m7, m7
TAIL_CALL .skip_prologue, 0
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
SWAP 7, 9
movdqa m0, [r1+0x00]
movdqa m1, [r1+0x10]
......@@ -391,8 +386,7 @@ cglobal add8x8_idct, 2,2,11
add r0, 4*FDEC_STRIDE
pxor m7, m7
TAIL_CALL .skip_prologue, 0
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
SWAP 7, 9
mova m0, [r1+ 0]
mova m2, [r1+16]
......
......@@ -510,8 +510,7 @@ cglobal add8x8_idct, 2,3,8
add r0, 4*FDEC_STRIDE
pxor m7, m7
TAIL_CALL .skip_prologue, 0
global current_function %+ .skip_prologue
.skip_prologue:
cglobal_label .skip_prologue
; TRANSPOSE4x4Q
mova xm0, [r1+ 0]
mova xm1, [r1+32]
......
......@@ -4,9 +4,9 @@
;* Copyright (C) 2005-2017 x264 project
;*
;* Authors: Loren Merritt <lorenm@u.washington.edu>
;* Henrik Gramner <henrik@gramner.com>
;* Anton Mitrofanov <BugMaster@narod.ru>
;* Fiona Glaser <fiona@x264.com>
;* Henrik Gramner <henrik@gramner.com>
;*
;* Permission to use, copy, modify, and/or distribute this software for any
;* purpose with or without fee is hereby granted, provided that the above
......@@ -731,6 +731,16 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
%endif
%endmacro
; Create a global symbol from a local label with the correct name mangling and type
%macro cglobal_label 1
%if FORMAT_ELF
global current_function %+ %1:function hidden
%else
global current_function %+ %1
%endif
%1:
%endmacro
%macro cextern 1
%xdefine %1 mangle(private_prefix %+ _ %+ %1)
CAT_XDEFINE cglobaled_, %1, 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment