clean up and renames beginigs of a testsuite
[official-gcc.git] / gcc / defaults.h
blob7aa227c3ff9a2adc3734c85eb81166f42ece389f
1 /* Definitions of various defaults for tm.h macros.
2 Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 2005, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc.
5 Contributed by Ron Guilmette (rfg@monkeys.com)
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 3, or (at your option) any later
12 version.
14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 for more details.
19 Under Section 7 of GPL version 3, you are granted additional
20 permissions described in the GCC Runtime Library Exception, version
21 3.1, as published by the Free Software Foundation.
23 You should have received a copy of the GNU General Public License and
24 a copy of the GCC Runtime Library Exception along with this program;
25 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26 <http://www.gnu.org/licenses/>. */
28 #ifndef GCC_DEFAULTS_H
29 #define GCC_DEFAULTS_H
31 #ifndef GET_ENVIRONMENT
32 #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0)
33 #endif
35 /* This defines which switch letters take arguments. */
37 #define DEFAULT_SWITCH_TAKES_ARG(CHAR) \
38 ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
39 || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
40 || (CHAR) == 'I' || (CHAR) == 'J' || (CHAR) == 'm' \
41 || (CHAR) == 'x' || (CHAR) == 'L' || (CHAR) == 'A' \
42 || (CHAR) == 'B' )
44 /* This defines which multi-letter switches take arguments. */
46 #define DEFAULT_WORD_SWITCH_TAKES_ARG(STR) \
47 (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext") \
48 || !strcmp (STR, "Tbss") || !strcmp (STR, "include") \
49 || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
50 || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
51 || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
52 || !strcmp (STR, "iquote") || !strcmp (STR, "isystem") \
53 || !strcmp (STR, "isysroot") || !strcmp (STR, "imultilib") \
54 || !strcmp (STR, "-param") || !strcmp (STR, "specs") \
55 || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ") \
56 || !strcmp (STR, "fintrinsic-modules-path") \
57 || !strcmp (STR, "dumpbase") || !strcmp (STR, "dumpdir"))
59 #ifndef SWITCH_TAKES_ARG
60 #define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG (CHAR)
61 #endif
63 #ifndef WORD_SWITCH_TAKES_ARG
64 #define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
65 #endif
67 /* Store in OUTPUT a string (made with alloca) containing an
68 assembler-name for a local static variable or function named NAME.
69 LABELNO is an integer which is different for each call. */
71 #ifndef ASM_PN_FORMAT
72 # ifndef NO_DOT_IN_LABEL
73 # define ASM_PN_FORMAT "%s.%lu"
74 # else
75 # ifndef NO_DOLLAR_IN_LABEL
76 # define ASM_PN_FORMAT "%s$%lu"
77 # else
78 # define ASM_PN_FORMAT "__%s_%lu"
79 # endif
80 # endif
81 #endif /* ! ASM_PN_FORMAT */
83 #ifndef ASM_FORMAT_PRIVATE_NAME
84 # define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
85 do { const char *const name_ = (NAME); \
86 char *const output_ = (OUTPUT) = \
87 (char *) alloca (strlen (name_) + 32); \
88 sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
89 } while (0)
90 #endif
92 /* Choose a reasonable default for ASM_OUTPUT_ASCII. */
94 #ifndef ASM_OUTPUT_ASCII
95 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
96 do { \
97 FILE *_hide_asm_out_file = (MYFILE); \
98 const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \
99 int _hide_thissize = (MYLENGTH); \
101 FILE *asm_out_file = _hide_asm_out_file; \
102 const unsigned char *p = _hide_p; \
103 int thissize = _hide_thissize; \
104 int i; \
105 fprintf (asm_out_file, "\t.ascii \""); \
107 for (i = 0; i < thissize; i++) \
109 int c = p[i]; \
110 if (c == '\"' || c == '\\') \
111 putc ('\\', asm_out_file); \
112 if (ISPRINT(c)) \
113 putc (c, asm_out_file); \
114 else \
116 fprintf (asm_out_file, "\\%o", c); \
117 /* After an octal-escape, if a digit follows, \
118 terminate one string constant and start another. \
119 The VAX assembler fails to stop reading the escape \
120 after three digits, so this is the only way we \
121 can get it to parse the data properly. */ \
122 if (i < thissize - 1 && ISDIGIT(p[i + 1])) \
123 fprintf (asm_out_file, "\"\n\t.ascii \""); \
126 fprintf (asm_out_file, "\"\n"); \
129 while (0)
130 #endif
132 /* This is how we tell the assembler to equate two values. */
133 #ifdef SET_ASM_OP
134 #ifndef ASM_OUTPUT_DEF
135 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
136 do { fprintf ((FILE), "%s", SET_ASM_OP); \
137 assemble_name (FILE, LABEL1); \
138 fprintf (FILE, ","); \
139 assemble_name (FILE, LABEL2); \
140 fprintf (FILE, "\n"); \
141 } while (0)
142 #endif
143 #endif
145 #ifndef TLS_COMMON_ASM_OP
146 #define TLS_COMMON_ASM_OP ".tls_common"
147 #endif
149 #if defined (HAVE_AS_TLS) && !defined (ASM_OUTPUT_TLS_COMMON)
150 #define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE) \
151 do \
153 fprintf ((FILE), "\t%s\t", TLS_COMMON_ASM_OP); \
154 assemble_name ((FILE), (NAME)); \
155 fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
156 (SIZE), DECL_ALIGN (DECL) / BITS_PER_UNIT); \
158 while (0)
159 #endif
161 /* Decide whether to defer emitting the assembler output for an equate
162 of two values. The default is to not defer output. */
163 #ifndef TARGET_DEFERRED_OUTPUT_DEFS
164 #define TARGET_DEFERRED_OUTPUT_DEFS(DECL,TARGET) false
165 #endif
167 /* This is how to output the definition of a user-level label named
168 NAME, such as the label on variable NAME. */
170 #ifndef ASM_OUTPUT_LABEL
171 #define ASM_OUTPUT_LABEL(FILE,NAME) \
172 do { assemble_name ((FILE), (NAME)); fputs (":\n", (FILE)); } while (0)
173 #endif
175 /* This is how to output the definition of a user-level label named
176 NAME, such as the label on a function. */
178 #ifndef ASM_OUTPUT_FUNCTION_LABEL
179 #define ASM_OUTPUT_FUNCTION_LABEL(FILE, NAME, DECL) \
180 ASM_OUTPUT_LABEL ((FILE), (NAME))
181 #endif
183 /* Output the definition of a compiler-generated label named NAME. */
184 #ifndef ASM_OUTPUT_INTERNAL_LABEL
185 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \
186 do { \
187 assemble_name_raw ((FILE), (NAME)); \
188 fputs (":\n", (FILE)); \
189 } while (0)
190 #endif
192 /* This is how to output a reference to a user-level label named NAME. */
194 #ifndef ASM_OUTPUT_LABELREF
195 #define ASM_OUTPUT_LABELREF(FILE,NAME) asm_fprintf ((FILE), "%U%s", (NAME))
196 #endif
198 /* Allow target to print debug info labels specially. This is useful for
199 VLIW targets, since debug info labels should go into the middle of
200 instruction bundles instead of breaking them. */
202 #ifndef ASM_OUTPUT_DEBUG_LABEL
203 #define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
204 (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM)
205 #endif
207 /* This is how we tell the assembler that a symbol is weak. */
208 #ifndef ASM_OUTPUT_WEAK_ALIAS
209 #if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
210 #define ASM_OUTPUT_WEAK_ALIAS(STREAM, NAME, VALUE) \
211 do \
213 ASM_WEAKEN_LABEL (STREAM, NAME); \
214 if (VALUE) \
215 ASM_OUTPUT_DEF (STREAM, NAME, VALUE); \
217 while (0)
218 #endif
219 #endif
221 /* This is how we tell the assembler that a symbol is a weak alias to
222 another symbol that doesn't require the other symbol to be defined.
223 Uses of the former will turn into weak uses of the latter, i.e.,
224 uses that, in case the latter is undefined, will not cause errors,
225 and will add it to the symbol table as weak undefined. However, if
226 the latter is referenced directly, a strong reference prevails. */
227 #ifndef ASM_OUTPUT_WEAKREF
228 #if defined HAVE_GAS_WEAKREF
229 #define ASM_OUTPUT_WEAKREF(FILE, DECL, NAME, VALUE) \
230 do \
232 fprintf ((FILE), "\t.weakref\t"); \
233 assemble_name ((FILE), (NAME)); \
234 fprintf ((FILE), ","); \
235 assemble_name ((FILE), (VALUE)); \
236 fprintf ((FILE), "\n"); \
238 while (0)
239 #endif
240 #endif
242 /* How to emit a .type directive. */
243 #ifndef ASM_OUTPUT_TYPE_DIRECTIVE
244 #if defined TYPE_ASM_OP && defined TYPE_OPERAND_FMT
245 #define ASM_OUTPUT_TYPE_DIRECTIVE(STREAM, NAME, TYPE) \
246 do \
248 fputs (TYPE_ASM_OP, STREAM); \
249 assemble_name (STREAM, NAME); \
250 fputs (", ", STREAM); \
251 fprintf (STREAM, TYPE_OPERAND_FMT, TYPE); \
252 putc ('\n', STREAM); \
254 while (0)
255 #endif
256 #endif
258 /* How to emit a .size directive. */
259 #ifndef ASM_OUTPUT_SIZE_DIRECTIVE
260 #ifdef SIZE_ASM_OP
261 #define ASM_OUTPUT_SIZE_DIRECTIVE(STREAM, NAME, SIZE) \
262 do \
264 HOST_WIDE_INT size_ = (SIZE); \
265 fputs (SIZE_ASM_OP, STREAM); \
266 assemble_name (STREAM, NAME); \
267 fprintf (STREAM, ", " HOST_WIDE_INT_PRINT_DEC "\n", size_); \
269 while (0)
271 #define ASM_OUTPUT_MEASURED_SIZE(STREAM, NAME) \
272 do \
274 fputs (SIZE_ASM_OP, STREAM); \
275 assemble_name (STREAM, NAME); \
276 fputs (", .-", STREAM); \
277 assemble_name (STREAM, NAME); \
278 putc ('\n', STREAM); \
280 while (0)
282 #endif
283 #endif
285 /* This determines whether or not we support weak symbols. */
286 #ifndef SUPPORTS_WEAK
287 #if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
288 #define SUPPORTS_WEAK 1
289 #else
290 #define SUPPORTS_WEAK 0
291 #endif
292 #endif
294 /* This determines whether or not we support the discriminator
295 attribute in the .loc directive. */
296 #ifndef SUPPORTS_DISCRIMINATOR
297 #ifdef HAVE_GAS_DISCRIMINATOR
298 #define SUPPORTS_DISCRIMINATOR 1
299 #else
300 #define SUPPORTS_DISCRIMINATOR 0
301 #endif
302 #endif
304 /* This determines whether or not we support link-once semantics. */
305 #ifndef SUPPORTS_ONE_ONLY
306 #ifdef MAKE_DECL_ONE_ONLY
307 #define SUPPORTS_ONE_ONLY 1
308 #else
309 #define SUPPORTS_ONE_ONLY 0
310 #endif
311 #endif
313 /* This determines whether weak symbols must be left out of a static
314 archive's table of contents. Defining this macro to be nonzero has
315 the consequence that certain symbols will not be made weak that
316 otherwise would be. The C++ ABI requires this macro to be zero;
317 see the documentation. */
318 #ifndef TARGET_WEAK_NOT_IN_ARCHIVE_TOC
319 #define TARGET_WEAK_NOT_IN_ARCHIVE_TOC 0
320 #endif
322 /* This determines whether or not we need linkonce unwind information. */
323 #ifndef TARGET_USES_WEAK_UNWIND_INFO
324 #define TARGET_USES_WEAK_UNWIND_INFO 0
325 #endif
327 /* By default, there is no prefix on user-defined symbols. */
328 #ifndef USER_LABEL_PREFIX
329 #define USER_LABEL_PREFIX ""
330 #endif
332 /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
333 provide a weak attribute. Else define it to nothing.
335 This would normally belong in ansidecl.h, but SUPPORTS_WEAK is
336 not available at that time.
338 Note, this is only for use by target files which we know are to be
339 compiled by GCC. */
340 #ifndef TARGET_ATTRIBUTE_WEAK
341 # if SUPPORTS_WEAK
342 # define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak))
343 # else
344 # define TARGET_ATTRIBUTE_WEAK
345 # endif
346 #endif
348 /* Determines whether we may use common symbols to represent one-only
349 semantics (a.k.a. "vague linkage"). */
350 #ifndef USE_COMMON_FOR_ONE_ONLY
351 # define USE_COMMON_FOR_ONE_ONLY 1
352 #endif
354 /* By default we can assume that all global symbols are in one namespace,
355 across all shared libraries. */
356 #ifndef MULTIPLE_SYMBOL_SPACES
357 # define MULTIPLE_SYMBOL_SPACES 0
358 #endif
360 /* If the target supports init_priority C++ attribute, give
361 SUPPORTS_INIT_PRIORITY a nonzero value. */
362 #ifndef SUPPORTS_INIT_PRIORITY
363 #define SUPPORTS_INIT_PRIORITY 1
364 #endif /* SUPPORTS_INIT_PRIORITY */
366 /* If duplicate library search directories can be removed from a
367 linker command without changing the linker's semantics, give this
368 symbol a nonzero. */
369 #ifndef LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
370 #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 0
371 #endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */
373 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
374 the rest of the DWARF 2 frame unwind support is also provided. */
375 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX) \
376 && !defined (TARGET_UNWIND_INFO)
377 #define DWARF2_UNWIND_INFO 1
378 #endif
380 /* If we have named sections, and we're using crtstuff to run ctors,
381 use them for registering eh frame information. */
382 #if defined (TARGET_ASM_NAMED_SECTION) && DWARF2_UNWIND_INFO \
383 && !defined(EH_FRAME_IN_DATA_SECTION)
384 #ifndef EH_FRAME_SECTION_NAME
385 #define EH_FRAME_SECTION_NAME ".eh_frame"
386 #endif
387 #endif
389 /* On many systems, different EH table encodings are used under
390 difference circumstances. Some will require runtime relocations;
391 some will not. For those that do not require runtime relocations,
392 we would like to make the table read-only. However, since the
393 read-only tables may need to be combined with read-write tables
394 that do require runtime relocation, it is not safe to make the
395 tables read-only unless the linker will merge read-only and
396 read-write sections into a single read-write section. If your
397 linker does not have this ability, but your system is such that no
398 encoding used with non-PIC code will ever require a runtime
399 relocation, then you can define EH_TABLES_CAN_BE_READ_ONLY to 1 in
400 your target configuration file. */
401 #ifndef EH_TABLES_CAN_BE_READ_ONLY
402 #ifdef HAVE_LD_RO_RW_SECTION_MIXING
403 #define EH_TABLES_CAN_BE_READ_ONLY 1
404 #else
405 #define EH_TABLES_CAN_BE_READ_ONLY 0
406 #endif
407 #endif
409 /* If we have named section and we support weak symbols, then use the
410 .jcr section for recording java classes which need to be registered
411 at program start-up time. */
412 #if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
413 #ifndef JCR_SECTION_NAME
414 #define JCR_SECTION_NAME ".jcr"
415 #endif
416 #endif
418 /* This decision to use a .jcr section can be overridden by defining
419 USE_JCR_SECTION to 0 in target file. This is necessary if target
420 can define JCR_SECTION_NAME but does not have crtstuff or
421 linker support for .jcr section. */
422 #ifndef TARGET_USE_JCR_SECTION
423 #ifdef JCR_SECTION_NAME
424 #define TARGET_USE_JCR_SECTION 1
425 #else
426 #define TARGET_USE_JCR_SECTION 0
427 #endif
428 #endif
430 /* Number of hardware registers that go into the DWARF-2 unwind info.
431 If not defined, equals FIRST_PSEUDO_REGISTER */
433 #ifndef DWARF_FRAME_REGISTERS
434 #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
435 #endif
437 /* How to renumber registers for dbx and gdb. If not defined, assume
438 no renumbering is necessary. */
440 #ifndef DBX_REGISTER_NUMBER
441 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
442 #endif
444 /* Default sizes for base C types. If the sizes are different for
445 your target, you should override these values by defining the
446 appropriate symbols in your tm.h file. */
448 #ifndef BITS_PER_UNIT
449 #define BITS_PER_UNIT 8
450 #endif
452 #ifndef BITS_PER_WORD
453 #define BITS_PER_WORD (BITS_PER_UNIT * UNITS_PER_WORD)
454 #endif
456 #ifndef CHAR_TYPE_SIZE
457 #define CHAR_TYPE_SIZE BITS_PER_UNIT
458 #endif
460 #ifndef BOOL_TYPE_SIZE
461 /* `bool' has size and alignment `1', on almost all platforms. */
462 #define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
463 #endif
465 #ifndef SHORT_TYPE_SIZE
466 #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
467 #endif
469 #ifndef INT_TYPE_SIZE
470 #define INT_TYPE_SIZE BITS_PER_WORD
471 #endif
473 #ifndef LONG_TYPE_SIZE
474 #define LONG_TYPE_SIZE BITS_PER_WORD
475 #endif
477 #ifndef LONG_LONG_TYPE_SIZE
478 #define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
479 #endif
481 #ifndef WCHAR_TYPE_SIZE
482 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
483 #endif
485 #ifndef FLOAT_TYPE_SIZE
486 #define FLOAT_TYPE_SIZE BITS_PER_WORD
487 #endif
489 #ifndef DOUBLE_TYPE_SIZE
490 #define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
491 #endif
493 #ifndef LONG_DOUBLE_TYPE_SIZE
494 #define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
495 #endif
497 #ifndef DECIMAL32_TYPE_SIZE
498 #define DECIMAL32_TYPE_SIZE 32
499 #endif
501 #ifndef DECIMAL64_TYPE_SIZE
502 #define DECIMAL64_TYPE_SIZE 64
503 #endif
505 #ifndef DECIMAL128_TYPE_SIZE
506 #define DECIMAL128_TYPE_SIZE 128
507 #endif
509 #ifndef SHORT_FRACT_TYPE_SIZE
510 #define SHORT_FRACT_TYPE_SIZE BITS_PER_UNIT
511 #endif
513 #ifndef FRACT_TYPE_SIZE
514 #define FRACT_TYPE_SIZE (BITS_PER_UNIT * 2)
515 #endif
517 #ifndef LONG_FRACT_TYPE_SIZE
518 #define LONG_FRACT_TYPE_SIZE (BITS_PER_UNIT * 4)
519 #endif
521 #ifndef LONG_LONG_FRACT_TYPE_SIZE
522 #define LONG_LONG_FRACT_TYPE_SIZE (BITS_PER_UNIT * 8)
523 #endif
525 #ifndef SHORT_ACCUM_TYPE_SIZE
526 #define SHORT_ACCUM_TYPE_SIZE (SHORT_FRACT_TYPE_SIZE * 2)
527 #endif
529 #ifndef ACCUM_TYPE_SIZE
530 #define ACCUM_TYPE_SIZE (FRACT_TYPE_SIZE * 2)
531 #endif
533 #ifndef LONG_ACCUM_TYPE_SIZE
534 #define LONG_ACCUM_TYPE_SIZE (LONG_FRACT_TYPE_SIZE * 2)
535 #endif
537 #ifndef LONG_LONG_ACCUM_TYPE_SIZE
538 #define LONG_LONG_ACCUM_TYPE_SIZE (LONG_LONG_FRACT_TYPE_SIZE * 2)
539 #endif
541 /* We let tm.h override the types used here, to handle trivial differences
542 such as the choice of unsigned int or long unsigned int for size_t.
543 When machines start needing nontrivial differences in the size type,
544 it would be best to do something here to figure out automatically
545 from other information what type to use. */
547 #ifndef SIZE_TYPE
548 #define SIZE_TYPE "long unsigned int"
549 #endif
551 #ifndef PID_TYPE
552 #define PID_TYPE "int"
553 #endif
555 /* If GCC knows the exact uint_least16_t and uint_least32_t types from
556 <stdint.h>, use them for char16_t and char32_t. Otherwise, use
557 these guesses; getting the wrong type of a given width will not
558 affect C++ name mangling because in C++ these are distinct types
559 not typedefs. */
561 #ifdef UINT_LEAST16_TYPE
562 #define CHAR16_TYPE UINT_LEAST16_TYPE
563 #else
564 #define CHAR16_TYPE "short unsigned int"
565 #endif
567 #ifdef UINT_LEAST32_TYPE
568 #define CHAR32_TYPE UINT_LEAST32_TYPE
569 #else
570 #define CHAR32_TYPE "unsigned int"
571 #endif
573 #ifndef WCHAR_TYPE
574 #define WCHAR_TYPE "int"
575 #endif
577 /* WCHAR_TYPE gets overridden by -fshort-wchar. */
578 #define MODIFIED_WCHAR_TYPE \
579 (flag_short_wchar ? "short unsigned int" : WCHAR_TYPE)
581 #ifndef PTRDIFF_TYPE
582 #define PTRDIFF_TYPE "long int"
583 #endif
585 #ifndef WINT_TYPE
586 #define WINT_TYPE "unsigned int"
587 #endif
589 #ifndef INTMAX_TYPE
590 #define INTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
591 ? "int" \
592 : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
593 ? "long int" \
594 : "long long int"))
595 #endif
597 #ifndef UINTMAX_TYPE
598 #define UINTMAX_TYPE ((INT_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
599 ? "unsigned int" \
600 : ((LONG_TYPE_SIZE == LONG_LONG_TYPE_SIZE) \
601 ? "long unsigned int" \
602 : "long long unsigned int"))
603 #endif
606 /* There are no default definitions of these <stdint.h> types. */
608 #ifndef SIG_ATOMIC_TYPE
609 #define SIG_ATOMIC_TYPE ((const char *) NULL)
610 #endif
612 #ifndef INT8_TYPE
613 #define INT8_TYPE ((const char *) NULL)
614 #endif
616 #ifndef INT16_TYPE
617 #define INT16_TYPE ((const char *) NULL)
618 #endif
620 #ifndef INT32_TYPE
621 #define INT32_TYPE ((const char *) NULL)
622 #endif
624 #ifndef INT64_TYPE
625 #define INT64_TYPE ((const char *) NULL)
626 #endif
628 #ifndef UINT8_TYPE
629 #define UINT8_TYPE ((const char *) NULL)
630 #endif
632 #ifndef UINT16_TYPE
633 #define UINT16_TYPE ((const char *) NULL)
634 #endif
636 #ifndef UINT32_TYPE
637 #define UINT32_TYPE ((const char *) NULL)
638 #endif
640 #ifndef UINT64_TYPE
641 #define UINT64_TYPE ((const char *) NULL)
642 #endif
644 #ifndef INT_LEAST8_TYPE
645 #define INT_LEAST8_TYPE ((const char *) NULL)
646 #endif
648 #ifndef INT_LEAST16_TYPE
649 #define INT_LEAST16_TYPE ((const char *) NULL)
650 #endif
652 #ifndef INT_LEAST32_TYPE
653 #define INT_LEAST32_TYPE ((const char *) NULL)
654 #endif
656 #ifndef INT_LEAST64_TYPE
657 #define INT_LEAST64_TYPE ((const char *) NULL)
658 #endif
660 #ifndef UINT_LEAST8_TYPE
661 #define UINT_LEAST8_TYPE ((const char *) NULL)
662 #endif
664 #ifndef UINT_LEAST16_TYPE
665 #define UINT_LEAST16_TYPE ((const char *) NULL)
666 #endif
668 #ifndef UINT_LEAST32_TYPE
669 #define UINT_LEAST32_TYPE ((const char *) NULL)
670 #endif
672 #ifndef UINT_LEAST64_TYPE
673 #define UINT_LEAST64_TYPE ((const char *) NULL)
674 #endif
676 #ifndef INT_FAST8_TYPE
677 #define INT_FAST8_TYPE ((const char *) NULL)
678 #endif
680 #ifndef INT_FAST16_TYPE
681 #define INT_FAST16_TYPE ((const char *) NULL)
682 #endif
684 #ifndef INT_FAST32_TYPE
685 #define INT_FAST32_TYPE ((const char *) NULL)
686 #endif
688 #ifndef INT_FAST64_TYPE
689 #define INT_FAST64_TYPE ((const char *) NULL)
690 #endif
692 #ifndef UINT_FAST8_TYPE
693 #define UINT_FAST8_TYPE ((const char *) NULL)
694 #endif
696 #ifndef UINT_FAST16_TYPE
697 #define UINT_FAST16_TYPE ((const char *) NULL)
698 #endif
700 #ifndef UINT_FAST32_TYPE
701 #define UINT_FAST32_TYPE ((const char *) NULL)
702 #endif
704 #ifndef UINT_FAST64_TYPE
705 #define UINT_FAST64_TYPE ((const char *) NULL)
706 #endif
708 #ifndef INTPTR_TYPE
709 #define INTPTR_TYPE ((const char *) NULL)
710 #endif
712 #ifndef UINTPTR_TYPE
713 #define UINTPTR_TYPE ((const char *) NULL)
714 #endif
716 /* Width in bits of a pointer. Mind the value of the macro `Pmode'. */
717 #ifndef POINTER_SIZE
718 #define POINTER_SIZE BITS_PER_WORD
719 #endif
721 #ifndef PIC_OFFSET_TABLE_REGNUM
722 #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
723 #endif
725 #ifndef TARGET_DLLIMPORT_DECL_ATTRIBUTES
726 #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 0
727 #endif
729 #ifndef TARGET_DECLSPEC
730 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
731 /* If the target supports the "dllimport" attribute, users are
732 probably used to the "__declspec" syntax. */
733 #define TARGET_DECLSPEC 1
734 #else
735 #define TARGET_DECLSPEC 0
736 #endif
737 #endif
739 /* By default, the preprocessor should be invoked the same way in C++
740 as in C. */
741 #ifndef CPLUSPLUS_CPP_SPEC
742 #ifdef CPP_SPEC
743 #define CPLUSPLUS_CPP_SPEC CPP_SPEC
744 #endif
745 #endif
747 #ifndef ACCUMULATE_OUTGOING_ARGS
748 #define ACCUMULATE_OUTGOING_ARGS 0
749 #endif
751 /* Supply a default definition for PUSH_ARGS. */
752 #ifndef PUSH_ARGS
753 #ifdef PUSH_ROUNDING
754 #define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS
755 #else
756 #define PUSH_ARGS 0
757 #endif
758 #endif
760 /* Decide whether a function's arguments should be processed
761 from first to last or from last to first.
763 They should if the stack and args grow in opposite directions, but
764 only if we have push insns. */
766 #ifdef PUSH_ROUNDING
768 #ifndef PUSH_ARGS_REVERSED
769 #if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD)
770 #define PUSH_ARGS_REVERSED PUSH_ARGS
771 #endif
772 #endif
774 #endif
776 #ifndef PUSH_ARGS_REVERSED
777 #define PUSH_ARGS_REVERSED 0
778 #endif
780 /* Default value for the alignment (in bits) a C conformant malloc has to
781 provide. This default is intended to be safe and always correct. */
782 #ifndef MALLOC_ABI_ALIGNMENT
783 #define MALLOC_ABI_ALIGNMENT BITS_PER_WORD
784 #endif
786 /* If PREFERRED_STACK_BOUNDARY is not defined, set it to STACK_BOUNDARY.
787 STACK_BOUNDARY is required. */
788 #ifndef PREFERRED_STACK_BOUNDARY
789 #define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
790 #endif
792 /* Set INCOMING_STACK_BOUNDARY to PREFERRED_STACK_BOUNDARY if it is not
793 defined. */
794 #ifndef INCOMING_STACK_BOUNDARY
795 #define INCOMING_STACK_BOUNDARY PREFERRED_STACK_BOUNDARY
796 #endif
798 #ifndef TARGET_DEFAULT_PACK_STRUCT
799 #define TARGET_DEFAULT_PACK_STRUCT 0
800 #endif
802 /* By default, the C++ compiler will use function addresses in the
803 vtable entries. Setting this nonzero tells the compiler to use
804 function descriptors instead. The value of this macro says how
805 many words wide the descriptor is (normally 2). It is assumed
806 that the address of a function descriptor may be treated as a
807 pointer to a function. */
808 #ifndef TARGET_VTABLE_USES_DESCRIPTORS
809 #define TARGET_VTABLE_USES_DESCRIPTORS 0
810 #endif
812 /* By default, the vtable entries are void pointers, the so the alignment
813 is the same as pointer alignment. The value of this macro specifies
814 the alignment of the vtable entry in bits. It should be defined only
815 when special alignment is necessary. */
816 #ifndef TARGET_VTABLE_ENTRY_ALIGN
817 #define TARGET_VTABLE_ENTRY_ALIGN POINTER_SIZE
818 #endif
820 /* There are a few non-descriptor entries in the vtable at offsets below
821 zero. If these entries must be padded (say, to preserve the alignment
822 specified by TARGET_VTABLE_ENTRY_ALIGN), set this to the number of
823 words in each data entry. */
824 #ifndef TARGET_VTABLE_DATA_ENTRY_DISTANCE
825 #define TARGET_VTABLE_DATA_ENTRY_DISTANCE 1
826 #endif
828 /* Decide whether it is safe to use a local alias for a virtual function
829 when constructing thunks. */
830 #ifndef TARGET_USE_LOCAL_THUNK_ALIAS_P
831 #ifdef ASM_OUTPUT_DEF
832 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 1
833 #else
834 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 0
835 #endif
836 #endif
838 /* Select a format to encode pointers in exception handling data. We
839 prefer those that result in fewer dynamic relocations. Assume no
840 special support here and encode direct references. */
841 #ifndef ASM_PREFERRED_EH_DATA_FORMAT
842 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) DW_EH_PE_absptr
843 #endif
845 /* By default, the C++ compiler will use the lowest bit of the pointer
846 to function to indicate a pointer-to-member-function points to a
847 virtual member function. However, if FUNCTION_BOUNDARY indicates
848 function addresses aren't always even, the lowest bit of the delta
849 field will be used. */
850 #ifndef TARGET_PTRMEMFUNC_VBIT_LOCATION
851 #define TARGET_PTRMEMFUNC_VBIT_LOCATION \
852 (FUNCTION_BOUNDARY >= 2 * BITS_PER_UNIT \
853 ? ptrmemfunc_vbit_in_pfn : ptrmemfunc_vbit_in_delta)
854 #endif
856 #ifndef DEFAULT_GDB_EXTENSIONS
857 #define DEFAULT_GDB_EXTENSIONS 1
858 #endif
860 /* If more than one debugging type is supported, you must define
861 PREFERRED_DEBUGGING_TYPE to choose the default. */
863 #if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) \
864 + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \
865 + defined (VMS_DEBUGGING_INFO))
866 #ifndef PREFERRED_DEBUGGING_TYPE
867 #error You must define PREFERRED_DEBUGGING_TYPE
868 #endif /* no PREFERRED_DEBUGGING_TYPE */
870 /* If only one debugging format is supported, define PREFERRED_DEBUGGING_TYPE
871 here so other code needn't care. */
872 #elif defined DBX_DEBUGGING_INFO
873 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
875 #elif defined SDB_DEBUGGING_INFO
876 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
878 #elif defined DWARF2_DEBUGGING_INFO
879 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
881 #elif defined VMS_DEBUGGING_INFO
882 #define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
884 #elif defined XCOFF_DEBUGGING_INFO
885 #define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
887 #else
888 /* No debugging format is supported by this target. */
889 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
890 #endif
892 #ifndef LARGEST_EXPONENT_IS_NORMAL
893 #define LARGEST_EXPONENT_IS_NORMAL(SIZE) 0
894 #endif
896 #ifndef ROUND_TOWARDS_ZERO
897 #define ROUND_TOWARDS_ZERO 0
898 #endif
900 #ifndef FLOAT_LIB_COMPARE_RETURNS_BOOL
901 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) false
902 #endif
904 /* True if the targets integer-comparison functions return { 0, 1, 2
905 } to indicate { <, ==, > }. False if { -1, 0, 1 } is used
906 instead. The libgcc routines are biased. */
907 #ifndef TARGET_LIB_INT_CMP_BIASED
908 #define TARGET_LIB_INT_CMP_BIASED (true)
909 #endif
911 /* If FLOAT_WORDS_BIG_ENDIAN is not defined in the header files,
912 then the word-endianness is the same as for integers. */
913 #ifndef FLOAT_WORDS_BIG_ENDIAN
914 #define FLOAT_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
915 #endif
917 #ifdef TARGET_FLT_EVAL_METHOD
918 #define TARGET_FLT_EVAL_METHOD_NON_DEFAULT 1
919 #else
920 #define TARGET_FLT_EVAL_METHOD 0
921 #define TARGET_FLT_EVAL_METHOD_NON_DEFAULT 0
922 #endif
924 #ifndef TARGET_DEC_EVAL_METHOD
925 #define TARGET_DEC_EVAL_METHOD 2
926 #endif
928 #ifndef HOT_TEXT_SECTION_NAME
929 #define HOT_TEXT_SECTION_NAME ".text.hot"
930 #endif
932 #ifndef UNLIKELY_EXECUTED_TEXT_SECTION_NAME
933 #define UNLIKELY_EXECUTED_TEXT_SECTION_NAME ".text.unlikely"
934 #endif
936 #ifndef HAS_LONG_COND_BRANCH
937 #define HAS_LONG_COND_BRANCH 0
938 #endif
940 #ifndef HAS_LONG_UNCOND_BRANCH
941 #define HAS_LONG_UNCOND_BRANCH 0
942 #endif
944 /* By default, only attempt to parallelize bitwise operations, and
945 possibly adds/subtracts using bit-twiddling. */
946 #ifndef UNITS_PER_SIMD_WORD
947 #define UNITS_PER_SIMD_WORD(MODE) UNITS_PER_WORD
948 #endif
950 /* Determine whether __cxa_atexit, rather than atexit, is used to
951 register C++ destructors for local statics and global objects. */
952 #ifndef DEFAULT_USE_CXA_ATEXIT
953 #define DEFAULT_USE_CXA_ATEXIT 0
954 #endif
956 /* If none of these macros are defined, the port must use the new
957 technique of defining constraints in the machine description.
958 tm_p.h will define those macros that machine-independent code
959 still uses. */
960 #if !defined CONSTRAINT_LEN \
961 && !defined REG_CLASS_FROM_LETTER \
962 && !defined REG_CLASS_FROM_CONSTRAINT \
963 && !defined CONST_OK_FOR_LETTER_P \
964 && !defined CONST_OK_FOR_CONSTRAINT_P \
965 && !defined CONST_DOUBLE_OK_FOR_LETTER_P \
966 && !defined CONST_DOUBLE_OK_FOR_CONSTRAINT_P \
967 && !defined EXTRA_CONSTRAINT \
968 && !defined EXTRA_CONSTRAINT_STR \
969 && !defined EXTRA_MEMORY_CONSTRAINT \
970 && !defined EXTRA_ADDRESS_CONSTRAINT
972 #define USE_MD_CONSTRAINTS
974 #if GCC_VERSION >= 3000 && defined IN_GCC
975 /* These old constraint macros shouldn't appear anywhere in a
976 configuration using MD constraint definitions. */
977 #pragma GCC poison REG_CLASS_FROM_LETTER CONST_OK_FOR_LETTER_P \
978 CONST_DOUBLE_OK_FOR_LETTER_P EXTRA_CONSTRAINT
979 #endif
981 #else /* old constraint mechanism in use */
983 /* Determine whether extra constraint letter should be handled
984 via address reload (like 'o'). */
985 #ifndef EXTRA_MEMORY_CONSTRAINT
986 #define EXTRA_MEMORY_CONSTRAINT(C,STR) 0
987 #endif
989 /* Determine whether extra constraint letter should be handled
990 as an address (like 'p'). */
991 #ifndef EXTRA_ADDRESS_CONSTRAINT
992 #define EXTRA_ADDRESS_CONSTRAINT(C,STR) 0
993 #endif
995 /* When a port defines CONSTRAINT_LEN, it should use DEFAULT_CONSTRAINT_LEN
996 for all the characters that it does not want to change, so things like the
997 'length' of a digit in a matching constraint is an implementation detail,
998 and not part of the interface. */
999 #define DEFAULT_CONSTRAINT_LEN(C,STR) 1
1001 #ifndef CONSTRAINT_LEN
1002 #define CONSTRAINT_LEN(C,STR) DEFAULT_CONSTRAINT_LEN (C, STR)
1003 #endif
1005 #if defined (CONST_OK_FOR_LETTER_P) && ! defined (CONST_OK_FOR_CONSTRAINT_P)
1006 #define CONST_OK_FOR_CONSTRAINT_P(VAL,C,STR) CONST_OK_FOR_LETTER_P (VAL, C)
1007 #endif
1009 #if defined (CONST_DOUBLE_OK_FOR_LETTER_P) && ! defined (CONST_DOUBLE_OK_FOR_CONSTRAINT_P)
1010 #define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(OP,C,STR) \
1011 CONST_DOUBLE_OK_FOR_LETTER_P (OP, C)
1012 #endif
1014 #ifndef REG_CLASS_FROM_CONSTRAINT
1015 #define REG_CLASS_FROM_CONSTRAINT(C,STR) REG_CLASS_FROM_LETTER (C)
1016 #endif
1018 #if defined (EXTRA_CONSTRAINT) && ! defined (EXTRA_CONSTRAINT_STR)
1019 #define EXTRA_CONSTRAINT_STR(OP, C,STR) EXTRA_CONSTRAINT (OP, C)
1020 #endif
1022 #endif /* old constraint mechanism in use */
1024 /* Determine whether the entire c99 runtime
1025 is present in the runtime library. */
1026 #ifndef TARGET_C99_FUNCTIONS
1027 #define TARGET_C99_FUNCTIONS 0
1028 #endif
1030 /* Determine whether the target runtime library has
1031 a sincos implementation following the GNU extension. */
1032 #ifndef TARGET_HAS_SINCOS
1033 #define TARGET_HAS_SINCOS 0
1034 #endif
1036 /* Indicate that CLZ and CTZ are undefined at zero. */
1037 #ifndef CLZ_DEFINED_VALUE_AT_ZERO
1038 #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0
1039 #endif
1040 #ifndef CTZ_DEFINED_VALUE_AT_ZERO
1041 #define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0
1042 #endif
1044 /* Provide a default value for STORE_FLAG_VALUE. */
1045 #ifndef STORE_FLAG_VALUE
1046 #define STORE_FLAG_VALUE 1
1047 #endif
1049 /* This macro is used to determine what the largest unit size that
1050 move_by_pieces can use is. */
1052 /* MOVE_MAX_PIECES is the number of bytes at a time which we can
1053 move efficiently, as opposed to MOVE_MAX which is the maximum
1054 number of bytes we can move with a single instruction. */
1056 #ifndef MOVE_MAX_PIECES
1057 #define MOVE_MAX_PIECES MOVE_MAX
1058 #endif
1060 #ifndef MAX_MOVE_MAX
1061 #define MAX_MOVE_MAX MOVE_MAX
1062 #endif
1064 #ifndef MIN_UNITS_PER_WORD
1065 #define MIN_UNITS_PER_WORD UNITS_PER_WORD
1066 #endif
1068 #ifndef MAX_BITS_PER_WORD
1069 #define MAX_BITS_PER_WORD BITS_PER_WORD
1070 #endif
1072 #ifndef STACK_POINTER_OFFSET
1073 #define STACK_POINTER_OFFSET 0
1074 #endif
1076 #ifndef LOCAL_REGNO
1077 #define LOCAL_REGNO(REGNO) 0
1078 #endif
1080 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
1081 the stack pointer does not matter. The value is tested only in
1082 functions that have frame pointers. */
1083 #ifndef EXIT_IGNORE_STACK
1084 #define EXIT_IGNORE_STACK 0
1085 #endif
1087 /* Assume that case vectors are not pc-relative. */
1088 #ifndef CASE_VECTOR_PC_RELATIVE
1089 #define CASE_VECTOR_PC_RELATIVE 0
1090 #endif
1092 /* Assume that trampolines need function alignment. */
1093 #ifndef TRAMPOLINE_ALIGNMENT
1094 #define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY
1095 #endif
1097 /* Register mappings for target machines without register windows. */
1098 #ifndef INCOMING_REGNO
1099 #define INCOMING_REGNO(N) (N)
1100 #endif
1102 #ifndef OUTGOING_REGNO
1103 #define OUTGOING_REGNO(N) (N)
1104 #endif
1106 #ifndef SHIFT_COUNT_TRUNCATED
1107 #define SHIFT_COUNT_TRUNCATED 0
1108 #endif
1110 #ifndef LEGITIMATE_PIC_OPERAND_P
1111 #define LEGITIMATE_PIC_OPERAND_P(X) 1
1112 #endif
1114 #ifndef TARGET_MEM_CONSTRAINT
1115 #define TARGET_MEM_CONSTRAINT 'm'
1116 #endif
1118 #ifndef REVERSIBLE_CC_MODE
1119 #define REVERSIBLE_CC_MODE(MODE) 0
1120 #endif
1122 /* Biggest alignment supported by the object file format of this machine. */
1123 #ifndef MAX_OFILE_ALIGNMENT
1124 #define MAX_OFILE_ALIGNMENT BIGGEST_ALIGNMENT
1125 #endif
1127 #ifndef FRAME_GROWS_DOWNWARD
1128 #define FRAME_GROWS_DOWNWARD 0
1129 #endif
1131 /* On most machines, the CFA coincides with the first incoming parm. */
1132 #ifndef ARG_POINTER_CFA_OFFSET
1133 #define ARG_POINTER_CFA_OFFSET(FNDECL) \
1134 (FIRST_PARM_OFFSET (FNDECL) + crtl->args.pretend_args_size)
1135 #endif
1137 /* On most machines, we use the CFA as DW_AT_frame_base. */
1138 #ifndef CFA_FRAME_BASE_OFFSET
1139 #define CFA_FRAME_BASE_OFFSET(FNDECL) 0
1140 #endif
1142 /* The offset from the incoming value of %sp to the top of the stack frame
1143 for the current function. */
1144 #ifndef INCOMING_FRAME_SP_OFFSET
1145 #define INCOMING_FRAME_SP_OFFSET 0
1146 #endif
1148 #ifndef HARD_REGNO_NREGS_HAS_PADDING
1149 #define HARD_REGNO_NREGS_HAS_PADDING(REGNO, MODE) 0
1150 #define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) -1
1151 #endif
1153 #ifndef OUTGOING_REG_PARM_STACK_SPACE
1154 #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 0
1155 #endif
1157 /* MAX_STACK_ALIGNMENT is the maximum stack alignment guaranteed by
1158 the backend. MAX_SUPPORTED_STACK_ALIGNMENT is the maximum best
1159 effort stack alignment supported by the backend. If the backend
1160 supports stack alignment, MAX_SUPPORTED_STACK_ALIGNMENT and
1161 MAX_STACK_ALIGNMENT are the same. Otherwise, the incoming stack
1162 boundary will limit the maximum guaranteed stack alignment. */
1163 #ifdef MAX_STACK_ALIGNMENT
1164 #define MAX_SUPPORTED_STACK_ALIGNMENT MAX_STACK_ALIGNMENT
1165 #else
1166 #define MAX_STACK_ALIGNMENT STACK_BOUNDARY
1167 #define MAX_SUPPORTED_STACK_ALIGNMENT PREFERRED_STACK_BOUNDARY
1168 #endif
1170 #define SUPPORTS_STACK_ALIGNMENT (MAX_STACK_ALIGNMENT > STACK_BOUNDARY)
1172 #ifndef LOCAL_ALIGNMENT
1173 #define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT
1174 #endif
1176 #ifndef STACK_SLOT_ALIGNMENT
1177 #define STACK_SLOT_ALIGNMENT(TYPE,MODE,ALIGN) \
1178 ((TYPE) ? LOCAL_ALIGNMENT ((TYPE), (ALIGN)) : (ALIGN))
1179 #endif
1181 #ifndef LOCAL_DECL_ALIGNMENT
1182 #define LOCAL_DECL_ALIGNMENT(DECL) \
1183 LOCAL_ALIGNMENT (TREE_TYPE (DECL), DECL_ALIGN (DECL))
1184 #endif
1186 #ifndef MINIMUM_ALIGNMENT
1187 #define MINIMUM_ALIGNMENT(EXP,MODE,ALIGN) (ALIGN)
1188 #endif
1190 /* Alignment value for attribute ((aligned)). */
1191 #ifndef ATTRIBUTE_ALIGNED_VALUE
1192 #define ATTRIBUTE_ALIGNED_VALUE BIGGEST_ALIGNMENT
1193 #endif
1195 /* Many ports have no mode-dependent addresses (except possibly autoincrement
1196 and autodecrement addresses, which are handled by target-independent code
1197 in recog.c). */
1198 #ifndef GO_IF_MODE_DEPENDENT_ADDRESS
1199 #define GO_IF_MODE_DEPENDENT_ADDRESS(X, WIN)
1200 #endif
1202 /* For most ports anything that evaluates to a constant symbolic
1203 or integer value is acceptable as a constant address. */
1204 #ifndef CONSTANT_ADDRESS_P
1205 #define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X) && GET_CODE (X) != CONST_DOUBLE)
1206 #endif
1208 #ifndef MAX_FIXED_MODE_SIZE
1209 #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
1210 #endif
1212 /* Nonzero if structures and unions should be returned in memory.
1214 This should only be defined if compatibility with another compiler or
1215 with an ABI is needed, because it results in slower code. */
1217 #ifndef DEFAULT_PCC_STRUCT_RETURN
1218 #define DEFAULT_PCC_STRUCT_RETURN 1
1219 #endif
1221 #ifdef GCC_INSN_FLAGS_H
1222 /* Dependent default target macro definitions
1224 This section of defaults.h defines target macros that depend on generated
1225 headers. This is a bit awkward: We want to put all default definitions
1226 for target macros in defaults.h, but some of the defaults depend on the
1227 HAVE_* flags defines of insn-flags.h. But insn-flags.h is not always
1228 included by files that do include defaults.h.
1230 Fortunately, the default macro definitions that depend on the HAVE_*
1231 macros are also the ones that will only be used inside GCC itself, i.e.
1232 not in the gen* programs or in target objects like libgcc.
1234 Obviously, it would be best to keep this section of defaults.h as small
1235 as possible, by converting the macros defined below to target hooks or
1236 functions.
1239 /* Just because the user configured --with-sjlj-exceptions=no doesn't
1240 mean that we can use call frame exceptions. Detect that the target
1241 has appropriate support. */
1243 #ifndef MUST_USE_SJLJ_EXCEPTIONS
1244 # if defined (EH_RETURN_DATA_REGNO) \
1245 && (defined (TARGET_UNWIND_INFO) \
1246 || (DWARF2_UNWIND_INFO \
1247 && (defined (EH_RETURN_HANDLER_RTX) \
1248 || defined (HAVE_eh_return))))
1249 # define MUST_USE_SJLJ_EXCEPTIONS 0
1250 # else
1251 # define MUST_USE_SJLJ_EXCEPTIONS 1
1252 # endif
1253 #endif
1255 #ifdef CONFIG_SJLJ_EXCEPTIONS
1256 # if CONFIG_SJLJ_EXCEPTIONS == 1
1257 # define USING_SJLJ_EXCEPTIONS 1
1258 # endif
1259 # if CONFIG_SJLJ_EXCEPTIONS == 0
1260 # define USING_SJLJ_EXCEPTIONS 0
1261 # if !defined(EH_RETURN_DATA_REGNO)
1262 #error "EH_RETURN_DATA_REGNO required"
1263 # endif
1264 # if ! (defined(TARGET_UNWIND_INFO) || DWARF2_UNWIND_INFO)
1265 #error "{DWARF2,TARGET}_UNWIND_INFO required"
1266 # endif
1267 # if !defined(TARGET_UNWIND_INFO) \
1268 && !(defined(EH_RETURN_HANDLER_RTX) || defined(HAVE_eh_return))
1269 #error "EH_RETURN_HANDLER_RTX or eh_return required"
1270 # endif
1271 /* Usually the above error checks will have already triggered an
1272 error, but backends may set MUST_USE_SJLJ_EXCEPTIONS for their own
1273 reasons. */
1274 # if MUST_USE_SJLJ_EXCEPTIONS
1275 #error "Must use SJLJ exceptions but configured not to"
1276 # endif
1277 # endif
1278 #else
1279 # define USING_SJLJ_EXCEPTIONS MUST_USE_SJLJ_EXCEPTIONS
1280 #endif
1282 /* The default branch cost is 1. */
1283 #ifndef BRANCH_COST
1284 #define BRANCH_COST(speed_p, predictable_p) 1
1285 #endif
1287 /* If a memory-to-memory move would take MOVE_RATIO or more simple
1288 move-instruction sequences, we will do a movmem or libcall instead. */
1290 #ifndef MOVE_RATIO
1291 #if defined (HAVE_movmemqi) || defined (HAVE_movmemhi) || defined (HAVE_movmemsi) || defined (HAVE_movmemdi) || defined (HAVE_movmemti)
1292 #define MOVE_RATIO(speed) 2
1293 #else
1294 /* If we are optimizing for space (-Os), cut down the default move ratio. */
1295 #define MOVE_RATIO(speed) ((speed) ? 15 : 3)
1296 #endif
1297 #endif
1299 /* If a clear memory operation would take CLEAR_RATIO or more simple
1300 move-instruction sequences, we will do a setmem or libcall instead. */
1302 #ifndef CLEAR_RATIO
1303 #if defined (HAVE_setmemqi) || defined (HAVE_setmemhi) || defined (HAVE_setmemsi) || defined (HAVE_setmemdi) || defined (HAVE_setmemti)
1304 #define CLEAR_RATIO(speed) 2
1305 #else
1306 /* If we are optimizing for space, cut down the default clear ratio. */
1307 #define CLEAR_RATIO(speed) ((speed) ? 15 :3)
1308 #endif
1309 #endif
1311 /* If a memory set (to value other than zero) operation would take
1312 SET_RATIO or more simple move-instruction sequences, we will do a movmem
1313 or libcall instead. */
1314 #ifndef SET_RATIO
1315 #define SET_RATIO(speed) MOVE_RATIO(speed)
1316 #endif
1318 /* Supply a default definition for FUNCTION_ARG_PADDING:
1319 usually pad upward, but pad short args downward on
1320 big-endian machines. */
1322 #define DEFAULT_FUNCTION_ARG_PADDING(MODE, TYPE) \
1323 (! BYTES_BIG_ENDIAN \
1324 ? upward \
1325 : (((MODE) == BLKmode \
1326 ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \
1327 && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT)) \
1328 : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \
1329 ? downward : upward))
1331 #ifndef FUNCTION_ARG_PADDING
1332 #define FUNCTION_ARG_PADDING(MODE, TYPE) \
1333 DEFAULT_FUNCTION_ARG_PADDING ((MODE), (TYPE))
1334 #endif
1336 /* Supply a default definition for FUNCTION_ARG_BOUNDARY. Normally, we let
1337 FUNCTION_ARG_PADDING, which also pads the length, handle any needed
1338 alignment. */
1340 #ifndef FUNCTION_ARG_BOUNDARY
1341 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) PARM_BOUNDARY
1342 #endif
1344 /* Supply a default definition of STACK_SAVEAREA_MODE for emit_stack_save.
1345 Normally move_insn, so Pmode stack pointer. */
1347 #ifndef STACK_SAVEAREA_MODE
1348 #define STACK_SAVEAREA_MODE(LEVEL) Pmode
1349 #endif
1351 /* Supply a default definition of STACK_SIZE_MODE for
1352 allocate_dynamic_stack_space. Normally PLUS/MINUS, so word_mode. */
1354 #ifndef STACK_SIZE_MODE
1355 #define STACK_SIZE_MODE word_mode
1356 #endif
1358 /* Provide default values for the macros controlling stack checking. */
1360 /* The default is neither full builtin stack checking... */
1361 #ifndef STACK_CHECK_BUILTIN
1362 #define STACK_CHECK_BUILTIN 0
1363 #endif
1365 /* ...nor static builtin stack checking. */
1366 #ifndef STACK_CHECK_STATIC_BUILTIN
1367 #define STACK_CHECK_STATIC_BUILTIN 0
1368 #endif
1370 /* The default interval is one page (4096 bytes). */
1371 #ifndef STACK_CHECK_PROBE_INTERVAL_EXP
1372 #define STACK_CHECK_PROBE_INTERVAL_EXP 12
1373 #endif
1375 /* The default is not to move the stack pointer. */
1376 #ifndef STACK_CHECK_MOVING_SP
1377 #define STACK_CHECK_MOVING_SP 0
1378 #endif
1380 /* This is a kludge to try to capture the discrepancy between the old
1381 mechanism (generic stack checking) and the new mechanism (static
1382 builtin stack checking). STACK_CHECK_PROTECT needs to be bumped
1383 for the latter because part of the protection area is effectively
1384 included in STACK_CHECK_MAX_FRAME_SIZE for the former. */
1385 #ifdef STACK_CHECK_PROTECT
1386 #define STACK_OLD_CHECK_PROTECT STACK_CHECK_PROTECT
1387 #else
1388 #define STACK_OLD_CHECK_PROTECT \
1389 (USING_SJLJ_EXCEPTIONS ? 75 * UNITS_PER_WORD : 8 * 1024)
1390 #endif
1392 /* Minimum amount of stack required to recover from an anticipated stack
1393 overflow detection. The default value conveys an estimate of the amount
1394 of stack required to propagate an exception. */
1395 #ifndef STACK_CHECK_PROTECT
1396 #define STACK_CHECK_PROTECT \
1397 (USING_SJLJ_EXCEPTIONS ? 75 * UNITS_PER_WORD : 12 * 1024)
1398 #endif
1400 /* Make the maximum frame size be the largest we can and still only need
1401 one probe per function. */
1402 #ifndef STACK_CHECK_MAX_FRAME_SIZE
1403 #define STACK_CHECK_MAX_FRAME_SIZE \
1404 ((1 << STACK_CHECK_PROBE_INTERVAL_EXP) - UNITS_PER_WORD)
1405 #endif
1407 /* This is arbitrary, but should be large enough everywhere. */
1408 #ifndef STACK_CHECK_FIXED_FRAME_SIZE
1409 #define STACK_CHECK_FIXED_FRAME_SIZE (4 * UNITS_PER_WORD)
1410 #endif
1412 /* Provide a reasonable default for the maximum size of an object to
1413 allocate in the fixed frame. We may need to be able to make this
1414 controllable by the user at some point. */
1415 #ifndef STACK_CHECK_MAX_VAR_SIZE
1416 #define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100)
1417 #endif
1419 #ifndef SWITCHABLE_TARGET
1420 #define SWITCHABLE_TARGET 0
1421 #endif
1423 #endif /* GCC_INSN_FLAGS_H */
1425 #endif /* ! GCC_DEFAULTS_H */