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