]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/arm/asm.S
time_internal: Prefix fallback versions of gmtime_r/localtime_r with ff_
[ffmpeg] / libavutil / arm / asm.S
index 93d74b65e1434ef9bf519654004f1ec4d00710fa..9842d03bc0dac65cfd92c83ac6294a6327bc1dad 100644 (file)
 #   define FUNC @
 #endif
 
+#if HAVE_AS_FPU_DIRECTIVE
+#   define FPU
+#else
+#   define FPU @
+#endif
+
+#if CONFIG_THUMB && defined(__APPLE__)
+#   define TFUNC
+#else
+#   define TFUNC @
+#endif
+
+#if HAVE_AS_ARCH_DIRECTIVE
 #if   HAVE_NEON
         .arch           armv7-a
 #elif HAVE_ARMV6T2
 #elif HAVE_ARMV5TE
         .arch           armv5te
 #endif
+#endif
+#if   HAVE_AS_OBJECT_ARCH
+ELF     .object_arch    armv4
+#endif
 
 #if   HAVE_NEON
-        .fpu            neon
+FPU     .fpu            neon
+ELF     .eabi_attribute 10, 0           @ suppress Tag_FP_arch
+ELF     .eabi_attribute 12, 0           @ suppress Tag_Advanced_SIMD_arch
 #elif HAVE_VFP
-        .fpu            vfp
+FPU     .fpu            vfp
+ELF     .eabi_attribute 10, 0           @ suppress Tag_FP_arch
 #endif
 
         .syntax unified
@@ -71,6 +91,9 @@ ELF     .section .note.GNU-stack,"",%progbits @ Mark stack as non-executable
         put_pic         %(.Lpic_idx - 1)
         .noaltmacro
       .endif
+      .if .Lpic_gp
+        .unreq          gp
+      .endif
 ELF     .size   \name, . - \name
 FUNC    .endfunc
         .purgem endfunc
@@ -81,20 +104,34 @@ FUNC    .endfunc
         .global EXTERN_ASM\name
 ELF     .type   EXTERN_ASM\name, %function
 FUNC    .func   EXTERN_ASM\name
+TFUNC   .thumb_func EXTERN_ASM\name
 EXTERN_ASM\name:
     .else
 ELF     .type   \name, %function
 FUNC    .func   \name
+TFUNC   .thumb_func \name
 \name:
     .endif
 .endm
 
-.macro  const   name, align=2
+.macro  const   name, align=2, relocate=0
     .macro endconst
 ELF     .size   \name, . - \name
         .purgem endconst
     .endm
+#if HAVE_SECTION_DATA_REL_RO
+.if \relocate
+        .section        .data.rel.ro
+.else
         .section        .rodata
+.endif
+#elif defined(_WIN32)
+        .section        .rdata
+#elif !defined(__MACH__)
+        .section        .rodata
+#else
+        .const_data
+#endif
         .align          \align
 \name:
 .endm
@@ -165,6 +202,15 @@ T       ldr             \rd, [\rd]
 .endm
 
 .macro  movrelx         rd,  val, gp
+    .ifc \rd,\gp
+        .error      "movrelx needs two distinct registers"
+    .endif
+    .ifc \rd\()_\gp,r12_
+        .warning    "movrelx rd=\rd without explicit set gp"
+    .endif
+    .ifc \rd\()_\gp,ip_
+        .warning    "movrelx rd=\rd without explicit set gp"
+    .endif
 #if CONFIG_PIC && defined(__ELF__)
     .ifnb \gp
       .if .Lpic_gp