OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [config/] [rs6000/] [ppc-asm.h] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
/* PowerPC asm definitions for GNU C.  */
2
/* Under winnt, 1) gas supports the following as names and 2) in particular
3
   defining "toc" breaks the FUNC_START macro as ".toc" becomes ".2" */
4
 
5
#define r0      0
6
#define sp      1
7
#define toc     2
8
#define r3      3
9
#define r4      4
10
#define r5      5
11
#define r6      6
12
#define r7      7
13
#define r8      8
14
#define r9      9
15
#define r10     10
16
#define r11     11
17
#define r12     12
18
#define r13     13
19
#define r14     14
20
#define r15     15
21
#define r16     16
22
#define r17     17
23
#define r18     18
24
#define r19     19
25
#define r20     20
26
#define r21     21
27
#define r22     22
28
#define r23     23
29
#define r24     24
30
#define r25     25
31
#define r26     26
32
#define r27     27
33
#define r28     28
34
#define r29     29
35
#define r30     30
36
#define r31     31
37
 
38
#define cr0     0
39
#define cr1     1
40
#define cr2     2
41
#define cr3     3
42
#define cr4     4
43
#define cr5     5
44
#define cr6     6
45
#define cr7     7
46
 
47
#define f0      0
48
#define f1      1
49
#define f2      2
50
#define f3      3
51
#define f4      4
52
#define f5      5
53
#define f6      6
54
#define f7      7
55
#define f8      8
56
#define f9      9
57
#define f10     10
58
#define f11     11
59
#define f12     12
60
#define f13     13
61
#define f14     14
62
#define f15     15
63
#define f16     16
64
#define f17     17
65
#define f18     18
66
#define f19     19
67
#define f20     20
68
#define f21     21
69
#define f22     22
70
#define f23     23
71
#define f24     24
72
#define f25     25
73
#define f26     26
74
#define f27     27
75
#define f28     28
76
#define f29     29
77
#define f30     30
78
#define f31     31
79
 
80
/*
81
 * Macros to glue together two tokens.
82
 */
83
 
84
#ifdef __STDC__
85
#define XGLUE(a,b) a##b
86
#else
87
#define XGLUE(a,b) a/**/b
88
#endif
89
 
90
#define GLUE(a,b) XGLUE(a,b)
91
 
92
/*
93
 * Macros to begin and end a function written in assembler.  If -mcall-aixdesc
94
 * or -mcall-nt, create a function descriptor with the given name, and create
95
 * the real function with one or two leading periods respectively.
96
 */
97
 
98
#if defined (__powerpc64__)
99
#define FUNC_NAME(name) GLUE(.,name)
100
#define JUMP_TARGET(name) FUNC_NAME(name)
101
#define FUNC_START(name) \
102
        .section ".opd","aw"; \
103
name: \
104
        .quad GLUE(.,name); \
105
        .quad .TOC.@tocbase; \
106
        .quad 0; \
107
        .previous; \
108
        .type GLUE(.,name),@function; \
109
        .globl name; \
110
        .globl GLUE(.,name); \
111
GLUE(.,name):
112
 
113
#define FUNC_END(name) \
114
GLUE(.L,name): \
115
        .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
116
 
117
#elif defined(_CALL_AIXDESC)
118
 
119
#ifdef _RELOCATABLE
120
#define DESC_SECTION ".got2"
121
#else
122
#define DESC_SECTION ".got1"
123
#endif
124
 
125
#define FUNC_NAME(name) GLUE(.,name)
126
#define JUMP_TARGET(name) FUNC_NAME(name)
127
#define FUNC_START(name) \
128
        .section DESC_SECTION,"aw"; \
129
name: \
130
        .long GLUE(.,name); \
131
        .long _GLOBAL_OFFSET_TABLE_; \
132
        .long 0; \
133
        .previous; \
134
        .type GLUE(.,name),@function; \
135
        .globl name; \
136
        .globl GLUE(.,name); \
137
GLUE(.,name):
138
 
139
#define FUNC_END(name) \
140
GLUE(.L,name): \
141
        .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
142
 
143
#else
144
 
145
#define FUNC_NAME(name) GLUE(__USER_LABEL_PREFIX__,name)
146
#if defined __PIC__ || defined __pic__
147
#define JUMP_TARGET(name) FUNC_NAME(name@plt)
148
#else
149
#define JUMP_TARGET(name) FUNC_NAME(name)
150
#endif
151
#define FUNC_START(name) \
152
        .type FUNC_NAME(name),@function; \
153
        .globl FUNC_NAME(name); \
154
FUNC_NAME(name):
155
 
156
#define FUNC_END(name) \
157
GLUE(.L,name): \
158
        .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
159
#endif
160
 
161
#if defined __linux__ && !defined __powerpc64__
162
        .section .note.GNU-stack
163
        .previous
164
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.