2008-10-27 00:25:06 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
|
|
|
|
*
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2008-12-30 03:13:52 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2009-07-27 12:53:44 +00:00
|
|
|
#ifdef __ELF__
|
2009-07-27 22:55:55 +00:00
|
|
|
# define ELF
|
|
|
|
#else
|
|
|
|
# define ELF @
|
2009-07-27 12:53:44 +00:00
|
|
|
#endif
|
2009-07-27 22:55:55 +00:00
|
|
|
|
2010-06-29 14:48:41 +00:00
|
|
|
.macro require8 val=1
|
2009-07-27 22:55:55 +00:00
|
|
|
ELF .eabi_attribute 24, \val
|
2010-06-29 14:48:41 +00:00
|
|
|
.endm
|
2008-10-27 00:25:06 +00:00
|
|
|
|
2010-06-29 14:48:41 +00:00
|
|
|
.macro preserve8 val=1
|
2009-07-27 22:55:55 +00:00
|
|
|
ELF .eabi_attribute 25, \val
|
2010-06-29 14:48:41 +00:00
|
|
|
.endm
|
2008-10-27 00:25:06 +00:00
|
|
|
|
2010-06-29 14:48:41 +00:00
|
|
|
.macro function name, export=0
|
|
|
|
.macro endfunc
|
2010-03-10 21:39:58 +00:00
|
|
|
ELF .size \name, . - \name
|
2010-03-09 16:17:56 +00:00
|
|
|
.endfunc
|
|
|
|
.purgem endfunc
|
2010-06-29 14:48:41 +00:00
|
|
|
.endm
|
2010-07-07 20:09:41 +00:00
|
|
|
.text
|
2010-06-29 14:48:41 +00:00
|
|
|
.if \export
|
2009-10-02 08:42:00 +00:00
|
|
|
.global EXTERN_ASM\name
|
|
|
|
EXTERN_ASM\name:
|
2010-06-29 14:48:41 +00:00
|
|
|
.endif
|
2009-07-27 22:55:55 +00:00
|
|
|
ELF .type \name, %function
|
2008-10-27 00:25:06 +00:00
|
|
|
.func \name
|
|
|
|
\name:
|
2010-06-29 14:48:41 +00:00
|
|
|
.endm
|
2008-12-30 03:13:52 +00:00
|
|
|
|
2011-01-26 22:26:51 +00:00
|
|
|
.macro const name, align=2
|
|
|
|
.macro endconst
|
|
|
|
ELF .size \name, . - \name
|
|
|
|
.purgem endconst
|
|
|
|
.endm
|
|
|
|
.section .rodata
|
|
|
|
.align \align
|
|
|
|
\name:
|
|
|
|
.endm
|
|
|
|
|
2010-06-29 14:48:45 +00:00
|
|
|
.macro mov32 rd, val
|
|
|
|
#if HAVE_ARMV6T2
|
|
|
|
movw \rd, #(\val) & 0xffff
|
|
|
|
.if (\val) >> 16
|
|
|
|
movt \rd, #(\val) >> 16
|
|
|
|
.endif
|
|
|
|
#else
|
|
|
|
ldr \rd, =\val
|
|
|
|
#endif
|
|
|
|
.endm
|
|
|
|
|
2010-06-29 14:48:41 +00:00
|
|
|
.macro movrel rd, val
|
2010-09-20 21:50:46 +00:00
|
|
|
#if HAVE_ARMV6T2 && !CONFIG_PIC && !defined(__APPLE__)
|
2008-12-30 03:13:52 +00:00
|
|
|
movw \rd, #:lower16:\val
|
|
|
|
movt \rd, #:upper16:\val
|
|
|
|
#else
|
|
|
|
ldr \rd, =\val
|
|
|
|
#endif
|
2010-06-29 14:48:41 +00:00
|
|
|
.endm
|
2009-07-20 22:30:24 +00:00
|
|
|
|
|
|
|
#if HAVE_VFP_ARGS
|
|
|
|
.eabi_attribute 28, 1
|
|
|
|
# define VFP
|
|
|
|
# define NOVFP @
|
|
|
|
#else
|
|
|
|
# define VFP @
|
|
|
|
# define NOVFP
|
|
|
|
#endif
|
2009-10-02 08:42:00 +00:00
|
|
|
|
|
|
|
#define GLUE(a, b) a ## b
|
|
|
|
#define JOIN(a, b) GLUE(a, b)
|
|
|
|
#define X(s) JOIN(EXTERN_ASM, s)
|