Mercurial > hg > CbC > CbC_gcc
annotate gcc/config/m68k/linux.h @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
rev | line source |
---|---|
0 | 1 /* Definitions for Motorola 68k running Linux-based GNU systems with |
2 ELF format. | |
131 | 3 Copyright (C) 1995-2018 Free Software Foundation, Inc. |
0 | 4 |
5 This file is part of GCC. | |
6 | |
7 GCC is free software; you can redistribute it and/or modify | |
8 it under the terms of the GNU General Public License as published by | |
9 the Free Software Foundation; either version 3, or (at your option) | |
10 any later version. | |
11 | |
12 GCC is distributed in the hope that it will be useful, | |
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 | |
18 along with GCC; see the file COPYING3. If not see | |
19 <http://www.gnu.org/licenses/>. */ | |
20 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
21 /* Add %(asm_cpu_spec) to a generic definition of ASM_SPEC. */ |
0 | 22 #undef ASM_SPEC |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
23 #define ASM_SPEC "%(asm_cpu_spec) %(asm_pcrel_spec)" |
0 | 24 |
25 #undef PREFERRED_STACK_BOUNDARY | |
26 #define PREFERRED_STACK_BOUNDARY 32 | |
27 | |
28 /* for 68k machines this only needs to be TRUE for the 68000 */ | |
29 | |
30 #undef STRICT_ALIGNMENT | |
31 #define STRICT_ALIGNMENT 0 | |
32 #undef M68K_HONOR_TARGET_STRICT_ALIGNMENT | |
33 #define M68K_HONOR_TARGET_STRICT_ALIGNMENT 0 | |
34 | |
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. | |
48 These labels will not appear in the symbol table. */ | |
49 | |
50 #undef LOCAL_LABEL_PREFIX | |
51 #define LOCAL_LABEL_PREFIX "." | |
52 | |
53 /* The prefix to add to user-visible assembler symbols. */ | |
54 | |
55 #undef USER_LABEL_PREFIX | |
56 #define USER_LABEL_PREFIX "" | |
57 | |
58 #define ASM_COMMENT_START "|" | |
59 | |
60 /* Target OS builtins. */ | |
111 | 61 #define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS() |
0 | 62 |
63 #undef CPP_SPEC | |
64 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" | |
65 | |
66 /* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support | |
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 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
69 combinations of options at link-time. |
0 | 70 |
71 When the -shared link option is used a final link is not being | |
72 done. */ | |
73 | |
74 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" | |
75 | |
76 #undef LINK_SPEC | |
77 #define LINK_SPEC "-m m68kelf %{shared} \ | |
78 %{!shared: \ | |
79 %{!static: \ | |
80 %{rdynamic:-export-dynamic} \ | |
111 | 81 -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \ |
0 | 82 %{static}}" |
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 | |
95 #define ASM_RETURN_CASE_JUMP \ | |
96 do { \ | |
97 if (TARGET_COLDFIRE) \ | |
98 { \ | |
99 if (ADDRESS_REG_P (operands[0])) \ | |
100 return "jmp %%pc@(2,%0:l)"; \ | |
111 | 101 else if (TARGET_LONG_JUMP_TABLE_OFFSETS) \ |
102 return "jmp %%pc@(2,%0:l)"; \ | |
0 | 103 else \ |
104 return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ | |
105 } \ | |
111 | 106 else if (TARGET_LONG_JUMP_TABLE_OFFSETS) \ |
107 return "jmp %%pc@(2,%0:l)"; \ | |
0 | 108 else \ |
109 return "jmp %%pc@(2,%0:w)"; \ | |
110 } while (0) | |
111 | |
112 /* This is how to output an assembler line that says to advance the | |
113 location counter to a multiple of 2**LOG bytes. */ | |
114 | |
115 #undef ASM_OUTPUT_ALIGN | |
116 #define ASM_OUTPUT_ALIGN(FILE,LOG) \ | |
117 if ((LOG) > 0) \ | |
118 fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); | |
119 | |
120 /* If defined, a C expression whose value is a string containing the | |
121 assembler operation to identify the following data as uninitialized global | |
122 data. */ | |
123 | |
124 #define BSS_SECTION_ASM_OP "\t.section\t.bss" | |
125 | |
126 /* A C statement (sans semicolon) to output to the stdio stream | |
127 FILE the assembler definition of uninitialized global DECL named | |
128 NAME whose size is SIZE bytes and alignment is ALIGN bytes. | |
129 Try to use asm_output_aligned_bss to implement this macro. */ | |
130 | |
131 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ | |
132 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) | |
133 | |
134 /* Output assembler code to FILE to increment profiler label # LABELNO | |
135 for profiling a function entry. */ | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
136 #define NO_PROFILE_COUNTERS 1 |
0 | 137 #undef FUNCTION_PROFILER |
138 #define FUNCTION_PROFILER(FILE, LABELNO) \ | |
139 { \ | |
140 if (flag_pic) \ | |
141 fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ | |
142 else \ | |
143 fprintf (FILE, "\tjbsr _mcount\n"); \ | |
144 } | |
145 | |
146 /* Do not break .stabs pseudos into continuations. */ | |
147 | |
148 #define DBX_CONTIN_LENGTH 0 | |
149 | |
150 /* 1 if N is a possible register number for a function value. For | |
151 m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, | |
152 pointer, or floating types, respectively. Reject fp0 if not using | |
153 a 68881 coprocessor. */ | |
154 | |
155 #undef FUNCTION_VALUE_REGNO_P | |
156 #define FUNCTION_VALUE_REGNO_P(N) \ | |
157 ((N) == D0_REG || (N) == A0_REG || (TARGET_68881 && (N) == FP0_REG)) | |
158 | |
159 /* Define this to be true when FUNCTION_VALUE_REGNO_P is true for | |
160 more than one register. */ | |
161 | |
162 #undef NEEDS_UNTYPED_CALL | |
163 #define NEEDS_UNTYPED_CALL 1 | |
164 | |
165 /* Define how to generate (in the callee) the output value of a | |
166 function and how to find (in the caller) the value returned by a | |
167 function. VALTYPE is the data type of the value (as a tree). If | |
168 the precise function being called is known, FUNC is its | |
169 FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the | |
170 result in d0, a0, or fp0 as appropriate. */ | |
171 | |
172 #undef FUNCTION_VALUE | |
173 #define FUNCTION_VALUE(VALTYPE, FUNC) \ | |
174 m68k_function_value (VALTYPE, FUNC) | |
175 | |
176 /* Define how to find the value returned by a library function | |
177 assuming the value has mode MODE. | |
178 For m68k/SVR4 look for integer values in d0, pointer values in d0 | |
179 (returned in both d0 and a0), and floating values in fp0. */ | |
180 | |
181 #undef LIBCALL_VALUE | |
182 #define LIBCALL_VALUE(MODE) \ | |
183 m68k_libcall_value (MODE) | |
184 | |
185 /* For m68k SVR4, structures are returned using the reentrant | |
186 technique. */ | |
187 #undef PCC_STATIC_STRUCT_RETURN | |
188 #define DEFAULT_PCC_STRUCT_RETURN 0 | |
189 | |
190 /* Finalize the trampoline by flushing the insn cache. */ | |
191 | |
192 #undef FINALIZE_TRAMPOLINE | |
193 #define FINALIZE_TRAMPOLINE(TRAMP) \ | |
194 emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ | |
111 | 195 LCT_NORMAL, VOIDmode, TRAMP, Pmode, \ |
196 plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ | |
197 Pmode); | |
0 | 198 |
199 /* Clear the instruction cache from `beg' to `end'. This makes an | |
200 inline system call to SYS_cacheflush. The arguments are as | |
201 follows: | |
202 | |
203 cacheflush (addr, scope, cache, len) | |
204 | |
205 addr - the start address for the flush | |
206 scope - the scope of the flush (see the cpush insn) | |
207 cache - which cache to flush (see the cpush insn) | |
208 len - a factor relating to the number of flushes to perform: | |
209 len/16 lines, or len/4096 pages. */ | |
210 | |
211 #define CLEAR_INSN_CACHE(BEG, END) \ | |
212 { \ | |
213 register unsigned long _beg __asm ("%d1") = (unsigned long) (BEG); \ | |
214 unsigned long _end = (unsigned long) (END); \ | |
215 register unsigned long _len __asm ("%d4") = (_end - _beg + 32); \ | |
216 __asm __volatile \ | |
217 ("move%.l #123, %/d0\n\t" /* system call nr */ \ | |
218 "move%.l #1, %/d2\n\t" /* clear lines */ \ | |
219 "move%.l #3, %/d3\n\t" /* insn+data caches */ \ | |
220 "trap #0" \ | |
221 : /* no outputs */ \ | |
222 : "d" (_beg), "d" (_len) \ | |
223 : "%d0", "%d2", "%d3"); \ | |
224 } | |
225 | |
226 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack | |
227 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
228 #undef DBX_REGISTER_NUMBER |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
229 #define DBX_REGISTER_NUMBER(REGNO) (REGNO) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
230 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
231 #undef SIZE_TYPE |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
232 #define SIZE_TYPE "unsigned int" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
233 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
234 #undef PTRDIFF_TYPE |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
235 #define PTRDIFF_TYPE "int" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
236 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
237 #undef WCHAR_TYPE |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
238 #define WCHAR_TYPE "long int" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
239 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
240 #undef WCHAR_TYPE_SIZE |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
241 #define WCHAR_TYPE_SIZE BITS_PER_WORD |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
242 |
111 | 243 /* Install the __sync libcalls. */ |
244 #undef TARGET_INIT_LIBFUNCS | |
245 #define TARGET_INIT_LIBFUNCS m68k_init_sync_libfuncs |