2 * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
4 * This file is part of FFmpeg.
6 * FFmpeg 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.
11 * FFmpeg 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.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
61 ELF .eabi_attribute 25, 1 @ Tag_ABI_align_preserved
62 ELF .section .note.GNU-stack,"",%progbits @ Mark stack as non-executable
64 .macro function name, export=0, align=2
71 put_pic %(.Lpic_idx - 1)
74 ELF .size \name, . - \name
81 .global EXTERN_ASM\name
82 ELF .type EXTERN_ASM\name, %function
83 FUNC .func EXTERN_ASM\name
86 ELF .type \name, %function
92 .macro const name, align=2
94 ELF .size \name, . - \name
102 #if !HAVE_ARMV6T2_EXTERNAL
110 #if HAVE_ARMV6T2_EXTERNAL
111 movw \rd, #(\val) & 0xffff
113 movt \rd, #(\val) >> 16
124 .macro do_def_pic num, val, label
136 .macro def_pic val, label
138 do_def_pic %.Lpic_idx, \val, \label
140 .set .Lpic_idx, .Lpic_idx + 1
143 .macro ldpic rd, val, indir=0
153 def_pic \val - (.Lpic\@ + (8 >> CONFIG_THUMB)), .Lpicoff\@
156 .macro movrel rd, val
159 #elif HAVE_ARMV6T2_EXTERNAL && !defined(__APPLE__)
160 movw \rd, #:lower16:\val
161 movt \rd, #:upper16:\val
167 .macro movrelx rd, val, gp
168 #if CONFIG_PIC && defined(__ELF__)
174 ldpic gp, _GLOBAL_OFFSET_TABLE_
177 ldpic gp, _GLOBAL_OFFSET_TABLE_
182 def_pic \val(GOT), .Lpicoff\@
183 #elif CONFIG_PIC && defined(__APPLE__)
184 ldpic \rd, .Lpic\@, indir=1
185 .non_lazy_symbol_pointer
187 .indirect_symbol \val
195 .macro add_sh rd, rn, rm, sh:vararg
196 A add \rd, \rn, \rm, \sh
201 .macro ldr_pre rt, rn, rm:vararg
202 A ldr \rt, [\rn, \rm]!
207 .macro ldr_dpre rt, rn, rm:vararg
208 A ldr \rt, [\rn, -\rm]!
213 .macro ldr_nreg rt, rn, rm:vararg
214 A ldr \rt, [\rn, -\rm]
219 .macro ldr_post rt, rn, rm:vararg
220 A ldr \rt, [\rn], \rm
225 .macro ldrc_pre cc, rt, rn, rm:vararg
226 A ldr\cc \rt, [\rn, \rm]!
228 T add\cc \rn, \rn, \rm
232 .macro ldrd_reg rt, rt2, rn, rm
233 A ldrd \rt, \rt2, [\rn, \rm]
235 T ldrd \rt, \rt2, [\rt]
238 .macro ldrd_post rt, rt2, rn, rm
239 A ldrd \rt, \rt2, [\rn], \rm
240 T ldrd \rt, \rt2, [\rn]
244 .macro ldrh_pre rt, rn, rm
245 A ldrh \rt, [\rn, \rm]!
250 .macro ldrh_dpre rt, rn, rm
251 A ldrh \rt, [\rn, -\rm]!
256 .macro ldrh_post rt, rn, rm
257 A ldrh \rt, [\rn], \rm
262 .macro ldrb_post rt, rn, rm
263 A ldrb \rt, [\rn], \rm
268 .macro str_post rt, rn, rm:vararg
269 A str \rt, [\rn], \rm
274 .macro strb_post rt, rn, rm:vararg
275 A strb \rt, [\rn], \rm
280 .macro strd_post rt, rt2, rn, rm
281 A strd \rt, \rt2, [\rn], \rm
282 T strd \rt, \rt2, [\rn]
286 .macro strh_pre rt, rn, rm
287 A strh \rt, [\rn, \rm]!
292 .macro strh_dpre rt, rn, rm
293 A strh \rt, [\rn, -\rm]!
298 .macro strh_post rt, rn, rm
299 A strh \rt, [\rn], \rm
304 .macro strh_dpost rt, rn, rm
305 A strh \rt, [\rn], -\rm
311 ELF .eabi_attribute 28, 1
319 #define GLUE(a, b) a ## b
320 #define JOIN(a, b) GLUE(a, b)
321 #define X(s) JOIN(EXTERN_ASM, s)