1 |
12 |
jlechner |
/* Definitions of target machine for GNU compiler,
|
2 |
|
|
for the SCARTS32 micro controller.
|
3 |
|
|
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
|
4 |
|
|
Contributed by Wolfgang Puffitsch <hausen@gmx.at>
|
5 |
|
|
Martin Walter <mwalter@opencores.org>
|
6 |
|
|
|
7 |
|
|
This file is part of the SCARTS32 port of GCC
|
8 |
|
|
|
9 |
|
|
GNU CC is free software; you can redistribute it and/or modify
|
10 |
|
|
it under the terms of the GNU General Public License as published by
|
11 |
|
|
the Free Software Foundation; either version 2, or (at your option)
|
12 |
|
|
any later version.
|
13 |
|
|
|
14 |
|
|
GNU CC is distributed in the hope that it will be useful,
|
15 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17 |
|
|
GNU General Public License for more details.
|
18 |
|
|
|
19 |
|
|
You should have received a copy of the GNU General Public License
|
20 |
|
|
along with GNU CC; see the file COPYING. If not, write to
|
21 |
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
22 |
|
|
Boston, MA 02111-1307, USA. */
|
23 |
|
|
|
24 |
|
|
/* Names to predefine in the preprocessor for this target machine. */
|
25 |
|
|
|
26 |
|
|
#define TARGET_CPU_CPP_BUILTINS() \
|
27 |
|
|
do \
|
28 |
|
|
{ \
|
29 |
|
|
builtin_define("__SCARTS_32__"); \
|
30 |
|
|
builtin_define_std ("SCARTS_32"); \
|
31 |
|
|
if (scarts32_base_arch_macro) \
|
32 |
|
|
builtin_define (scarts32_base_arch_macro); \
|
33 |
|
|
if (scarts32_extra_arch_macro) \
|
34 |
|
|
builtin_define (scarts32_extra_arch_macro); \
|
35 |
|
|
} \
|
36 |
|
|
while (0)
|
37 |
|
|
|
38 |
|
|
extern const char *scarts32_base_arch_macro;
|
39 |
|
|
extern const char *scarts32_extra_arch_macro;
|
40 |
|
|
|
41 |
|
|
#define TARGET_VERSION fprintf (stderr, " (SCARTS32)");
|
42 |
|
|
|
43 |
|
|
#define OVERRIDE_OPTIONS scarts32_override_options ()
|
44 |
|
|
|
45 |
|
|
#define OPTIMIZATION_OPTIONS(level, size) scarts32_optimization_options (level, size)
|
46 |
|
|
|
47 |
|
|
#define CAN_DEBUG_WITHOUT_FP
|
48 |
|
|
|
49 |
|
|
#define BITS_BIG_ENDIAN 0
|
50 |
|
|
|
51 |
|
|
#define BYTES_BIG_ENDIAN 0
|
52 |
|
|
|
53 |
|
|
#define WORDS_BIG_ENDIAN 0
|
54 |
|
|
|
55 |
|
|
#define BITS_PER_UNIT 8
|
56 |
|
|
|
57 |
|
|
#define BITS_PER_WORD 32
|
58 |
|
|
|
59 |
|
|
#define UNITS_PER_WORD 4
|
60 |
|
|
|
61 |
|
|
#define POINTER_SIZE 32
|
62 |
|
|
|
63 |
|
|
#define PARM_BOUNDARY 32
|
64 |
|
|
|
65 |
|
|
#define STACK_BOUNDARY 32
|
66 |
|
|
|
67 |
|
|
#define FUNCTION_BOUNDARY 8
|
68 |
|
|
|
69 |
|
|
#define EMPTY_FIELD_BOUNDARY 32
|
70 |
|
|
|
71 |
|
|
#define BIGGEST_ALIGNMENT 128
|
72 |
|
|
|
73 |
|
|
#define STRICT_ALIGNMENT 1
|
74 |
|
|
|
75 |
|
|
#define INT_TYPE_SIZE 32
|
76 |
|
|
|
77 |
|
|
#define SHORT_TYPE_SIZE 16
|
78 |
|
|
|
79 |
|
|
#define LONG_TYPE_SIZE 32
|
80 |
|
|
|
81 |
|
|
#define LONG_LONG_TYPE_SIZE 64
|
82 |
|
|
|
83 |
|
|
#define FLOAT_TYPE_SIZE 32
|
84 |
|
|
|
85 |
|
|
#define DOUBLE_TYPE_SIZE 64
|
86 |
|
|
|
87 |
|
|
#define LONG_DOUBLE_TYPE_SIZE 64
|
88 |
|
|
|
89 |
|
|
#define CHAR_TYPE_SIZE 8
|
90 |
|
|
|
91 |
|
|
#define DEFAULT_SIGNED_CHAR 1
|
92 |
|
|
|
93 |
|
|
#define MAX_FIXED_MODE_SIZE 64
|
94 |
|
|
|
95 |
|
|
#define SIZE_TYPE ("long unsigned int")
|
96 |
|
|
|
97 |
|
|
#define PTRDIFF_TYPE ("long int")
|
98 |
|
|
|
99 |
|
|
#define WCHAR_TYPE ("int")
|
100 |
|
|
|
101 |
|
|
#define WINT_TYPE ("unsigned int")
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
#define FIRST_PSEUDO_REGISTER 21
|
105 |
|
|
|
106 |
|
|
#define FIXED_REGISTERS {\
|
107 |
|
|
0,0,0,0,0,0,0,0,0, /* r0-r8, temporary unpreserved */\
|
108 |
|
|
0,0,0,0, /* r9-r12, temporary preserved */\
|
109 |
|
|
1, /* r13, used as __tmp_reg__ */\
|
110 |
|
|
0, /* r14, return address */\
|
111 |
|
|
1, /* r15, exception/ISR return address */\
|
112 |
|
|
0, /* fpW, temporary unpreserved */\
|
113 |
|
|
0, /* fpX, arg pointer */\
|
114 |
|
|
1, /* fpY, frame pointer */\
|
115 |
|
|
1, /* fpZ, stack pointer */\
|
116 |
|
|
1 /* cc, condition code */ }
|
117 |
|
|
|
118 |
|
|
#define CALL_USED_REGISTERS {\
|
119 |
|
|
1,1,1,1,1,1,1,1,1, /* r0-r8, temporary unpreserved */\
|
120 |
|
|
0,0,0,0, /* r9-r12, temporary unpreserved */\
|
121 |
|
|
1, /* r13, used as __tmp_reg__ */\
|
122 |
|
|
0, /* r14, return address */\
|
123 |
|
|
1, /* r15, Exception/ISR return address */\
|
124 |
|
|
1, /* fpW, temporary unpreserved */\
|
125 |
|
|
1, /* fpX, arg pointer */\
|
126 |
|
|
1, /* fpY, frame pointer */\
|
127 |
|
|
1, /* fpZ, stack pointer */\
|
128 |
|
|
1 /* cc, condition code */ }
|
129 |
|
|
|
130 |
|
|
#define REG_ALLOC_ORDER {\
|
131 |
|
|
0,1,2,3,4,5,6,7,8, /* temporary unsaved */\
|
132 |
|
|
9,10,11,12, /* temporary saved */\
|
133 |
|
|
16, /* universal pointer */\
|
134 |
|
|
17, /* arg pointer */\
|
135 |
|
|
13, /* tmp */\
|
136 |
|
|
14, /* return address */\
|
137 |
|
|
15, /* exception/ISR return address */\
|
138 |
|
|
18, /* frame pointer */\
|
139 |
|
|
19, /* stack pointer */\
|
140 |
|
|
20 /* condition code */ }
|
141 |
|
|
|
142 |
|
|
#define HARD_REGNO_NREGS(REGNO, MODE) ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
|
143 |
|
|
|
144 |
|
|
#define HARD_REGNO_MODE_OK(REGNO, MODE) \
|
145 |
|
|
(((REGNO == PTR_W) || (REGNO == PTR_X) || (REGNO == PTR_Y) || (REGNO == PTR_Z)) ? \
|
146 |
|
|
(MODE == SImode) : 1)
|
147 |
|
|
|
148 |
|
|
#define MODES_TIEABLE_P(MODE1, MODE2) 1
|
149 |
|
|
|
150 |
|
|
enum reg_class {
|
151 |
|
|
NO_REGS,
|
152 |
|
|
POINTER_REGS, /* r16 - r19 */
|
153 |
|
|
GENERAL_REGS, /* r0 - r15 */
|
154 |
|
|
ALL_REGS, LIM_REG_CLASSES
|
155 |
|
|
};
|
156 |
|
|
|
157 |
|
|
#define N_REG_CLASSES (int)LIM_REG_CLASSES
|
158 |
|
|
|
159 |
|
|
#define REG_CLASS_NAMES {\
|
160 |
|
|
"NO_REGS",\
|
161 |
|
|
"POINTER_REGS", /* r16 - r19 */\
|
162 |
|
|
"GENERAL_REGS", /* r0 - r15 */\
|
163 |
|
|
"ALL_REGS" }
|
164 |
|
|
|
165 |
|
|
#define PTR_W 16
|
166 |
|
|
#define PTR_X 17
|
167 |
|
|
#define PTR_Y 18
|
168 |
|
|
#define PTR_Z 19
|
169 |
|
|
|
170 |
|
|
#define REG_CLASS_CONTENTS {\
|
171 |
|
|
{0x000000}, /* NO_REGS */\
|
172 |
|
|
{(1 << PTR_W)|(1 << PTR_X)|(1 << PTR_Y)|(1 << PTR_Z)},\
|
173 |
|
|
/* POINTER_REGS, r16 - r19 */\
|
174 |
|
|
{0x00ffff}, /* GENERAL_REGS, r0 - r15 */\
|
175 |
|
|
{0x1fffff} /* ALL_REGS */\
|
176 |
|
|
}
|
177 |
|
|
|
178 |
|
|
#define REGNO_REG_CLASS(R) scarts32_regno_reg_class(R)
|
179 |
|
|
|
180 |
|
|
#define BASE_REG_CLASS GENERAL_REGS
|
181 |
|
|
|
182 |
|
|
#define INDEX_REG_CLASS NO_REGS
|
183 |
|
|
|
184 |
|
|
#define REG_CLASS_FROM_LETTER(C) scarts32_reg_class_from_letter(C)
|
185 |
|
|
|
186 |
|
|
#define REGNO_OK_FOR_BASE_P(r) ((r == PTR_W) || (r == PTR_X) || (r == PTR_Y) || (r == PTR_Z))
|
187 |
|
|
|
188 |
|
|
#define REGNO_OK_FOR_INDEX_P(r) 0
|
189 |
|
|
|
190 |
|
|
#define PREFERRED_RELOAD_CLASS(X, CLASS) CLASS
|
191 |
|
|
|
192 |
|
|
#define SMALL_REGISTER_CLASSES 1
|
193 |
|
|
|
194 |
|
|
#define CLASS_LIKELY_SPILLED_P(CLASS) (CLASS == POINTER_REGS)
|
195 |
|
|
|
196 |
|
|
#define CLASS_MAX_NREGS(CLASS, MODE) \
|
197 |
|
|
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
|
198 |
|
|
|
199 |
|
|
#define CONST_OK_FOR_LETTER_P(VALUE, C) scarts32_const_ok_for_letter(VALUE, C)
|
200 |
|
|
|
201 |
|
|
#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
|
202 |
|
|
|
203 |
|
|
#define EXTRA_CONSTRAINT(x, c) extra_constraint(x, c)
|
204 |
|
|
|
205 |
|
|
#define PUSH_ARGS 0
|
206 |
|
|
|
207 |
|
|
/* Basic Stack Layout */
|
208 |
|
|
|
209 |
|
|
/* Define this macro if pushing a word onto the stack moves the stack pointer
|
210 |
|
|
* to a smaller address. When we say, "define this macro if ...," it means that
|
211 |
|
|
* the compiler checks this macro only with #ifdef so the precise definition
|
212 |
|
|
* used does not matter. */
|
213 |
|
|
#define STACK_GROWS_DOWNWARD 1
|
214 |
|
|
|
215 |
|
|
/* This macro defines the operation used when something is pushed on the stack.
|
216 |
|
|
* In RTL, a push operation will be (set (mem (STACK_PUSH_CODE (reg sp))) ...)
|
217 |
|
|
* The choices are PRE_DEC, POST_DEC, PRE_INC, and POST_INC. Which of these is
|
218 |
|
|
* correct depends on the stack direction and on whether the stack pointer
|
219 |
|
|
* points to the last item on the stack or whether it points to the space for
|
220 |
|
|
* the next item on the stack.
|
221 |
|
|
* The default is PRE_DEC when STACK_GROWS_DOWNWARD is defined, which is almost
|
222 |
|
|
* always right, and PRE_INC otherwise, which is often wrong. */
|
223 |
|
|
#define STACK_PUSH_CODE PRE_DEC
|
224 |
|
|
|
225 |
|
|
/* Define this macro if the addresses of local variable slots are at negative
|
226 |
|
|
* offsets from the frame pointer. */
|
227 |
|
|
#define FRAME_GROWS_DOWNWARD 1
|
228 |
|
|
|
229 |
|
|
/* Offset from the frame pointer to the first local variable slot to be
|
230 |
|
|
* allocated. If FRAME_GROWS_DOWNWARD, find the next slot's offset by
|
231 |
|
|
* subtracting the first slot's length from STARTING_FRAME_OFFSET.
|
232 |
|
|
* Otherwise, it is found by adding the length of the first slot to the
|
233 |
|
|
* value STARTING_FRAME_OFFSET. */
|
234 |
|
|
#define STARTING_FRAME_OFFSET 0
|
235 |
|
|
|
236 |
|
|
/* Offset from the stack pointer register to the first location at which
|
237 |
|
|
* outgoing arguments are placed. If not specified, the default value of zero
|
238 |
|
|
* is used. This is the proper value for most machines. If ARGS_GROW_DOWNWARD,
|
239 |
|
|
* this is the offset to the location above the first location at which outgoing
|
240 |
|
|
* arguments are placed. */
|
241 |
|
|
#define STACK_POINTER_OFFSET FIRST_PARM_OFFSET (0)
|
242 |
|
|
|
243 |
|
|
/* Offset from the argument pointer register to the first argument's address.
|
244 |
|
|
* On some machines it may depend on the data type of the function.
|
245 |
|
|
* If ARGS_GROW_DOWNWARD, this is the offset to the location above the first
|
246 |
|
|
* argument's address. */
|
247 |
|
|
#define FIRST_PARM_OFFSET(FUNDECL) 0 /* FIXME */
|
248 |
|
|
|
249 |
|
|
/* A C expression whose value is RTL representing the value of the return
|
250 |
|
|
* address for the frame count steps up from the current frame, after the
|
251 |
|
|
* prologue. frameaddr is the frame pointer of the count frame, or the frame
|
252 |
|
|
* pointer of the count − 1 frame if RETURN_ADDR_IN_PREVIOUS_FRAME is defined.
|
253 |
|
|
* The value of the expression must always be the correct address when count is
|
254 |
|
|
* zero, but may be NULL_RTX if there is no way to determine the return address
|
255 |
|
|
* of other frames. */
|
256 |
|
|
#define RETURN_ADDR_RTX(COUNT, FRAMEADDR) \
|
257 |
|
|
scarts32_return_addr (COUNT, FRAMEADDR)
|
258 |
|
|
|
259 |
|
|
/* A C expression whose value is RTL representing the location of the incoming
|
260 |
|
|
* return address at the beginning of any function, before the prologue. This
|
261 |
|
|
* RTL is either a REG, indicating that the return value is saved in `REG', or
|
262 |
|
|
* a MEM representing a location in the stack.
|
263 |
|
|
* You only need to define this macro if you want to support call frame
|
264 |
|
|
* debugging information like that provided by DWARF 2.
|
265 |
|
|
* If this RTL is a REG, you should also define DWARF_FRAME_RETURN_COLUMN to
|
266 |
|
|
* DWARF_FRAME_REGNUM (REGNO). */
|
267 |
|
|
#define INCOMING_RETURN_ADDR_RTX \
|
268 |
|
|
gen_rtx_REG (SImode, RA_REGNO)
|
269 |
|
|
|
270 |
|
|
#define DWARF_FRAME_RETURN_COLUMN \
|
271 |
|
|
DWARF_FRAME_REGNUM (RA_REGNO)
|
272 |
|
|
|
273 |
|
|
/* A C expression whose value is an integer giving the offset, in bytes, from
|
274 |
|
|
* the value of the stack pointer register to the top of the stack frame at the
|
275 |
|
|
* beginning of any function, before the prologue. The top of the frame is
|
276 |
|
|
* defined to be the value of the stack pointer in the previous frame, just
|
277 |
|
|
* before the call instruction.
|
278 |
|
|
* You only need to define this macro if you want to support call frame
|
279 |
|
|
* debugging information like that provided by DWARF 2. */
|
280 |
|
|
#define INCOMING_FRAME_SP_OFFSET 0 /* FIXME */
|
281 |
|
|
|
282 |
|
|
#define FRAME_POINTER_CFA_OFFSET(FNDECL) 0
|
283 |
|
|
|
284 |
|
|
#define STACK_POINTER_REGNUM PTR_Z
|
285 |
|
|
|
286 |
|
|
#define FRAME_POINTER_REGNUM PTR_Y
|
287 |
|
|
|
288 |
|
|
#define ARG_POINTER_REGNUM PTR_X
|
289 |
|
|
|
290 |
|
|
#define STATIC_CHAIN_REGNUM PTR_W
|
291 |
|
|
|
292 |
|
|
#define FRAME_POINTER_REQUIRED frame_pointer_required_p()
|
293 |
|
|
|
294 |
|
|
#define ELIMINABLE_REGS \
|
295 |
|
|
{{ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
|
296 |
|
|
{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
|
297 |
|
|
{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}
|
298 |
|
|
|
299 |
|
|
#define CAN_ELIMINATE(FROM, TO) 1
|
300 |
|
|
|
301 |
|
|
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
|
302 |
|
|
OFFSET = initial_elimination_offset (FROM, TO)
|
303 |
|
|
|
304 |
|
|
#define PUSH_ROUNDING(NPUSHED) (((NPUSHED) + 3) & ~3)
|
305 |
|
|
|
306 |
|
|
#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
|
307 |
|
|
|
308 |
|
|
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
|
309 |
|
|
(function_arg (&(CUM), MODE, TYPE, NAMED))
|
310 |
|
|
|
311 |
|
|
typedef struct scarts32_args {
|
312 |
|
|
int nregs; /* # registers available for passing */
|
313 |
|
|
int regno; /* next available register number */
|
314 |
|
|
} CUMULATIVE_ARGS;
|
315 |
|
|
|
316 |
|
|
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
|
317 |
|
|
(init_cumulative_args (&(CUM), FNTYPE, LIBNAME, FNDECL))
|
318 |
|
|
|
319 |
|
|
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
|
320 |
|
|
(function_arg_advance (&CUM, MODE, TYPE, NAMED))
|
321 |
|
|
|
322 |
|
|
#define FUNCTION_ARG_REGNO_P(r) function_arg_regno_p(r)
|
323 |
|
|
|
324 |
|
|
extern int scarts32_reg_order[];
|
325 |
|
|
|
326 |
|
|
#define RET_REGISTER RET_REGNO
|
327 |
|
|
|
328 |
|
|
#define FUNCTION_VALUE(VALTYPE, FUNC) scarts32_function_value (VALTYPE, FUNC)
|
329 |
|
|
|
330 |
|
|
#define LIBCALL_VALUE(MODE) scarts32_libcall_value (MODE)
|
331 |
|
|
|
332 |
|
|
#define FUNCTION_VALUE_REGNO_P(N) ((N) == RET_REGISTER)
|
333 |
|
|
|
334 |
|
|
#define RETURN_IN_MEMORY(TYPE) ((TYPE_MODE (TYPE) == BLKmode) \
|
335 |
|
|
? 1 : GET_MODE_SIZE (TYPE_MODE(TYPE)) > UNITS_PER_WORD)
|
336 |
|
|
|
337 |
|
|
#define STRUCT_VALUE 0
|
338 |
|
|
|
339 |
|
|
#define EPILOGUE_USES(REGNO) 0
|
340 |
|
|
|
341 |
|
|
/* Special kinds of addressing. */
|
342 |
|
|
#define HAVE_POST_INCREMENT 1
|
343 |
|
|
#define HAVE_POST_DECREMENT 1
|
344 |
|
|
|
345 |
|
|
#define HAVE_POST_MODIFY_DISP 1
|
346 |
|
|
|
347 |
|
|
#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
|
348 |
|
|
|
349 |
|
|
#define MAX_REGS_PER_ADDRESS 1
|
350 |
|
|
|
351 |
|
|
#ifdef REG_OK_STRICT
|
352 |
|
|
# define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
|
353 |
|
|
{ \
|
354 |
|
|
if (legitimate_address_p (mode, operand, 1)) \
|
355 |
|
|
goto ADDR; \
|
356 |
|
|
}
|
357 |
|
|
# else
|
358 |
|
|
# define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \
|
359 |
|
|
{ \
|
360 |
|
|
if (legitimate_address_p (mode, operand, 0)) \
|
361 |
|
|
goto ADDR; \
|
362 |
|
|
}
|
363 |
|
|
#endif
|
364 |
|
|
|
365 |
|
|
#define REG_OK_FOR_BASE_NOSTRICT_P(X) \
|
366 |
|
|
(REGNO (X) >= FIRST_PSEUDO_REGISTER || REG_OK_FOR_BASE_STRICT_P(X))
|
367 |
|
|
|
368 |
|
|
#define REG_OK_FOR_BASE_STRICT_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
|
369 |
|
|
|
370 |
|
|
#ifdef REG_OK_STRICT
|
371 |
|
|
# define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P (X)
|
372 |
|
|
#else
|
373 |
|
|
# define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NOSTRICT_P (X)
|
374 |
|
|
#endif
|
375 |
|
|
|
376 |
|
|
#define REG_OK_FOR_INDEX_P(X) 0
|
377 |
|
|
|
378 |
|
|
#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
|
379 |
|
|
do { \
|
380 |
|
|
GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN) \
|
381 |
|
|
} while(0)
|
382 |
|
|
/* NOTE: maybe something else is more useful */
|
383 |
|
|
|
384 |
|
|
#define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) \
|
385 |
|
|
do { \
|
386 |
|
|
/* do nothing */ \
|
387 |
|
|
} while(0)
|
388 |
|
|
/* NOTE: maybe something else is more useful */
|
389 |
|
|
|
390 |
|
|
#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
|
391 |
|
|
do { \
|
392 |
|
|
if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == POST_DEC) \
|
393 |
|
|
goto LABEL; \
|
394 |
|
|
} while(0)
|
395 |
|
|
|
396 |
|
|
#define LEGITIMATE_CONSTANT_P(X) 1
|
397 |
|
|
|
398 |
|
|
#define REGISTER_MOVE_COST(MODE, FROM, TO) ((MODE)==QImode ? 2 : \
|
399 |
|
|
(MODE)==HImode ? 2 : \
|
400 |
|
|
(MODE)==SImode ? 2 : \
|
401 |
|
|
(MODE)==SFmode ? 2 : 4)
|
402 |
|
|
|
403 |
|
|
#define MEMORY_MOVE_COST(MODE,CLASS,IN) ((MODE)==QImode ? 4 : \
|
404 |
|
|
(MODE)==HImode ? 4 : \
|
405 |
|
|
(MODE)==SImode ? 4 : \
|
406 |
|
|
(MODE)==SFmode ? 4 : 8)
|
407 |
|
|
|
408 |
|
|
#define MAX_CONDITIONAL_EXECUTE 4
|
409 |
|
|
|
410 |
|
|
#define REVERSIBLE_CC_MODE(MODE) ((MODE) == CCmode)
|
411 |
|
|
|
412 |
|
|
#define SLOW_BYTE_ACCESS 1
|
413 |
|
|
|
414 |
|
|
#define EXTRA_SECTIONS in_rodata
|
415 |
|
|
|
416 |
|
|
#define EXTRA_SECTION_FUNCTIONS \
|
417 |
|
|
void \
|
418 |
|
|
rodata_section (void) \
|
419 |
|
|
{ \
|
420 |
|
|
if (in_section != in_rodata) \
|
421 |
|
|
{ \
|
422 |
|
|
fprintf (asm_out_file, "\t.section\t.rodata\n"); \
|
423 |
|
|
in_section = in_rodata; \
|
424 |
|
|
} \
|
425 |
|
|
}
|
426 |
|
|
|
427 |
|
|
#define TEXT_SECTION_ASM_OP "\t.section\t.text"
|
428 |
|
|
|
429 |
|
|
#define DATA_SECTION_ASM_OP "\t.section\t.data"
|
430 |
|
|
|
431 |
|
|
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
|
432 |
|
|
|
433 |
|
|
#define READONLY_DATA_SECTION rodata_section
|
434 |
|
|
|
435 |
|
|
#define JUMP_TABLES_IN_TEXT_SECTION 0
|
436 |
|
|
|
437 |
|
|
#define ASM_COMMENT_START " ; "
|
438 |
|
|
|
439 |
|
|
#define ASM_APP_ON "/* #APP */\n"
|
440 |
|
|
|
441 |
|
|
#define ASM_APP_OFF "/* #NOAPP */\n"
|
442 |
|
|
|
443 |
|
|
#define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '\n' || ((C) == '|'))
|
444 |
|
|
|
445 |
|
|
#define ASM_OUTPUT_ALIGNED_COMMON(STREAM, NAME, SIZE, ALIGN) \
|
446 |
|
|
scarts32_output_aligned_common ((STREAM), (NAME), (SIZE), (ALIGN))
|
447 |
|
|
|
448 |
|
|
#define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN) \
|
449 |
|
|
scarts32_output_aligned_local ((STREAM), (NAME), (SIZE), (ALIGN))
|
450 |
|
|
|
451 |
|
|
#define ASM_OUTPUT_ALIGNED_BSS(STREAM, DECL, NAME, SIZE, ALIGN) \
|
452 |
|
|
scarts32_output_aligned_bss ((STREAM), (DECL), (NAME), (SIZE), (ALIGN))
|
453 |
|
|
|
454 |
|
|
#undef TYPE_OPERAND_FMT
|
455 |
|
|
#define TYPE_OPERAND_FMT "@%s"
|
456 |
|
|
|
457 |
|
|
#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
|
458 |
|
|
fprintf ((STREAM), "%s", (NAME))
|
459 |
|
|
|
460 |
|
|
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
|
461 |
|
|
do { \
|
462 |
|
|
fprintf(FILE, "\t.type\t%s, ", \
|
463 |
|
|
(* targetm.strip_name_encoding) \
|
464 |
|
|
(IDENTIFIER_POINTER \
|
465 |
|
|
(DECL_ASSEMBLER_NAME (current_function_decl)))); \
|
466 |
|
|
fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
|
467 |
|
|
putc('\n', FILE); \
|
468 |
|
|
\
|
469 |
|
|
ASM_OUTPUT_LABEL (FILE, NAME); \
|
470 |
|
|
} while (0)
|
471 |
|
|
|
472 |
|
|
#define ASM_DECLARE_FUNCTION_SIZE(FILE, NAME, DECL) \
|
473 |
|
|
do \
|
474 |
|
|
{ \
|
475 |
|
|
if (!flag_inhibit_size_directive) \
|
476 |
|
|
{ \
|
477 |
|
|
fprintf(FILE, "\t.size\t%s, .-%s\n\n", \
|
478 |
|
|
(* targetm.strip_name_encoding) \
|
479 |
|
|
(IDENTIFIER_POINTER \
|
480 |
|
|
(DECL_ASSEMBLER_NAME (current_function_decl))), \
|
481 |
|
|
(* targetm.strip_name_encoding) \
|
482 |
|
|
(IDENTIFIER_POINTER \
|
483 |
|
|
(DECL_ASSEMBLER_NAME (current_function_decl)))); \
|
484 |
|
|
} \
|
485 |
|
|
} \
|
486 |
|
|
while (0)
|
487 |
|
|
|
488 |
|
|
#define GLOBAL_ASM_OP "\t.global\t"
|
489 |
|
|
|
490 |
|
|
#define ESCAPES \
|
491 |
|
|
"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
492 |
|
|
\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
|
493 |
|
|
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
|
494 |
|
|
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
|
495 |
|
|
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
496 |
|
|
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
497 |
|
|
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
498 |
|
|
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
|
499 |
|
|
|
500 |
|
|
#define STRING_LIMIT 0
|
501 |
|
|
#define STRING_ASM_OP NULL
|
502 |
|
|
|
503 |
|
|
#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
|
504 |
|
|
sprintf (STRING, "*.%s%d", PREFIX, NUM)
|
505 |
|
|
|
506 |
|
|
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
|
507 |
|
|
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
|
508 |
|
|
sprintf ((OUTPUT), ".%s.%d", (NAME), (LABELNO)))
|
509 |
|
|
|
510 |
|
|
#define HAS_INIT_SECTION 1
|
511 |
|
|
|
512 |
|
|
#define REGISTER_NAMES { \
|
513 |
|
|
"r0","r1","r2","r3","r4","r5","r6","r7", \
|
514 |
|
|
"r8","r9","r10","r11","r12","r13","r14","r15", \
|
515 |
|
|
"fpw", "fpx", "fpy", "fpz", \
|
516 |
|
|
"cc"}
|
517 |
|
|
|
518 |
|
|
#define FINAL_PRESCAN_INSN(insn, operand, nop) \
|
519 |
|
|
final_prescan_insn (insn, operand,nop)
|
520 |
|
|
|
521 |
|
|
#define PRINT_OPERAND(STREAM, X, CODE) print_operand((STREAM), X, CODE)
|
522 |
|
|
|
523 |
|
|
#define PRINT_OPERAND_ADDRESS(STREAM, X) print_operand((STREAM), X, '@')
|
524 |
|
|
|
525 |
|
|
#define USER_LABEL_PREFIX ""
|
526 |
|
|
|
527 |
|
|
#define ASM_OUTPUT_SKIP(STREAM, N) fprintf((STREAM), "\t.skip\t%lu\n", N)
|
528 |
|
|
|
529 |
|
|
#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
|
530 |
|
|
do { \
|
531 |
|
|
if ((POWER) != 0) \
|
532 |
|
|
fprintf((STREAM), "\t.p2align\t%d\n", POWER); \
|
533 |
|
|
} while (0)
|
534 |
|
|
|
535 |
|
|
#define CASE_VECTOR_MODE SImode
|
536 |
|
|
|
537 |
|
|
extern int scarts32_case_values_threshold;
|
538 |
|
|
|
539 |
|
|
#define CASE_VALUES_THRESHOLD scarts32_case_values_threshold
|
540 |
|
|
|
541 |
|
|
#undef WORD_REGISTER_OPERATIONS
|
542 |
|
|
|
543 |
|
|
#define MOVE_MAX UNITS_PER_WORD
|
544 |
|
|
|
545 |
|
|
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
|
546 |
|
|
|
547 |
|
|
#define Pmode SImode
|
548 |
|
|
|
549 |
|
|
#define FUNCTION_MODE SImode
|
550 |
|
|
|
551 |
|
|
#define DOLLARS_IN_IDENTIFIERS 0
|
552 |
|
|
|
553 |
|
|
#define NO_DOLLAR_IN_LABEL 1
|
554 |
|
|
|
555 |
|
|
#define TRAMPOLINE_SIZE 0
|
556 |
|
|
|
557 |
|
|
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
|
558 |
|
|
internal_error ("trampolines not supported")
|
559 |
|
|
|
560 |
|
|
#define FUNCTION_PROFILER(FILE, LABELNO) \
|
561 |
|
|
fprintf (FILE, "/* profiler %d */\n", (LABELNO))
|
562 |
|
|
|
563 |
|
|
#define ADJUST_INSN_LENGTH(INSN, LENGTH) \
|
564 |
|
|
(LENGTH = adjust_insn_length (INSN, LENGTH))
|
565 |
|
|
|
566 |
|
|
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
|
567 |
|
|
|
568 |
|
|
#define CC1_SPEC "%{profile:-p}"
|
569 |
|
|
|
570 |
|
|
#define CC1PLUS_SPEC "%{!frtti:-fno-rtti} \
|
571 |
|
|
%{!fenforce-eh-specs:-fno-enforce-eh-specs} \
|
572 |
|
|
%{!fexceptions:-fno-exceptions}"
|
573 |
|
|
|
574 |
|
|
/* Undefine this, because we do not have a regular `as' anyway */
|
575 |
|
|
#undef USE_AS_TRADITIONAL_FORMAT
|
576 |
|
|
|
577 |
|
|
#define LIB_SPEC "-lc -lnosys"
|
578 |
|
|
#define LIBGCC_SPEC "-lgcc"
|
579 |
|
|
#define STARTFILE_SPEC "crt0.o%s"
|
580 |
|
|
#define LINK_GCC_C_SEQUENCE_SPEC "%G %G %L %G %L %G"
|
581 |
|
|
|
582 |
|
|
#define LINKER_NAME "ld"
|
583 |
|
|
|
584 |
|
|
#define TEST_HARD_REG_CLASS(CLASS, REGNO) \
|
585 |
|
|
TEST_HARD_REG_BIT (reg_class_contents[ (int) (CLASS)], REGNO)
|
586 |
|
|
|
587 |
|
|
/* return register r0 */
|
588 |
|
|
#define RET_REGNO 0
|
589 |
|
|
|
590 |
|
|
/* argument 0 register r1*/
|
591 |
|
|
#define ARG0_REGNO 1
|
592 |
|
|
/* argument 1 register r2*/
|
593 |
|
|
#define ARG1_REGNO 2
|
594 |
|
|
/* argument 2 register r3*/
|
595 |
|
|
#define ARG2_REGNO 3
|
596 |
|
|
/* argument 3 register r4*/
|
597 |
|
|
#define ARG3_REGNO 4
|
598 |
|
|
|
599 |
|
|
/* tmp register r13 */
|
600 |
|
|
#define TMP_REGNO 13
|
601 |
|
|
|
602 |
|
|
/* return address register r14*/
|
603 |
|
|
#define RA_REGNO 14
|
604 |
|
|
|
605 |
|
|
/* pseudo-hard register for condition code */
|
606 |
|
|
#define CC_REGNO 20
|
607 |
|
|
|
608 |
|
|
#define SCARTS32_NEAR_JUMP 1
|
609 |
|
|
#define SCARTS32_FAR_JUMP 2
|
610 |
|
|
|
611 |
|
|
/* MWA: stabs debugging format is deprecated
|
612 |
|
|
#define DBX_DEBUGGING_INFO 1
|
613 |
|
|
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
614 |
|
|
|
615 |
|
|
#define DBX_FUNCTION_FIRST
|
616 |
|
|
*/
|
617 |
|
|
|
618 |
|
|
/* Macros for DWARF Output */
|
619 |
|
|
#undef PREFERRED_DEBUGGING_TYPE
|
620 |
|
|
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
621 |
|
|
|
622 |
|
|
#define DWARF2_DEBUGGING_INFO 1
|
623 |
|
|
#define DWARF2_ASM_LINE_DEBUG_INFO 1
|
624 |
|
|
#define DWARF2_UNWIND_INFO 0
|
625 |
|
|
#define DWARF2_FRAME_INFO 0
|
626 |
|
|
|