Statistics
| Branch: | Revision:

ffmpeg / libavcodec / ppc / asm.S @ 2912e87a

History | View | Annotate | Download (2.2 KB)

1
/*
2
 * Copyright (c) 2009 Loren Merritt
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
#define GLUE(a, b) a ## b
24
#define JOIN(a, b) GLUE(a, b)
25
#define X(s) JOIN(EXTERN_ASM, s)
26

    
27
#if ARCH_PPC64
28

    
29
#define PTR  .quad
30
#define lp   ld
31
#define lpx  ldx
32
#define stp  std
33
#define stpu stdu
34
#define PS   8
35
#define L(s) JOIN(., s)
36

    
37
.macro extfunc name
38
    .global X(\name)
39
    .section .opd, "aw"
40
X(\name):
41
    .quad L(\name), .TOC.@tocbase, 0
42
    .previous
43
    .type X(\name), STT_FUNC
44
L(\name):
45
.endm
46

    
47
.macro movrel rd, sym
48
    ld      \rd, \sym@got(r2)
49
.endm
50

    
51
#else /* ARCH_PPC64 */
52

    
53
#define PTR  .int
54
#define lp   lwz
55
#define lpx  lwzx
56
#define stp  stw
57
#define stpu stwu
58
#define PS   4
59
#define L(s) s
60

    
61
.macro extfunc name
62
    .global X(\name)
63
    .type   X(\name), STT_FUNC
64
X(\name):
65
\name:
66
.endm
67

    
68
.macro movrel rd, sym
69
#if CONFIG_PIC
70
    lwz     \rd, \sym@got(r2)
71
#else
72
    lis     \rd, \sym@ha
73
    la      \rd, \sym@l(\rd)
74
#endif
75
.endm
76

    
77
#endif /* ARCH_PPC64 */
78

    
79
#if HAVE_IBM_ASM
80

    
81
.macro DEFINE_REG n
82
    .equiv r\n, \n
83
    .equiv f\n, \n
84
    .equiv v\n, \n
85
.endm
86

    
87
DEFINE_REG 0
88
DEFINE_REG 1
89
DEFINE_REG 2
90
DEFINE_REG 3
91
DEFINE_REG 4
92
DEFINE_REG 5
93
DEFINE_REG 6
94
DEFINE_REG 7
95
DEFINE_REG 8
96
DEFINE_REG 9
97
DEFINE_REG 10
98
DEFINE_REG 11
99
DEFINE_REG 12
100
DEFINE_REG 13
101
DEFINE_REG 14
102
DEFINE_REG 15
103
DEFINE_REG 16
104
DEFINE_REG 17
105
DEFINE_REG 18
106
DEFINE_REG 19
107
DEFINE_REG 20
108
DEFINE_REG 21
109
DEFINE_REG 22
110
DEFINE_REG 23
111
DEFINE_REG 24
112
DEFINE_REG 25
113
DEFINE_REG 26
114
DEFINE_REG 27
115
DEFINE_REG 28
116
DEFINE_REG 29
117
DEFINE_REG 30
118
DEFINE_REG 31
119

    
120
#endif /* HAVE_IBM_ASM */