* config/i386/uwin.h: Remove SUBTARGET_PROLOGUE.
[official-gcc.git] / gcc / config / stormy16 / stormy16.h
blobdc9aea926af80ff4eab8748cb3be9a442bb13667
1 /* Xstormy16 cpu description.
2 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
3 Free Software Foundation, Inc.
4 Contributed by Red Hat, Inc.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
24 /* Driver configuration */
26 /* Defined in svr4.h. */
27 /* #define SWITCH_TAKES_ARG(CHAR) */
29 /* Defined in svr4.h. */
30 /* #define WORD_SWITCH_TAKES_ARG(NAME) */
32 /* Defined in svr4.h. */
33 #undef ASM_SPEC
34 #define ASM_SPEC ""
36 /* Defined in svr4.h. */
37 /* #define ASM_FINAL_SPEC "" */
39 /* Defined in svr4.h. */
40 /* #define LINK_SPEC "" */
42 /* For xstormy16:
43 - If -msim is specified, everything is built and linked as for the sim.
44 - If -T is specified, that linker script is used, and it should provide
45 appropriate libraries.
46 - If neither is specified, everything is built as for the sim, but no
47 I/O support is assumed.
50 #undef LIB_SPEC
51 #define LIB_SPEC "-( -lc %{msim:-lsim}%{!msim:%{!T*:-lnosys}} -)"
53 /* Defined in svr4.h. */
54 #undef STARTFILE_SPEC
55 #define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s"
57 /* Defined in svr4.h. */
58 #undef ENDFILE_SPEC
59 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
61 /* Defined in svr4.h for host compilers. */
62 /* #define MD_EXEC_PREFIX "" */
64 /* Defined in svr4.h for host compilers. */
65 /* #define MD_STARTFILE_PREFIX "" */
68 /* Run-time target specifications */
70 #define TARGET_CPU_CPP_BUILTINS() do { \
71 builtin_define_std ("xstormy16"); \
72 builtin_assert ("machine=xstormy16"); \
73 } while (0)
75 /* This declaration should be present. */
76 extern int target_flags;
78 #define TARGET_SWITCHES \
79 {{ "sim", 0, "Provide libraries for the simulator" }, \
80 { "", 0, "" }}
82 #define TARGET_VERSION fprintf (stderr, " (xstormy16 cpu core)");
84 #define CAN_DEBUG_WITHOUT_FP
87 /* Storage Layout */
89 #define BITS_BIG_ENDIAN 1
91 #define BYTES_BIG_ENDIAN 0
93 #define WORDS_BIG_ENDIAN 0
95 #define UNITS_PER_WORD 2
97 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
98 do { \
99 if (GET_MODE_CLASS (MODE) == MODE_INT \
100 && GET_MODE_SIZE (MODE) < 2) \
101 (MODE) = HImode; \
102 } while (0)
104 #define PROMOTE_FUNCTION_ARGS 1
106 #define PROMOTE_FUNCTION_RETURN 1
108 #define PARM_BOUNDARY 16
110 #define STACK_BOUNDARY 16
112 #define FUNCTION_BOUNDARY 16
114 #define BIGGEST_ALIGNMENT 16
116 /* Defined in svr4.h. */
117 /* #define MAX_OFILE_ALIGNMENT */
119 #define DATA_ALIGNMENT(TYPE, ALIGN) \
120 (TREE_CODE (TYPE) == ARRAY_TYPE \
121 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
122 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
124 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
125 (TREE_CODE (EXP) == STRING_CST \
126 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
128 #define STRICT_ALIGNMENT 1
130 /* Defined in svr4.h. */
131 #define PCC_BITFIELD_TYPE_MATTERS 1
133 /* Layout of Source Language Data Types */
135 #define INT_TYPE_SIZE 16
137 #define SHORT_TYPE_SIZE 16
139 #define LONG_TYPE_SIZE 32
141 #define LONG_LONG_TYPE_SIZE 64
143 #define FLOAT_TYPE_SIZE 32
145 #define DOUBLE_TYPE_SIZE 64
147 #define LONG_DOUBLE_TYPE_SIZE 64
149 #define DEFAULT_SIGNED_CHAR 0
151 /* Defined in svr4.h. */
152 #define SIZE_TYPE "unsigned int"
154 /* Defined in svr4.h. */
155 #define PTRDIFF_TYPE "int"
157 /* Defined in svr4.h, to "long int". */
158 /* #define WCHAR_TYPE "long int" */
160 /* Defined in svr4.h. */
161 #undef WCHAR_TYPE_SIZE
162 #define WCHAR_TYPE_SIZE 32
164 /* Define this macro if the type of Objective-C selectors should be `int'.
166 If this macro is not defined, then selectors should have the type `struct
167 objc_selector *'. */
168 /* #define OBJC_INT_SELECTORS */
171 /* Register Basics */
173 #define FIRST_PSEUDO_REGISTER 19
175 #define FIXED_REGISTERS \
176 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1 }
178 #define CALL_USED_REGISTERS \
179 { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1 }
182 /* Order of allocation of registers */
184 #define REG_ALLOC_ORDER { 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 10, 11, 12, 13, 14, 15, 16 }
187 /* How Values Fit in Registers */
189 #define HARD_REGNO_NREGS(REGNO, MODE) \
190 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
192 #define HARD_REGNO_MODE_OK(REGNO, MODE) ((REGNO) != 16 || (MODE) == BImode)
194 /* A C expression that is nonzero if it is desirable to choose register
195 allocation so as to avoid move instructions between a value of mode MODE1
196 and a value of mode MODE2.
198 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are
199 ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be
200 zero. */
201 #define MODES_TIEABLE_P(MODE1, MODE2) ((MODE1) != BImode && (MODE2) != BImode)
204 /* Register Classes */
206 enum reg_class
208 NO_REGS,
209 R0_REGS,
210 R1_REGS,
211 TWO_REGS,
212 R2_REGS,
213 EIGHT_REGS,
214 R8_REGS,
215 ICALL_REGS,
216 GENERAL_REGS,
217 CARRY_REGS,
218 ALL_REGS,
219 LIM_REG_CLASSES
222 #define N_REG_CLASSES ((int) LIM_REG_CLASSES)
224 #define REG_CLASS_NAMES \
226 "NO_REGS", \
227 "R0_REGS", \
228 "R1_REGS", \
229 "TWO_REGS", \
230 "R2_REGS", \
231 "EIGHT_REGS", \
232 "R8_REGS", \
233 "ICALL_REGS", \
234 "GENERAL_REGS", \
235 "CARRY_REGS", \
236 "ALL_REGS" \
239 #define REG_CLASS_CONTENTS \
241 { 0x00000 }, \
242 { 0x00001 }, \
243 { 0x00002 }, \
244 { 0x00003 }, \
245 { 0x00004 }, \
246 { 0x000FF }, \
247 { 0x00100 }, \
248 { 0x00300 }, \
249 { 0x6FFFF }, \
250 { 0x10000 }, \
251 { (1 << FIRST_PSEUDO_REGISTER) - 1 } \
254 #define REGNO_REG_CLASS(REGNO) \
255 ((REGNO) == 0 ? R0_REGS \
256 : (REGNO) == 1 ? R1_REGS \
257 : (REGNO) == 2 ? R2_REGS \
258 : (REGNO) < 8 ? EIGHT_REGS \
259 : (REGNO) == 8 ? R8_REGS \
260 : (REGNO) == 16 ? CARRY_REGS \
261 : (REGNO) <= 18 ? GENERAL_REGS \
262 : ALL_REGS)
264 #define BASE_REG_CLASS GENERAL_REGS
266 #define INDEX_REG_CLASS GENERAL_REGS
268 /* The following letters are unavailable, due to being used as
269 constraints:
270 '0'..'9'
271 '<', '>'
272 'E', 'F', 'G', 'H'
273 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
274 'Q', 'R', 'S', 'T', 'U'
275 'V', 'X'
276 'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
278 #define REG_CLASS_FROM_LETTER(CHAR) \
279 ( (CHAR) == 'a' ? R0_REGS \
280 : (CHAR) == 'b' ? R1_REGS \
281 : (CHAR) == 'c' ? R2_REGS \
282 : (CHAR) == 'd' ? R8_REGS \
283 : (CHAR) == 'e' ? EIGHT_REGS \
284 : (CHAR) == 't' ? TWO_REGS \
285 : (CHAR) == 'y' ? CARRY_REGS \
286 : (CHAR) == 'z' ? ICALL_REGS \
287 : NO_REGS)
289 #define REGNO_OK_FOR_BASE_P(NUM) 1
291 #define REGNO_OK_FOR_INDEX_P(NUM) REGNO_OK_FOR_BASE_P (NUM)
293 /* This declaration must be present. */
294 #define PREFERRED_RELOAD_CLASS(X, CLASS) \
295 xstormy16_preferred_reload_class (X, CLASS)
297 #define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \
298 xstormy16_preferred_reload_class (X, CLASS)
300 /* This chip has the interesting property that only the first eight
301 registers can be moved to/from memory. */
302 #define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
303 xstormy16_secondary_reload_class (CLASS, MODE, X)
305 /* Normally the compiler avoids choosing registers that have been explicitly
306 mentioned in the rtl as spill registers (these registers are normally those
307 used to pass parameters and return values). However, some machines have so
308 few registers of certain classes that there would not be enough registers to
309 use as spill registers if this were done.
311 Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero value on
312 these machines. When this macro has a nonzero value, the compiler allows
313 registers explicitly used in the rtl to be used as spill registers but
314 avoids extending the lifetime of these registers.
316 It is always safe to define this macro with a nonzero value, but if you
317 unnecessarily define it, you will reduce the amount of optimizations that
318 can be performed in some cases. If you do not define this macro with a
319 nonzero value when it is required, the compiler will run out of spill
320 registers and print a fatal error message. For most machines, you should
321 not define this macro at all. */
322 /* #define SMALL_REGISTER_CLASSES */
324 /* This declaration is required. */
325 #define CLASS_MAX_NREGS(CLASS, MODE) \
326 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
328 /* If defined, a C expression for a class that contains registers which the
329 compiler must always access in a mode that is the same size as the mode in
330 which it loaded the register.
332 For the example, loading 32-bit integer or floating-point objects into
333 floating-point registers on the Alpha extends them to 64-bits. Therefore
334 loading a 64-bit object and then storing it as a 32-bit object does not
335 store the low-order 32-bits, as would be the case for a normal register.
336 Therefore, `alpha.h' defines this macro as `FLOAT_REGS'. */
337 /* #define CLASS_CANNOT_CHANGE_SIZE */
339 #define CONST_OK_FOR_LETTER_P(VALUE, C) \
340 ( (C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 3 \
341 : (C) == 'J' ? exact_log2 (VALUE) != -1 \
342 : (C) == 'K' ? exact_log2 (~(VALUE)) != -1 \
343 : (C) == 'L' ? (VALUE) >= 0 && (VALUE) <= 255 \
344 : (C) == 'M' ? (VALUE) >= -255 && (VALUE) <= 0 \
345 : (C) == 'N' ? (VALUE) >= -3 && (VALUE) <= 0 \
346 : (C) == 'O' ? (VALUE) >= 1 && (VALUE) <= 4 \
347 : (C) == 'P' ? (VALUE) >= -4 && (VALUE) <= -1 \
348 : 0 )
350 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
352 #define EXTRA_CONSTRAINT(VALUE, C) \
353 xstormy16_extra_constraint_p (VALUE, C)
356 /* Basic Stack Layout */
358 /* We want to use post-increment instructions to push things on the stack,
359 because we don't have any pre-increment ones. */
360 #define STACK_PUSH_CODE POST_INC
362 /* #define FRAME_GROWS_DOWNWARD */
364 #define ARGS_GROW_DOWNWARD 1
366 #define STARTING_FRAME_OFFSET 0
368 #define FIRST_PARM_OFFSET(FUNDECL) 0
370 #define RETURN_ADDR_RTX(COUNT, FRAMEADDR) \
371 ((COUNT) == 0 \
372 ? gen_rtx_MEM (Pmode, arg_pointer_rtx) \
373 : NULL_RTX)
375 #define INCOMING_RETURN_ADDR_RTX \
376 gen_rtx_MEM (SImode, gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (-4)))
378 #define INCOMING_FRAME_SP_OFFSET (xstormy16_interrupt_function_p () ? 6 : 4)
381 /* Register That Address the Stack Frame. */
383 #define STACK_POINTER_REGNUM 15
385 #define FRAME_POINTER_REGNUM 17
387 #define HARD_FRAME_POINTER_REGNUM 13
389 #define ARG_POINTER_REGNUM 18
391 #define STATIC_CHAIN_REGNUM 1
394 /* Eliminating the Frame Pointer and the Arg Pointer */
396 #define FRAME_POINTER_REQUIRED 0
398 #define ELIMINABLE_REGS \
400 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
401 {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
402 {ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
403 {ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
406 #define CAN_ELIMINATE(FROM, TO) \
407 ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \
408 ? ! frame_pointer_needed \
409 : 1)
411 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
412 (OFFSET) = xstormy16_initial_elimination_offset (FROM, TO)
415 /* Passing Function Arguments on the Stack */
417 #define PROMOTE_PROTOTYPES 1
419 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
421 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
424 /* Function Arguments in Registers */
426 #define NUM_ARGUMENT_REGISTERS 6
427 #define FIRST_ARGUMENT_REGISTER 2
429 #define XSTORMY16_WORD_SIZE(TYPE, MODE) \
430 ((((TYPE) ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \
431 + 1) \
432 / 2)
434 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
435 xstormy16_function_arg (CUM, MODE, TYPE, NAMED)
437 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
439 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) 0
441 /* If defined, a C expression that indicates when it is more
442 desirable to keep an argument passed by invisible reference as a
443 reference, rather than copying it to a pseudo register. */
444 /* #define FUNCTION_ARG_KEEP_AS_REFERENCE(CUM, MODE, TYPE, NAMED) */
446 /* For this platform, the value of CUMULATIVE_ARGS is the number of words
447 of arguments that have been passed in registers so far. */
448 #define CUMULATIVE_ARGS int
450 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) (CUM) = 0
452 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
453 ((CUM) = xstormy16_function_arg_advance (CUM, MODE, TYPE, NAMED))
455 #define FUNCTION_ARG_REGNO_P(REGNO) \
456 ((REGNO) >= FIRST_ARGUMENT_REGISTER \
457 && (REGNO) < FIRST_ARGUMENT_REGISTER + NUM_ARGUMENT_REGISTERS)
460 /* How Scalar Function Values are Returned */
462 /* The number of the hard register that is used to return a scalar value from a
463 function call. */
464 #define RETURN_VALUE_REGNUM FIRST_ARGUMENT_REGISTER
466 #define FUNCTION_VALUE(VALTYPE, FUNC) \
467 xstormy16_function_value (VALTYPE, FUNC)
469 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, RETURN_VALUE_REGNUM)
471 #define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM)
474 /* How Large Values are Returned */
476 #define RETURN_IN_MEMORY(TYPE) \
477 (int_size_in_bytes (TYPE) > UNITS_PER_WORD * NUM_ARGUMENT_REGISTERS)
479 #define STRUCT_VALUE 0
482 /* Function Entry and Exit */
484 #define EPILOGUE_USES(REGNO) \
485 xstormy16_epilogue_uses (REGNO)
488 /* Generating Code for Profiling. */
490 /* This declaration must be present, but it can be an abort if profiling is
491 not implemented. */
493 #define FUNCTION_PROFILER(FILE, LABELNO) xstormy16_function_profiler ()
496 /* If the target has particular reasons why a function cannot be inlined,
497 it may define the TARGET_CANNOT_INLINE_P. This macro takes one argument,
498 the DECL describing the function. The function should NULL if the function
499 *can* be inlined. Otherwise it should return a pointer to a string containing
500 a message describing why the function could not be inlined. The message will
501 displayed if the '-Winline' command line switch has been given. If the message
502 contains a '%s' sequence, this will be replaced by the name of the function. */
503 /* #define TARGET_CANNOT_INLINE_P(FN_DECL) xstormy16_cannot_inline_p (FN_DECL) */
505 /* Implementing the Varargs Macros. */
507 #define SETUP_INCOMING_VARARGS(ARGS_SO_FAR, MODE, TYPE, PRETEND_ARGS_SIZE, SECOND_TIME) \
508 if (! SECOND_TIME) \
509 xstormy16_setup_incoming_varargs (ARGS_SO_FAR, MODE, TYPE, & PRETEND_ARGS_SIZE)
511 /* Build up the stdarg/varargs va_list type tree, assinging it to NODE. If not
512 defined, it is assumed that va_list is a void * pointer. */
513 #define BUILD_VA_LIST_TYPE(NODE) \
514 ((NODE) = xstormy16_build_va_list ())
516 /* Implement the stdarg/varargs va_start macro. STDARG_P is nonzero if this
517 is stdarg.h instead of varargs.h. VALIST is the tree of the va_list
518 variable to initialize. NEXTARG is the machine independent notion of the
519 'next' argument after the variable arguments. If not defined, a standard
520 implementation will be defined that works for arguments passed on the stack. */
521 #define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \
522 xstormy16_expand_builtin_va_start (VALIST, NEXTARG)
524 /* Implement the stdarg/varargs va_arg macro. VALIST is the variable of type
525 va_list as a tree, TYPE is the type passed to va_arg. */
526 #define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE) \
527 xstormy16_expand_builtin_va_arg (VALIST, TYPE)
529 /* Implement the stdarg/varargs va_end macro. VALIST is the variable of type
530 va_list as a tree. */
531 /* #define EXPAND_BUILTIN_VA_END(VALIST) */
534 /* Trampolines for Nested Functions. */
536 #define TRAMPOLINE_SIZE 8
538 #define TRAMPOLINE_ALIGNMENT 16
540 #define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
541 xstormy16_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)
544 /* Implicit Calls to Library Routines */
546 #define TARGET_MEM_FUNCTIONS
548 /* Define this macro to override the type used by the library routines to pick
549 up arguments of type `float'. (By default, they use a union of `float' and
550 `int'.)
552 The obvious choice would be `float'--but that won't work with traditional C
553 compilers that expect all arguments declared as `float' to arrive as
554 `double'. To avoid this conversion, the library routines ask for the value
555 as some other type and then treat it as a `float'.
557 On some systems, no other type will work for this. For these systems, you
558 must use `LIBGCC_NEEDS_DOUBLE' instead, to force conversion of the values
559 `double' before they are passed. */
560 /* #define FLOAT_ARG_TYPE */
562 /* Define this macro to override the way library routines redesignate a `float'
563 argument as a `float' instead of the type it was passed as. The default is
564 an expression which takes the `float' field of the union. */
565 /* #define FLOATIFY(PASSED_VALUE) */
567 /* Define this macro to override the type used by the library routines to
568 return values that ought to have type `float'. (By default, they use
569 `int'.)
571 The obvious choice would be `float'--but that won't work with traditional C
572 compilers gratuitously convert values declared as `float' into `double'. */
573 /* #define FLOAT_VALUE_TYPE */
575 /* Define this macro to override the way the value of a `float'-returning
576 library routine should be packaged in order to return it. These functions
577 are actually declared to return type `FLOAT_VALUE_TYPE' (normally `int').
579 These values can't be returned as type `float' because traditional C
580 compilers would gratuitously convert the value to a `double'.
582 A local variable named `intify' is always available when the macro `INTIFY'
583 is used. It is a union of a `float' field named `f' and a field named `i'
584 whose type is `FLOAT_VALUE_TYPE' or `int'.
586 If you don't define this macro, the default definition works by copying the
587 value through that union. */
588 /* #define INTIFY(FLOAT_VALUE) */
590 /* Define this macro as the name of the data type corresponding to `SImode' in
591 the system's own C compiler.
593 You need not define this macro if that type is `long int', as it usually is. */
594 /* #define nongcc_SI_type */
596 /* Define this macro as the name of the data type corresponding to the
597 word_mode in the system's own C compiler.
599 You need not define this macro if that type is `long int', as it usually is. */
600 /* #define nongcc_word_type */
602 /* Define these macros to supply explicit C statements to carry out various
603 arithmetic operations on types `float' and `double' in the library routines
604 in `libgcc1.c'. See that file for a full list of these macros and their
605 arguments.
607 On most machines, you don't need to define any of these macros, because the
608 C compiler that comes with the system takes care of doing them. */
609 /* #define perform_... */
612 /* Addressing Modes */
614 #define HAVE_POST_INCREMENT 1
616 #define HAVE_PRE_DECREMENT 1
618 #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)
620 #define MAX_REGS_PER_ADDRESS 1
622 #ifdef REG_OK_STRICT
623 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \
624 do { \
625 if (xstormy16_legitimate_address_p (MODE, X, 1)) \
626 goto LABEL; \
627 } while (0)
628 #else
629 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \
630 do { \
631 if (xstormy16_legitimate_address_p (MODE, X, 0)) \
632 goto LABEL; \
633 } while (0)
634 #endif
636 #ifdef REG_OK_STRICT
637 #define REG_OK_FOR_BASE_P(X) \
638 (REGNO_OK_FOR_BASE_P (REGNO (X)) && (REGNO (X) < FIRST_PSEUDO_REGISTER))
639 #else
640 #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
641 #endif
643 #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
645 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
647 /* On this chip, this is true if the address is valid with an offset
648 of 0 but not of 6, because in that case it cannot be used as an
649 address for DImode or DFmode, or if the address is a post-increment
650 or pre-decrement address.
652 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
653 if (xstormy16_mode_dependent_address_p (ADDR)) \
654 goto LABEL
656 #define LEGITIMATE_CONSTANT_P(X) 1
659 /* Describing Relative Costs of Operations */
661 #define REGISTER_MOVE_COST(MODE, FROM, TO) 2
663 #define MEMORY_MOVE_COST(M,C,I) (5 + memory_move_secondary_cost (M, C, I))
665 #define BRANCH_COST 5
667 #define SLOW_BYTE_ACCESS 0
669 #define NO_FUNCTION_CSE
671 #define NO_RECURSIVE_FUNCTION_CSE
674 /* Dividing the output into sections. */
676 #define TEXT_SECTION_ASM_OP ".text"
678 #define DATA_SECTION_ASM_OP ".data"
680 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
682 /* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
683 There are no shared libraries on this target so these sections need
684 not be writable.
686 Defined in elfos.h. */
688 #undef CTORS_SECTION_ASM_OP
689 #undef DTORS_SECTION_ASM_OP
690 #define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"a\""
691 #define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"a\""
693 #define JUMP_TABLES_IN_TEXT_SECTION 1
696 /* The Overall Framework of an Assembler File. */
698 #define ASM_COMMENT_START ";"
700 #define ASM_APP_ON "#APP\n"
702 #define ASM_APP_OFF "#NO_APP\n"
704 /* A C statement to output something to the assembler file to switch to section
705 NAME for object DECL which is either a `FUNCTION_DECL', a `VAR_DECL' or
706 `NULL_TREE'. Some target formats do not support arbitrary sections. Do not
707 define this macro in such cases.
709 At present this macro is only used to support section attributes. When this
710 macro is undefined, section attributes are disabled.
712 Defined in svr4.h. */
713 /* #define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME) */
716 /* Output of Data. */
718 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '|')
721 /* Output and Generation of Labels. */
723 #define ASM_OUTPUT_SYMBOL_REF(STREAM, SYMBOL) \
724 do { \
725 if (SYMBOL_REF_FUNCTION_P (SYMBOL)) \
726 ASM_OUTPUT_LABEL_REF ((STREAM), XSTR (SYMBOL, 0)); \
727 else \
728 assemble_name (STREAM, XSTR (SYMBOL, 0)); \
729 } while (0)
731 #define ASM_OUTPUT_LABEL_REF(STREAM, NAME) \
732 do { \
733 fputs ("@fptr(", STREAM); \
734 assemble_name (STREAM, NAME); \
735 fputc (')', STREAM); \
736 } while (0)
738 /* Globalizing directive for a label. */
739 #define GLOBAL_ASM_OP "\t.globl "
742 /* Macros Controlling Initialization Routines. */
744 /* When you are using special sections for
745 initialization and termination functions, this macro also controls how
746 `crtstuff.c' and `libgcc2.c' arrange to run the initialization functions.
748 Defined in svr4.h. */
749 /* #define INIT_SECTION_ASM_OP */
751 /* Define this macro as a C statement to output on the stream STREAM the
752 assembler code to arrange to call the function named NAME at initialization
753 time.
755 Assume that NAME is the name of a C function generated automatically by the
756 compiler. This function takes no arguments. Use the function
757 `assemble_name' to output the name NAME; this performs any system-specific
758 syntactic transformations such as adding an underscore.
760 If you don't define this macro, nothing special is output to arrange to call
761 the function. This is correct when the function will be called in some
762 other manner--for example, by means of the `collect2' program, which looks
763 through the symbol table to find these functions by their names.
765 Defined in svr4.h. */
766 /* #define ASM_OUTPUT_CONSTRUCTOR(STREAM, NAME) */
768 /* This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination functions
769 rather than initialization functions.
771 Defined in svr4.h. */
772 /* #define ASM_OUTPUT_DESTRUCTOR(STREAM, NAME) */
774 /* Define this macro if the system uses ELF format object files.
776 Defined in svr4.h. */
777 /* #define OBJECT_FORMAT_ELF */
780 /* Output of Assembler Instructions. */
782 #define REGISTER_NAMES \
783 { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \
784 "r11", "r12", "r13", "psw", "sp", "carry", "fp", "ap" }
786 #define ADDITIONAL_REGISTER_NAMES \
787 { { "r14", 14 }, \
788 { "r15", 15 } }
790 #define PRINT_OPERAND(STREAM, X, CODE) xstormy16_print_operand (STREAM, X, CODE)
792 #define PRINT_OPERAND_ADDRESS(STREAM, X) xstormy16_print_operand_address (STREAM, X)
794 /* USER_LABEL_PREFIX is defined in svr4.h. */
795 #define REGISTER_PREFIX ""
796 #define LOCAL_LABEL_PREFIX "."
797 #define USER_LABEL_PREFIX ""
798 #define IMMEDIATE_PREFIX "#"
800 #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \
801 fprintf (STREAM, "\tpush %d\n", REGNO)
803 #define ASM_OUTPUT_REG_POP(STREAM, REGNO) \
804 fprintf (STREAM, "\tpop %d\n", REGNO)
807 /* Output of dispatch tables. */
809 /* This port does not use the ASM_OUTPUT_ADDR_VEC_ELT macro, because
810 this could cause label alignment to appear between the 'br' and the table,
811 which would be bad. Instead, it controls the output of the table
812 itself. */
813 #define ASM_OUTPUT_ADDR_VEC(LABEL, BODY) \
814 xstormy16_output_addr_vec (file, LABEL, BODY)
816 /* Alignment for ADDR_VECs is the same as for code. */
817 #define ADDR_VEC_ALIGN(ADDR_VEC) 1
820 /* Assembler Commands for Exception Regions. */
822 #define DWARF2_UNWIND_INFO 0
824 /* Don't use __builtin_setjmp for unwinding, since it's tricky to get
825 at the high 16 bits of an address. */
826 #define DONT_USE_BUILTIN_SETJMP
827 #define JMP_BUF_SIZE 8
829 /* Assembler Commands for Alignment. */
831 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
832 fprintf ((STREAM), "\t.p2align %d\n", (POWER))
835 /* Macros Affecting all Debug Formats. */
837 /* Defined in svr4.h. */
838 #undef PREFERRED_DEBUGGING_TYPE
839 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
842 /* Macros for SDB and Dwarf Output. */
844 /* Define this macro if addresses in Dwarf 2 debugging info should not
845 be the same size as pointers on the target architecture. The
846 macro's value should be the size, in bytes, to use for addresses in
847 the debugging info.
849 Some architectures use word addresses to refer to code locations,
850 but Dwarf 2 info always uses byte addresses. On such machines,
851 Dwarf 2 addresses need to be larger than the architecture's
852 pointers. */
853 #define DWARF2_ADDR_SIZE 4
856 /* Miscellaneous Parameters. */
858 #define PREDICATE_CODES \
859 {"shift_operator", {ASHIFT, ASHIFTRT, LSHIFTRT }}, \
860 {"equality_operator", {EQ, NE }}, \
861 {"inequality_operator", {GE, GT, LE, LT, GEU, GTU, LEU, LTU }}, \
862 {"xstormy16_ineqsi_operator", {LT, GE, LTU, GEU }}, \
863 {"nonimmediate_nonstack_operand", {REG, MEM}},
865 #define CASE_VECTOR_MODE SImode
867 #define WORD_REGISTER_OPERATIONS
869 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
871 #define MOVE_MAX 2
873 #define SHIFT_COUNT_TRUNCATED 1
875 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
877 #define Pmode HImode
879 #define FUNCTION_MODE HImode
881 #define NO_IMPLICIT_EXTERN_C
883 /* Defined in svr4.h. */
884 #define HANDLE_SYSV_PRAGMA 1
886 /* Define this if the target system supports the function `atexit' from the
887 ANSI C standard. If this is not defined, and `INIT_SECTION_ASM_OP' is not
888 defined, a default `exit' function will be provided to support C++.
890 Defined by svr4.h */
891 /* #define HAVE_ATEXIT */
893 /* A C statement which is executed by the Haifa scheduler after it has scheduled
894 an insn from the ready list. FILE is either a null pointer, or a stdio stream
895 to write any debug output to. VERBOSE is the verbose level provided by
896 -fsched-verbose-<n>. INSN is the instruction that was scheduled. MORE is the
897 number of instructions that can be issued in the current cycle. This macro
898 is responsible for updating the value of MORE (typically by (MORE)--). */
899 /* #define MD_SCHED_VARIABLE_ISSUE (FILE, VERBOSE, INSN, MORE) */
902 /* Define the information needed to generate branch and scc insns. This is
903 stored from the compare operation. Note that we can't use "rtx" here
904 since it hasn't been defined! */
906 extern struct rtx_def *xstormy16_compare_op0, *xstormy16_compare_op1;
908 /* End of xstormy16.h */