]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/m68k/m68kelf.h
linux.h (FUNCTION_VALUE_REGNO_P): Use macros for register numbers more.
[thirdparty/gcc.git] / gcc / config / m68k / m68kelf.h
1 /* m68kelf support, derived from m68kv4.h */
2
3 /* Target definitions for GNU compiler for mc680x0 running System V.4
4 Copyright (C) 1991, 1993, 2000, 2002, 2003, 2004
5 Free Software Foundation, Inc.
6
7 Written by Ron Guilmette (rfg@netcom.com) and Fred Fish (fnf@cygnus.com).
8
9 This file is part of GCC.
10
11 GCC is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
14 any later version.
15
16 GCC is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with GCC; see the file COPYING. If not, write to
23 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA. */
25
26
27 #ifndef SWBEG_ASM_OP
28 #define SWBEG_ASM_OP "\t.swbeg\t"
29 #endif
30
31 /* Here are three prefixes that are used by asm_fprintf to
32 facilitate customization for alternate assembler syntaxes.
33 Machines with no likelihood of an alternate syntax need not
34 define these and need not use asm_fprintf. */
35
36 /* The prefix for register names. Note that REGISTER_NAMES
37 is supposed to include this prefix. Also note that this is NOT an
38 fprintf format string, it is a literal string */
39
40 #undef REGISTER_PREFIX
41 #define REGISTER_PREFIX "%"
42
43 /* The prefix for local (compiler generated) labels.
44 These labels will not appear in the symbol table. */
45
46 #undef LOCAL_LABEL_PREFIX
47 #define LOCAL_LABEL_PREFIX "."
48
49 /* The prefix to add to user-visible assembler symbols. */
50
51 #undef USER_LABEL_PREFIX
52 #define USER_LABEL_PREFIX ""
53
54 /* config/m68k.md has an explicit reference to the program counter,
55 prefix this by the register prefix. */
56
57 #define ASM_RETURN_CASE_JUMP \
58 do { \
59 if (TARGET_COLDFIRE) \
60 { \
61 if (ADDRESS_REG_P (operands[0])) \
62 return "jmp %%pc@(2,%0:l)"; \
63 else \
64 return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \
65 } \
66 else \
67 return "jmp %%pc@(2,%0:w)"; \
68 } while (0)
69
70 /* This is how to output an assembler line that says to advance the
71 location counter to a multiple of 2**LOG bytes. */
72
73 #undef ASM_OUTPUT_ALIGN
74 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
75 do { \
76 if ((LOG) > 0) \
77 fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); \
78 } while (0)
79
80 /* Register in which address to store a structure value is passed to a
81 function. The default in m68k.h is a1. For m68k/SVR4 it is a0. */
82
83 #undef M68K_STRUCT_VALUE_REGNUM
84 #define M68K_STRUCT_VALUE_REGNUM A0_REG
85
86 /* The static chain regnum defaults to a0, but we use that for
87 structure return, so have to use a1 for the static chain. */
88
89 #undef STATIC_CHAIN_REGNUM
90 #define STATIC_CHAIN_REGNUM A1_REG
91 #undef M68K_STATIC_CHAIN_REG_NAME
92 #define M68K_STATIC_CHAIN_REG_NAME REGISTER_PREFIX "a1"
93
94 #define ASM_COMMENT_START "|"
95
96 /* Define how the m68k registers should be numbered for Dwarf output.
97 The numbering provided here should be compatible with the native
98 SVR4 SDB debugger in the m68k/SVR4 reference port, where d0-d7
99 are 0-7, a0-a8 are 8-15, and fp0-fp7 are 16-23. */
100
101 #undef DBX_REGISTER_NUMBER
102 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
103
104 #if 0
105 /* SVR4 m68k assembler is bitching on the `comm i,1,1' which askes for
106 1 byte alignment. Don't generate alignment for COMMON seems to be
107 safer until we the assembler is fixed. */
108 #undef ASM_OUTPUT_ALIGNED_COMMON
109 /* Same problem with this one. */
110 #undef ASM_OUTPUT_ALIGNED_LOCAL
111 #endif
112
113 #undef ASM_OUTPUT_COMMON
114 #undef ASM_OUTPUT_LOCAL
115 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
116 ( fputs (".comm ", (FILE)), \
117 assemble_name ((FILE), (NAME)), \
118 fprintf ((FILE), ",%u\n", (int)(SIZE)))
119
120 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
121 ( fputs (".lcomm ", (FILE)), \
122 assemble_name ((FILE), (NAME)), \
123 fprintf ((FILE), ",%u\n", (int)(SIZE)))
124
125 /* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to
126 keep switch tables in the text section. */
127
128 #define JUMP_TABLES_IN_TEXT_SECTION 1
129
130 /* Override the definition in svr4.h. In m68k svr4, using swbeg is the
131 standard way to do switch table. */
132 #undef ASM_OUTPUT_BEFORE_CASE_LABEL
133 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
134 fprintf ((FILE), "%s&%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1));
135 /* end of stuff from m68kv4.h */
136
137 #undef ENDFILE_SPEC
138 #define ENDFILE_SPEC "crtend.o%s"
139
140 #undef STARTFILE_SPEC
141 #define STARTFILE_SPEC "crtbegin.o%s"
142
143 /* If defined, a C expression whose value is a string containing the
144 assembler operation to identify the following data as
145 uninitialized global data. If not defined, and neither
146 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
147 uninitialized global data will be output in the data section if
148 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
149 used. */
150 #ifndef BSS_SECTION_ASM_OP
151 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
152 #endif
153
154 /* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
155 separate, explicit argument. If you define this macro, it is used
156 in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
157 handling the required alignment of the variable. The alignment is
158 specified as the number of bits.
159
160 Try to use function `asm_output_aligned_bss' defined in file
161 `varasm.c' when defining this macro. */
162 #ifndef ASM_OUTPUT_ALIGNED_BSS
163 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
164 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
165 #endif