]> git.sesse.net Git - ffmpeg/blob - libavcodec/arm/asm.S
ARM: enable UAL syntax in asm.S
[ffmpeg] / libavcodec / arm / asm.S
1 /*
2  * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
3  *
4  * This file is part of Libav.
5  *
6  * Libav is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * Libav is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with Libav; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20
21 #include "config.h"
22
23 #ifdef __ELF__
24 #   define ELF
25 #else
26 #   define ELF @
27 #endif
28
29         .syntax unified
30
31 .macro  require8 val=1
32 ELF     .eabi_attribute 24, \val
33 .endm
34
35 .macro  preserve8 val=1
36 ELF     .eabi_attribute 25, \val
37 .endm
38
39 .macro  function name, export=0
40     .macro endfunc
41 ELF     .size   \name, . - \name
42         .endfunc
43         .purgem endfunc
44     .endm
45         .text
46     .if \export
47         .global EXTERN_ASM\name
48 EXTERN_ASM\name:
49     .endif
50 ELF     .type   \name, %function
51         .func   \name
52 \name:
53 .endm
54
55 .macro  const   name, align=2
56     .macro endconst
57 ELF     .size   \name, . - \name
58         .purgem endconst
59     .endm
60         .section        .rodata
61         .align          \align
62 \name:
63 .endm
64
65 .macro  mov32   rd, val
66 #if HAVE_ARMV6T2
67         movw            \rd, #(\val) & 0xffff
68     .if (\val) >> 16
69         movt            \rd, #(\val) >> 16
70     .endif
71 #else
72         ldr             \rd, =\val
73 #endif
74 .endm
75
76 .macro  movrel rd, val
77 #if HAVE_ARMV6T2 && !CONFIG_PIC && !defined(__APPLE__)
78         movw            \rd, #:lower16:\val
79         movt            \rd, #:upper16:\val
80 #else
81         ldr             \rd, =\val
82 #endif
83 .endm
84
85 #if HAVE_VFP_ARGS
86         .eabi_attribute 28, 1
87 #   define VFP
88 #   define NOVFP @
89 #else
90 #   define VFP   @
91 #   define NOVFP
92 #endif
93
94 #define GLUE(a, b) a ## b
95 #define JOIN(a, b) GLUE(a, b)
96 #define X(s) JOIN(EXTERN_ASM, s)