mn10300.c: New file for Matsushita MN10300 port.
[gcc.git] / gcc / ginclude / ppc-asm.h
1 /* PowerPC asm definitions for GNU C. */
2 /* Under winnt, 1) gas suppports the following as names and 2) in particular
3 defining "toc" breaks the FUNC_START macro as ".toc" becomes ".2" */
4
5 #if !defined(__WINNT__)
6 #define r0 0
7 #define sp 1
8 #define toc 2
9 #define r3 3
10 #define r4 4
11 #define r5 5
12 #define r6 6
13 #define r7 7
14 #define r8 8
15 #define r9 9
16 #define r10 10
17 #define r11 11
18 #define r12 12
19 #define r13 13
20 #define r14 14
21 #define r15 15
22 #define r16 16
23 #define r17 17
24 #define r18 18
25 #define r19 19
26 #define r20 20
27 #define r21 21
28 #define r22 22
29 #define r23 23
30 #define r24 24
31 #define r25 25
32 #define r26 26
33 #define r27 27
34 #define r28 28
35 #define r29 29
36 #define r30 30
37 #define r31 31
38 #endif
39
40 /*
41 * Macros to glue together two tokens.
42 */
43
44 #ifdef __STDC__
45 #define XGLUE(a,b) a##b
46 #else
47 #define XGLUE(a,b) a/**/b
48 #endif
49
50 #define GLUE(a,b) XGLUE(a,b)
51
52 /*
53 * Macros to begin and end a function written in assembler. If -mcall-aixdesc
54 * or -mcall-nt, create a function descriptor with the given name, and create
55 * the real function with one or two leading periods respectively.
56 */
57
58 #ifdef _RELOCATABLE
59 #define DESC_SECTION ".got2"
60 #else
61 #define DESC_SECTION ".got1"
62 #endif
63
64 #if defined(_CALL_AIXDESC)
65 #define FUNC_NAME(name) GLUE(.,name)
66 #define FUNC_START(name) \
67 .section DESC_SECTION,"aw"; \
68 name: \
69 .long GLUE(.,name); \
70 .long _GLOBAL_OFFSET_TABLE_; \
71 .long 0; \
72 .previous; \
73 .type GLUE(.,name),@function; \
74 .globl name; \
75 .globl GLUE(.,name); \
76 GLUE(.,name):
77
78 #define FUNC_END(name) \
79 GLUE(.L,name): \
80 .size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
81
82 #elif defined(__WINNT__)
83 #define FUNC_NAME(name) GLUE(..,name)
84 #define FUNC_START(name) \
85 .pdata; \
86 .align 2; \
87 .ualong GLUE(..,name),GLUE(name,.e),0,0,GLUE(..,name); \
88 .reldata; \
89 name: \
90 .ualong GLUE(..,name),.toc; \
91 .section .text; \
92 .globl name; \
93 .globl GLUE(..,name); \
94 GLUE(..,name):
95
96 #define FUNC_END(name) \
97 GLUE(name,.e): ; \
98 GLUE(FE_MOT_RESVD..,name):
99
100 #elif defined(_CALL_NT)
101 #define FUNC_NAME(name) GLUE(..,name)
102 #define FUNC_START(name) \
103 .section DESC_SECTION,"aw"; \
104 name: \
105 .long GLUE(..,name); \
106 .long _GLOBAL_OFFSET_TABLE_; \
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 #else
118 #define FUNC_NAME(name) name
119 #define FUNC_START(name) \
120 .type name,@function; \
121 .globl name; \
122 name:
123
124 #define FUNC_END(name) \
125 GLUE(.L,name): \
126 .size name,GLUE(.L,name)-name
127 #endif
128