[FFmpeg-cvslog] aarch64: Use .data.rel.ro for const data with relocations

Martin Storsjö git at videolan.org
Tue Dec 9 12:22:23 CET 2014


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Sun Nov 16 12:52:21 2014 +0200| [780cd20b00a69e26bbfffbb8eec16fbe999ea793] | committer: Martin Storsjö

aarch64: Use .data.rel.ro for const data with relocations

This reverts commit c00365b46d464ce47716315c1801818d811bdb9a
in addition to using a different section.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=780cd20b00a69e26bbfffbb8eec16fbe999ea793
---

 libavcodec/aarch64/fft_neon.S        |   35 +++++++++++++++++-----------------
 libavcodec/aarch64/opus_imdct_neon.S |   20 +++++++++----------
 libavutil/aarch64/asm.S              |   10 ++++++++--
 3 files changed, 35 insertions(+), 30 deletions(-)

diff --git a/libavcodec/aarch64/fft_neon.S b/libavcodec/aarch64/fft_neon.S
index ae9e1c6..e205e23 100644
--- a/libavcodec/aarch64/fft_neon.S
+++ b/libavcodec/aarch64/fft_neon.S
@@ -376,8 +376,7 @@ function ff_fft_calc_neon, export=1
         ld1             {v30.16b}, [x10]
         mov             x7,  #-8
         movrel          x12, pmmp
-        ldr             x4,  [x3, x2, lsl #3]
-        add             x3,  x3,  x4
+        ldr             x3,  [x3, x2, lsl #3]
         movrel          x13, mppm
         movrel          x14, X(ff_cos_16)
         ld1             {v31.16b}, [x11]
@@ -416,22 +415,22 @@ function ff_fft_permute_neon, export=1
         ret
 endfunc
 
-const   fft_tab_neon
-        .quad fft4_neon     - fft_tab_neon
-        .quad fft8_neon     - fft_tab_neon
-        .quad fft16_neon    - fft_tab_neon
-        .quad fft32_neon    - fft_tab_neon
-        .quad fft64_neon    - fft_tab_neon
-        .quad fft128_neon   - fft_tab_neon
-        .quad fft256_neon   - fft_tab_neon
-        .quad fft512_neon   - fft_tab_neon
-        .quad fft1024_neon  - fft_tab_neon
-        .quad fft2048_neon  - fft_tab_neon
-        .quad fft4096_neon  - fft_tab_neon
-        .quad fft8192_neon  - fft_tab_neon
-        .quad fft16384_neon - fft_tab_neon
-        .quad fft32768_neon - fft_tab_neon
-        .quad fft65536_neon - fft_tab_neon
+const   fft_tab_neon, relocate=1
+        .quad fft4_neon
+        .quad fft8_neon
+        .quad fft16_neon
+        .quad fft32_neon
+        .quad fft64_neon
+        .quad fft128_neon
+        .quad fft256_neon
+        .quad fft512_neon
+        .quad fft1024_neon
+        .quad fft2048_neon
+        .quad fft4096_neon
+        .quad fft8192_neon
+        .quad fft16384_neon
+        .quad fft32768_neon
+        .quad fft65536_neon
 endconst
 
 const   pmmp, align=4
diff --git a/libavcodec/aarch64/opus_imdct_neon.S b/libavcodec/aarch64/opus_imdct_neon.S
index c98931c..d99edf4 100644
--- a/libavcodec/aarch64/opus_imdct_neon.S
+++ b/libavcodec/aarch64/opus_imdct_neon.S
@@ -438,8 +438,8 @@ function fft_b15_calc_neon
         uzp1            v12.4s, v4.4s,  v5.4s   // exp[11 - 14].re
         uzp2            v13.4s, v4.4s,  v5.4s   // exp[11 - 14].im
         zip1            v14.4s, v6.4s,  v7.4s   // exp[5,10].re/exp[5,10].im
-        ldr             x6,  [x5, x3, lsl #3]
-        add             x5,  x5,  x6
+        add             x5,  x5,  x3,  lsl #3
+        ldr             x5,  [x5]
         mov             x10, x0
         blr             x5
         ldp             x20, x30, [sp]
@@ -451,14 +451,14 @@ function fft_b15_calc_neon
         ret
 endfunc
 
-const   fft_tab_neon
-        .quad fft15_neon  - fft_tab_neon
-        .quad fft30_neon  - fft_tab_neon
-        .quad fft60_neon  - fft_tab_neon
-        .quad fft120_neon - fft_tab_neon
-        .quad fft240_neon - fft_tab_neon
-        .quad fft480_neon - fft_tab_neon
-        .quad fft960_neon - fft_tab_neon
+const   fft_tab_neon, relocate=1
+        .quad fft15_neon
+        .quad fft30_neon
+        .quad fft60_neon
+        .quad fft120_neon
+        .quad fft240_neon
+        .quad fft480_neon
+        .quad fft960_neon
 endconst
 
 function ff_celt_imdct_half_neon, export=1
diff --git a/libavutil/aarch64/asm.S b/libavutil/aarch64/asm.S
index b766e67..6a7f506 100644
--- a/libavutil/aarch64/asm.S
+++ b/libavutil/aarch64/asm.S
@@ -52,12 +52,18 @@ FUNC    .func   \name
     .endif
 .endm
 
-.macro  const   name, align=2
+.macro  const   name, align=2, relocate=0
     .macro endconst
 ELF     .size   \name, . - \name
         .purgem endconst
     .endm
-#ifndef __MACH__
+#if HAVE_SECTION_DATA_REL_RO
+.if \relocate
+        .section        .data.rel.ro
+.else
+        .section        .rodata
+.endif
+#elif !defined(__MACH__)
         .section        .rodata
 #else
         .const_data



More information about the ffmpeg-cvslog mailing list