]>
Commit | Line | Data |
---|---|---|
ad87de1e | 1 | /* Definitions for Motorola 68k running Linux-based GNU systems with |
2 | ELF format. | |
f1717362 | 3 | Copyright (C) 1995-2016 Free Software Foundation, Inc. |
b6d74c0b | 4 | |
187b36cf | 5 | This file is part of GCC. |
b6d74c0b | 6 | |
187b36cf | 7 | GCC is free software; you can redistribute it and/or modify |
b6d74c0b | 8 | it under the terms of the GNU General Public License as published by |
038d1e19 | 9 | the Free Software Foundation; either version 3, or (at your option) |
b6d74c0b | 10 | any later version. |
11 | ||
187b36cf | 12 | GCC is distributed in the hope that it will be useful, |
b6d74c0b | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
038d1e19 | 18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
b6d74c0b | 20 | |
91276c47 | 21 | /* Add %(asm_cpu_spec) to a generic definition of ASM_SPEC. */ |
79518b07 | 22 | #undef ASM_SPEC |
76db74b6 | 23 | #define ASM_SPEC "%(asm_cpu_spec) %(asm_pcrel_spec)" |
79518b07 | 24 | |
5d6f9661 | 25 | #undef PREFERRED_STACK_BOUNDARY |
26 | #define PREFERRED_STACK_BOUNDARY 32 | |
27 | ||
4e2da9e9 | 28 | /* for 68k machines this only needs to be TRUE for the 68000 */ |
29 | ||
3acc77d9 | 30 | #undef STRICT_ALIGNMENT |
4e2da9e9 | 31 | #define STRICT_ALIGNMENT 0 |
159cec75 | 32 | #undef M68K_HONOR_TARGET_STRICT_ALIGNMENT |
33 | #define M68K_HONOR_TARGET_STRICT_ALIGNMENT 0 | |
4e2da9e9 | 34 | |
b6d74c0b | 35 | /* Here are four prefixes that are used by asm_fprintf to |
36 | facilitate customization for alternate assembler syntaxes. | |
37 | Machines with no likelihood of an alternate syntax need not | |
38 | define these and need not use asm_fprintf. */ | |
39 | ||
40 | /* The prefix for register names. Note that REGISTER_NAMES | |
41 | is supposed to include this prefix. Also note that this is NOT an | |
42 | fprintf format string, it is a literal string */ | |
43 | ||
44 | #undef REGISTER_PREFIX | |
45 | #define REGISTER_PREFIX "%" | |
46 | ||
47 | /* The prefix for local (compiler generated) labels. | |
0c0492c9 | 48 | These labels will not appear in the symbol table. */ |
b6d74c0b | 49 | |
50 | #undef LOCAL_LABEL_PREFIX | |
51 | #define LOCAL_LABEL_PREFIX "." | |
52 | ||
0c0492c9 | 53 | /* The prefix to add to user-visible assembler symbols. */ |
b6d74c0b | 54 | |
55 | #undef USER_LABEL_PREFIX | |
56 | #define USER_LABEL_PREFIX "" | |
57 | ||
6872db91 | 58 | #define ASM_COMMENT_START "|" |
59 | ||
cfb5e11e | 60 | /* Target OS builtins. */ |
493a87fa | 61 | #define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS() |
6abe46e3 | 62 | |
b6d74c0b | 63 | #undef CPP_SPEC |
f84195ec | 64 | #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" |
b6d74c0b | 65 | |
ad87de1e | 66 | /* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support |
b6d74c0b | 67 | for the special GCC options -static and -shared, which allow us to |
68 | link things in one of these three modes by applying the appropriate | |
efe15a41 | 69 | combinations of options at link-time. |
b6d74c0b | 70 | |
71 | When the -shared link option is used a final link is not being | |
72 | done. */ | |
73 | ||
c490c13b | 74 | #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" |
75 | ||
d2a91c7e | 76 | #undef LINK_SPEC |
9c4bcd28 | 77 | #define LINK_SPEC "-m m68kelf %{shared} \ |
78 | %{!shared: \ | |
909810ed | 79 | %{!static: \ |
9c4bcd28 | 80 | %{rdynamic:-export-dynamic} \ |
493a87fa | 81 | -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \ |
9c4bcd28 | 82 | %{static}}" |
b6d74c0b | 83 | |
84 | /* For compatibility with linux/a.out */ | |
85 | ||
86 | #undef PCC_BITFIELD_TYPE_MATTERS | |
87 | ||
88 | /* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to | |
89 | keep switch tables in the text section. */ | |
90 | ||
91 | #define JUMP_TABLES_IN_TEXT_SECTION 1 | |
92 | ||
93 | /* Use the default action for outputting the case label. */ | |
94 | #undef ASM_OUTPUT_CASE_LABEL | |
251538ce | 95 | #define ASM_RETURN_CASE_JUMP \ |
96 | do { \ | |
960e6739 | 97 | if (TARGET_COLDFIRE) \ |
251538ce | 98 | { \ |
99 | if (ADDRESS_REG_P (operands[0])) \ | |
100 | return "jmp %%pc@(2,%0:l)"; \ | |
101 | else \ | |
102 | return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ | |
103 | } \ | |
104 | else \ | |
105 | return "jmp %%pc@(2,%0:w)"; \ | |
3345acd8 | 106 | } while (0) |
b6d74c0b | 107 | |
108 | /* This is how to output an assembler line that says to advance the | |
109 | location counter to a multiple of 2**LOG bytes. */ | |
110 | ||
111 | #undef ASM_OUTPUT_ALIGN | |
112 | #define ASM_OUTPUT_ALIGN(FILE,LOG) \ | |
113 | if ((LOG) > 0) \ | |
ff60eaf8 | 114 | fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); |
b6d74c0b | 115 | |
d127b0b2 | 116 | /* If defined, a C expression whose value is a string containing the |
117 | assembler operation to identify the following data as uninitialized global | |
118 | data. */ | |
119 | ||
abfc0262 | 120 | #define BSS_SECTION_ASM_OP "\t.section\t.bss" |
d127b0b2 | 121 | |
122 | /* A C statement (sans semicolon) to output to the stdio stream | |
31b06af8 | 123 | FILE the assembler definition of uninitialized global DECL named |
d127b0b2 | 124 | NAME whose size is SIZE bytes and alignment is ALIGN bytes. |
125 | Try to use asm_output_aligned_bss to implement this macro. */ | |
126 | ||
31b06af8 | 127 | #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ |
128 | asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) | |
d127b0b2 | 129 | |
b6d74c0b | 130 | /* Output assembler code to FILE to increment profiler label # LABELNO |
131 | for profiling a function entry. */ | |
282f2a72 | 132 | #define NO_PROFILE_COUNTERS 1 |
b6d74c0b | 133 | #undef FUNCTION_PROFILER |
134 | #define FUNCTION_PROFILER(FILE, LABELNO) \ | |
135 | { \ | |
b6d74c0b | 136 | if (flag_pic) \ |
137 | fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ | |
138 | else \ | |
139 | fprintf (FILE, "\tjbsr _mcount\n"); \ | |
140 | } | |
141 | ||
b6d74c0b | 142 | /* Do not break .stabs pseudos into continuations. */ |
143 | ||
144 | #define DBX_CONTIN_LENGTH 0 | |
145 | ||
b6d74c0b | 146 | /* 1 if N is a possible register number for a function value. For |
147 | m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, | |
148 | pointer, or floating types, respectively. Reject fp0 if not using | |
149 | a 68881 coprocessor. */ | |
150 | ||
151 | #undef FUNCTION_VALUE_REGNO_P | |
152 | #define FUNCTION_VALUE_REGNO_P(N) \ | |
9d463c3d | 153 | ((N) == D0_REG || (N) == A0_REG || (TARGET_68881 && (N) == FP0_REG)) |
b6d74c0b | 154 | |
155 | /* Define this to be true when FUNCTION_VALUE_REGNO_P is true for | |
156 | more than one register. */ | |
157 | ||
158 | #undef NEEDS_UNTYPED_CALL | |
159 | #define NEEDS_UNTYPED_CALL 1 | |
160 | ||
161 | /* Define how to generate (in the callee) the output value of a | |
162 | function and how to find (in the caller) the value returned by a | |
163 | function. VALTYPE is the data type of the value (as a tree). If | |
164 | the precise function being called is known, FUNC is its | |
165 | FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the | |
0c0492c9 | 166 | result in d0, a0, or fp0 as appropriate. */ |
3acc77d9 | 167 | |
b6d74c0b | 168 | #undef FUNCTION_VALUE |
169 | #define FUNCTION_VALUE(VALTYPE, FUNC) \ | |
58c23110 | 170 | m68k_function_value (VALTYPE, FUNC) |
b6d74c0b | 171 | |
b6d74c0b | 172 | /* Define how to find the value returned by a library function |
173 | assuming the value has mode MODE. | |
174 | For m68k/SVR4 look for integer values in d0, pointer values in d0 | |
175 | (returned in both d0 and a0), and floating values in fp0. */ | |
176 | ||
177 | #undef LIBCALL_VALUE | |
178 | #define LIBCALL_VALUE(MODE) \ | |
58c23110 | 179 | m68k_libcall_value (MODE) |
b6d74c0b | 180 | |
b6d74c0b | 181 | /* For m68k SVR4, structures are returned using the reentrant |
0c0492c9 | 182 | technique. */ |
b6d74c0b | 183 | #undef PCC_STATIC_STRUCT_RETURN |
184 | #define DEFAULT_PCC_STRUCT_RETURN 0 | |
da5bcd04 | 185 | |
2825f6cd | 186 | /* Finalize the trampoline by flushing the insn cache. */ |
cca88b52 | 187 | |
2825f6cd | 188 | #undef FINALIZE_TRAMPOLINE |
189 | #define FINALIZE_TRAMPOLINE(TRAMP) \ | |
e6b2f841 | 190 | emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ |
89871bab | 191 | LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \ |
29c05e22 | 192 | plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ |
193 | Pmode); | |
cca88b52 | 194 | |
2825f6cd | 195 | /* Clear the instruction cache from `beg' to `end'. This makes an |
196 | inline system call to SYS_cacheflush. The arguments are as | |
197 | follows: | |
198 | ||
199 | cacheflush (addr, scope, cache, len) | |
200 | ||
201 | addr - the start address for the flush | |
202 | scope - the scope of the flush (see the cpush insn) | |
203 | cache - which cache to flush (see the cpush insn) | |
204 | len - a factor relating to the number of flushes to perform: | |
3acc77d9 | 205 | len/16 lines, or len/4096 pages. */ |
2825f6cd | 206 | |
207 | #define CLEAR_INSN_CACHE(BEG, END) \ | |
208 | { \ | |
209 | register unsigned long _beg __asm ("%d1") = (unsigned long) (BEG); \ | |
210 | unsigned long _end = (unsigned long) (END); \ | |
211 | register unsigned long _len __asm ("%d4") = (_end - _beg + 32); \ | |
212 | __asm __volatile \ | |
3acc77d9 | 213 | ("move%.l #123, %/d0\n\t" /* system call nr */ \ |
214 | "move%.l #1, %/d2\n\t" /* clear lines */ \ | |
215 | "move%.l #3, %/d3\n\t" /* insn+data caches */ \ | |
216 | "trap #0" \ | |
2825f6cd | 217 | : /* no outputs */ \ |
218 | : "d" (_beg), "d" (_len) \ | |
219 | : "%d0", "%d2", "%d3"); \ | |
cca88b52 | 220 | } |
3fd62642 | 221 | |
f6940372 | 222 | #define TARGET_ASM_FILE_END file_end_indicate_exec_stack |
f3263347 | 223 | |
b86ed757 | 224 | #undef DBX_REGISTER_NUMBER |
225 | #define DBX_REGISTER_NUMBER(REGNO) (REGNO) | |
226 | ||
227 | #undef SIZE_TYPE | |
228 | #define SIZE_TYPE "unsigned int" | |
229 | ||
230 | #undef PTRDIFF_TYPE | |
231 | #define PTRDIFF_TYPE "int" | |
232 | ||
233 | #undef WCHAR_TYPE | |
234 | #define WCHAR_TYPE "long int" | |
235 | ||
236 | #undef WCHAR_TYPE_SIZE | |
237 | #define WCHAR_TYPE_SIZE BITS_PER_WORD | |
5bb27b7c | 238 | |
239 | /* Install the __sync libcalls. */ | |
240 | #undef TARGET_INIT_LIBFUNCS | |
241 | #define TARGET_INIT_LIBFUNCS m68k_init_sync_libfuncs |