Commit 0bb53898 authored by Martin Storsjö's avatar Martin Storsjö Committed by Janne Grunau
Browse files

arm64: mc: Make the jump tables local symbols

For MachO, this makes sure that the label difference actually is
evaluated at assembly time (as it already was for ELF and COFF);
evaluating it at link time failed when the difference is stored in
a .hword.

This fixes linking errors like these:
ld: in section __TEXT,__text reloc 0: ARM64_RELOC_SUBTRACTOR must have r_length of 2 or 3 file 'src/src@@dav1d_bitdepth_8@sta/arm_64_mc.S.o' for architecture arm64

This adds an asm.S macro for decorating a symbol for making a
local symbol. For armasm64 with gas-preprocessor, this doesn't
actually create a local label (but neither do the local numbered
labels either currently), which might be slightly inconsistent
in it would be necessary to make the distinction for that assembler
as well.

Alternatively, the table symbol could be made into a plain local
numbered label as all the other labels.
parent 859ae6aa
Pipeline #1247 passed with stage
in 2 minutes and 4 seconds
......@@ -107,7 +107,7 @@ function \type\()_8bpc_neon, export=1
movi v31.16b, #256-2
rbit w4, w4
adr x7, \type\()_tbl
adr x7, L(\type\()_tbl)
clz w4, w4
\type v4, v0, v1
ldrh w4, [x7, x4, lsl #1]
......@@ -219,14 +219,14 @@ function \type\()_8bpc_neon, export=1
b 128b
.hword 0, 0
.hword \type\()_tbl - 4b
.hword \type\()_tbl - 8b
.hword \type\()_tbl - 160b
.hword \type\()_tbl - 320b
.hword \type\()_tbl - 640b
.hword \type\()_tbl - 1280b
.hword L(\type\()_tbl) - 4b
.hword L(\type\()_tbl) - 8b
.hword L(\type\()_tbl) - 160b
.hword L(\type\()_tbl) - 320b
.hword L(\type\()_tbl) - 640b
.hword L(\type\()_tbl) - 1280b
......@@ -91,4 +91,10 @@ EXTERN\name:
#ifdef __APPLE__
#define L(x) L ## x
#define L(x) .L ## x
#endif /* __DAV1D_SRC_ARM_ASM_S__ */
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