Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | /* |
2 | * Copyright (c) 2009 Loren Merritt |
||
3 | * |
||
4 | * This file is part of FFmpeg. |
||
5 | * |
||
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. |
||
10 | * |
||
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. |
||
15 | * |
||
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 |
||
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, gp |
||
48 | ld \rd, \sym@got(r2) |
||
49 | .endm |
||
50 | |||
51 | .macro get_got rd |
||
52 | .endm |
||
53 | |||
54 | #else /* ARCH_PPC64 */ |
||
55 | |||
56 | #define PTR .int |
||
57 | #define lp lwz |
||
58 | #define lpx lwzx |
||
59 | #define stp stw |
||
60 | #define stpu stwu |
||
61 | #define PS 4 |
||
62 | #define L(s) s |
||
63 | |||
64 | .macro extfunc name |
||
65 | .global X(\name) |
||
66 | .type X(\name), STT_FUNC |
||
67 | X(\name): |
||
68 | \name: |
||
69 | .endm |
||
70 | |||
71 | .macro movrel rd, sym, gp |
||
72 | #if CONFIG_PIC |
||
73 | lwz \rd, \sym@got(\gp) |
||
74 | #else |
||
75 | lis \rd, \sym@ha |
||
76 | la \rd, \sym@l(\rd) |
||
77 | #endif |
||
78 | .endm |
||
79 | |||
80 | .macro get_got rd |
||
81 | #if CONFIG_PIC |
||
82 | bcl 20, 31, .Lgot\@ |
||
83 | .Lgot\@: |
||
84 | mflr \rd |
||
85 | addis \rd, \rd, _GLOBAL_OFFSET_TABLE_ - .Lgot\@@ha |
||
86 | addi \rd, \rd, _GLOBAL_OFFSET_TABLE_ - .Lgot\@@l |
||
87 | #endif |
||
88 | .endm |
||
89 | |||
90 | #endif /* ARCH_PPC64 */ |
||
91 | |||
92 | #if HAVE_IBM_ASM |
||
93 | |||
94 | .macro DEFINE_REG n |
||
95 | .equiv r\n, \n |
||
96 | .equiv f\n, \n |
||
97 | .equiv v\n, \n |
||
98 | .endm |
||
99 | |||
100 | DEFINE_REG 0 |
||
101 | DEFINE_REG 1 |
||
102 | DEFINE_REG 2 |
||
103 | DEFINE_REG 3 |
||
104 | DEFINE_REG 4 |
||
105 | DEFINE_REG 5 |
||
106 | DEFINE_REG 6 |
||
107 | DEFINE_REG 7 |
||
108 | DEFINE_REG 8 |
||
109 | DEFINE_REG 9 |
||
110 | DEFINE_REG 10 |
||
111 | DEFINE_REG 11 |
||
112 | DEFINE_REG 12 |
||
113 | DEFINE_REG 13 |
||
114 | DEFINE_REG 14 |
||
115 | DEFINE_REG 15 |
||
116 | DEFINE_REG 16 |
||
117 | DEFINE_REG 17 |
||
118 | DEFINE_REG 18 |
||
119 | DEFINE_REG 19 |
||
120 | DEFINE_REG 20 |
||
121 | DEFINE_REG 21 |
||
122 | DEFINE_REG 22 |
||
123 | DEFINE_REG 23 |
||
124 | DEFINE_REG 24 |
||
125 | DEFINE_REG 25 |
||
126 | DEFINE_REG 26 |
||
127 | DEFINE_REG 27 |
||
128 | DEFINE_REG 28 |
||
129 | DEFINE_REG 29 |
||
130 | DEFINE_REG 30 |
||
131 | DEFINE_REG 31 |
||
132 | |||
133 | #endif /* HAVE_IBM_ASM */ |