2005-12-29 Paul Brook <paul@codesourcery.com>
[official-gcc.git] / gcc / defaults.h
blobeb7733d73cd2b96442227ac820088a2b9a1ccaaf
1 /* Definitions of various defaults for tm.h macros.
2 Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 2005
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 2, 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 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING. If not, write to the Free
21 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
22 02110-1301, USA. */
24 #ifndef GCC_DEFAULTS_H
25 #define GCC_DEFAULTS_H
27 #ifndef GET_ENVIRONMENT
28 #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0)
29 #endif
31 #define obstack_chunk_alloc ((void *(*) (long)) xmalloc)
32 #define obstack_chunk_free ((void (*) (void *)) free)
33 #define OBSTACK_CHUNK_SIZE 0
34 #define gcc_obstack_init(OBSTACK) \
35 _obstack_begin ((OBSTACK), OBSTACK_CHUNK_SIZE, 0, \
36 obstack_chunk_alloc, \
37 obstack_chunk_free)
39 /* Store in OUTPUT a string (made with alloca) containing an
40 assembler-name for a local static variable or function named NAME.
41 LABELNO is an integer which is different for each call. */
43 #ifndef ASM_PN_FORMAT
44 # ifndef NO_DOT_IN_LABEL
45 # define ASM_PN_FORMAT "%s.%lu"
46 # else
47 # ifndef NO_DOLLAR_IN_LABEL
48 # define ASM_PN_FORMAT "%s$%lu"
49 # else
50 # define ASM_PN_FORMAT "__%s_%lu"
51 # endif
52 # endif
53 #endif /* ! ASM_PN_FORMAT */
55 #ifndef ASM_FORMAT_PRIVATE_NAME
56 # define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
57 do { const char *const name_ = (NAME); \
58 char *const output_ = (OUTPUT) = \
59 (char *) alloca (strlen (name_) + 32); \
60 sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
61 } while (0)
62 #endif
64 /* Choose a reasonable default for ASM_OUTPUT_ASCII. */
66 #ifndef ASM_OUTPUT_ASCII
67 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
68 do { \
69 FILE *_hide_asm_out_file = (MYFILE); \
70 const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \
71 int _hide_thissize = (MYLENGTH); \
72 { \
73 FILE *asm_out_file = _hide_asm_out_file; \
74 const unsigned char *p = _hide_p; \
75 int thissize = _hide_thissize; \
76 int i; \
77 fprintf (asm_out_file, "\t.ascii \""); \
79 for (i = 0; i < thissize; i++) \
80 { \
81 int c = p[i]; \
82 if (c == '\"' || c == '\\') \
83 putc ('\\', asm_out_file); \
84 if (ISPRINT(c)) \
85 putc (c, asm_out_file); \
86 else \
87 { \
88 fprintf (asm_out_file, "\\%o", c); \
89 /* After an octal-escape, if a digit follows, \
90 terminate one string constant and start another. \
91 The VAX assembler fails to stop reading the escape \
92 after three digits, so this is the only way we \
93 can get it to parse the data properly. */ \
94 if (i < thissize - 1 && ISDIGIT(p[i + 1])) \
95 fprintf (asm_out_file, "\"\n\t.ascii \""); \
96 } \
97 } \
98 fprintf (asm_out_file, "\"\n"); \
99 } \
101 while (0)
102 #endif
104 /* This is how we tell the assembler to equate two values. */
105 #ifdef SET_ASM_OP
106 #ifndef ASM_OUTPUT_DEF
107 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
108 do { fprintf ((FILE), "%s", SET_ASM_OP); \
109 assemble_name (FILE, LABEL1); \
110 fprintf (FILE, ","); \
111 assemble_name (FILE, LABEL2); \
112 fprintf (FILE, "\n"); \
113 } while (0)
114 #endif
115 #endif
117 /* Decide whether to defer emitting the assembler output for an equate
118 of two values. The default is to not defer output. */
119 #ifndef TARGET_DEFERRED_OUTPUT_DEFS
120 #define TARGET_DEFERRED_OUTPUT_DEFS(DECL,TARGET) false
121 #endif
123 /* This is how to output the definition of a user-level label named
124 NAME, such as the label on a static function or variable NAME. */
126 #ifndef ASM_OUTPUT_LABEL
127 #define ASM_OUTPUT_LABEL(FILE,NAME) \
128 do { assemble_name ((FILE), (NAME)); fputs (":\n", (FILE)); } while (0)
129 #endif
131 /* Output the definition of a compiler-generated label named NAME. */
132 #ifndef ASM_OUTPUT_INTERNAL_LABEL
133 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \
134 do { \
135 assemble_name_raw ((FILE), (NAME)); \
136 fputs (":\n", (FILE)); \
137 } while (0)
138 #endif
140 /* This is how to output a reference to a user-level label named NAME. */
142 #ifndef ASM_OUTPUT_LABELREF
143 #define ASM_OUTPUT_LABELREF(FILE,NAME) asm_fprintf ((FILE), "%U%s", (NAME))
144 #endif
146 /* Allow target to print debug info labels specially. This is useful for
147 VLIW targets, since debug info labels should go into the middle of
148 instruction bundles instead of breaking them. */
150 #ifndef ASM_OUTPUT_DEBUG_LABEL
151 #define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
152 (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM)
153 #endif
155 /* This is how we tell the assembler that a symbol is weak. */
156 #ifndef ASM_OUTPUT_WEAK_ALIAS
157 #if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
158 #define ASM_OUTPUT_WEAK_ALIAS(STREAM, NAME, VALUE) \
159 do \
161 ASM_WEAKEN_LABEL (STREAM, NAME); \
162 if (VALUE) \
163 ASM_OUTPUT_DEF (STREAM, NAME, VALUE); \
165 while (0)
166 #endif
167 #endif
169 /* This is how we tell the assembler that a symbol is a weak alias to
170 another symbol that doesn't require the other symbol to be defined.
171 Uses of the former will turn into weak uses of the latter, i.e.,
172 uses that, in case the latter is undefined, will not cause errors,
173 and will add it to the symbol table as weak undefined. However, if
174 the latter is referenced directly, a strong reference prevails. */
175 #ifndef ASM_OUTPUT_WEAKREF
176 #if defined HAVE_GAS_WEAKREF
177 #define ASM_OUTPUT_WEAKREF(FILE, DECL, NAME, VALUE) \
178 do \
180 fprintf ((FILE), "\t.weakref\t"); \
181 assemble_name ((FILE), (NAME)); \
182 fprintf ((FILE), ","); \
183 assemble_name ((FILE), (VALUE)); \
184 fprintf ((FILE), "\n"); \
186 while (0)
187 #endif
188 #endif
190 /* How to emit a .type directive. */
191 #ifndef ASM_OUTPUT_TYPE_DIRECTIVE
192 #if defined TYPE_ASM_OP && defined TYPE_OPERAND_FMT
193 #define ASM_OUTPUT_TYPE_DIRECTIVE(STREAM, NAME, TYPE) \
194 do \
196 fputs (TYPE_ASM_OP, STREAM); \
197 assemble_name (STREAM, NAME); \
198 fputs (", ", STREAM); \
199 fprintf (STREAM, TYPE_OPERAND_FMT, TYPE); \
200 putc ('\n', STREAM); \
202 while (0)
203 #endif
204 #endif
206 /* How to emit a .size directive. */
207 #ifndef ASM_OUTPUT_SIZE_DIRECTIVE
208 #ifdef SIZE_ASM_OP
209 #define ASM_OUTPUT_SIZE_DIRECTIVE(STREAM, NAME, SIZE) \
210 do \
212 HOST_WIDE_INT size_ = (SIZE); \
213 fputs (SIZE_ASM_OP, STREAM); \
214 assemble_name (STREAM, NAME); \
215 fprintf (STREAM, ", " HOST_WIDE_INT_PRINT_DEC "\n", size_); \
217 while (0)
219 #define ASM_OUTPUT_MEASURED_SIZE(STREAM, NAME) \
220 do \
222 fputs (SIZE_ASM_OP, STREAM); \
223 assemble_name (STREAM, NAME); \
224 fputs (", .-", STREAM); \
225 assemble_name (STREAM, NAME); \
226 putc ('\n', STREAM); \
228 while (0)
230 #endif
231 #endif
233 /* This determines whether or not we support weak symbols. */
234 #ifndef SUPPORTS_WEAK
235 #if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
236 #define SUPPORTS_WEAK 1
237 #else
238 #define SUPPORTS_WEAK 0
239 #endif
240 #endif
242 /* This determines whether or not we support link-once semantics. */
243 #ifndef SUPPORTS_ONE_ONLY
244 #ifdef MAKE_DECL_ONE_ONLY
245 #define SUPPORTS_ONE_ONLY 1
246 #else
247 #define SUPPORTS_ONE_ONLY 0
248 #endif
249 #endif
251 /* This determines whether weak symbols must be left out of a static
252 archive's table of contents. Defining this macro to be nonzero has
253 the consequence that certain symbols will not be made weak that
254 otherwise would be. The C++ ABI requires this macro to be zero;
255 see the documentation. */
256 #ifndef TARGET_WEAK_NOT_IN_ARCHIVE_TOC
257 #define TARGET_WEAK_NOT_IN_ARCHIVE_TOC 0
258 #endif
260 /* This determines whether or not we need linkonce unwind information. */
261 #ifndef TARGET_USES_WEAK_UNWIND_INFO
262 #define TARGET_USES_WEAK_UNWIND_INFO 0
263 #endif
265 /* By default, there is no prefix on user-defined symbols. */
266 #ifndef USER_LABEL_PREFIX
267 #define USER_LABEL_PREFIX ""
268 #endif
270 /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
271 provide a weak attribute. Else define it to nothing.
273 This would normally belong in ansidecl.h, but SUPPORTS_WEAK is
274 not available at that time.
276 Note, this is only for use by target files which we know are to be
277 compiled by GCC. */
278 #ifndef TARGET_ATTRIBUTE_WEAK
279 # if SUPPORTS_WEAK
280 # define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak))
281 # else
282 # define TARGET_ATTRIBUTE_WEAK
283 # endif
284 #endif
286 /* Determines whether we may use common symbols to represent one-only
287 semantics (a.k.a. "vague linkage"). */
288 #ifndef USE_COMMON_FOR_ONE_ONLY
289 # define USE_COMMON_FOR_ONE_ONLY 1
290 #endif
292 /* By default we can assume that all global symbols are in one namespace,
293 across all shared libraries. */
294 #ifndef MULTIPLE_SYMBOL_SPACES
295 # define MULTIPLE_SYMBOL_SPACES 0
296 #endif
298 /* If the target supports init_priority C++ attribute, give
299 SUPPORTS_INIT_PRIORITY a nonzero value. */
300 #ifndef SUPPORTS_INIT_PRIORITY
301 #define SUPPORTS_INIT_PRIORITY 1
302 #endif /* SUPPORTS_INIT_PRIORITY */
304 /* If duplicate library search directories can be removed from a
305 linker command without changing the linker's semantics, give this
306 symbol a nonzero. */
307 #ifndef LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
308 #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 0
309 #endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */
311 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
312 the rest of the DWARF 2 frame unwind support is also provided. */
313 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX)
314 #define DWARF2_UNWIND_INFO 1
315 #endif
317 /* If we have named sections, and we're using crtstuff to run ctors,
318 use them for registering eh frame information. */
319 #if defined (TARGET_ASM_NAMED_SECTION) && DWARF2_UNWIND_INFO \
320 && !defined(EH_FRAME_IN_DATA_SECTION)
321 #ifndef EH_FRAME_SECTION_NAME
322 #define EH_FRAME_SECTION_NAME ".eh_frame"
323 #endif
324 #endif
326 /* On many systems, different EH table encodings are used under
327 difference circumstances. Some will require runtime relocations;
328 some will not. For those that do not require runtime relocations,
329 we would like to make the table read-only. However, since the
330 read-only tables may need to be combined with read-write tables
331 that do require runtime relocation, it is not safe to make the
332 tables read-only unless the linker will merge read-only and
333 read-write sections into a single read-write section. If your
334 linker does not have this ability, but your system is such that no
335 encoding used with non-PIC code will ever require a runtime
336 relocation, then you can define EH_TABLES_CAN_BE_READ_ONLY to 1 in
337 your target configuration file. */
338 #ifndef EH_TABLES_CAN_BE_READ_ONLY
339 #ifdef HAVE_LD_RO_RW_SECTION_MIXING
340 #define EH_TABLES_CAN_BE_READ_ONLY 1
341 #else
342 #define EH_TABLES_CAN_BE_READ_ONLY 0
343 #endif
344 #endif
346 /* If we have named section and we support weak symbols, then use the
347 .jcr section for recording java classes which need to be registered
348 at program start-up time. */
349 #if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
350 #ifndef JCR_SECTION_NAME
351 #define JCR_SECTION_NAME ".jcr"
352 #endif
353 #endif
355 /* This decision to use a .jcr section can be overridden by defining
356 USE_JCR_SECTION to 0 in target file. This is necessary if target
357 can define JCR_SECTION_NAME but does not have crtstuff or
358 linker support for .jcr section. */
359 #ifndef TARGET_USE_JCR_SECTION
360 #ifdef JCR_SECTION_NAME
361 #define TARGET_USE_JCR_SECTION 1
362 #else
363 #define TARGET_USE_JCR_SECTION 0
364 #endif
365 #endif
367 /* Number of hardware registers that go into the DWARF-2 unwind info.
368 If not defined, equals FIRST_PSEUDO_REGISTER */
370 #ifndef DWARF_FRAME_REGISTERS
371 #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
372 #endif
374 /* How to renumber registers for dbx and gdb. If not defined, assume
375 no renumbering is necessary. */
377 #ifndef DBX_REGISTER_NUMBER
378 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
379 #endif
381 /* Default sizes for base C types. If the sizes are different for
382 your target, you should override these values by defining the
383 appropriate symbols in your tm.h file. */
385 #ifndef BITS_PER_UNIT
386 #define BITS_PER_UNIT 8
387 #endif
389 #ifndef BITS_PER_WORD
390 #define BITS_PER_WORD (BITS_PER_UNIT * UNITS_PER_WORD)
391 #endif
393 #ifndef CHAR_TYPE_SIZE
394 #define CHAR_TYPE_SIZE BITS_PER_UNIT
395 #endif
397 #ifndef BOOL_TYPE_SIZE
398 /* `bool' has size and alignment `1', on almost all platforms. */
399 #define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
400 #endif
402 #ifndef SHORT_TYPE_SIZE
403 #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
404 #endif
406 #ifndef INT_TYPE_SIZE
407 #define INT_TYPE_SIZE BITS_PER_WORD
408 #endif
410 #ifndef LONG_TYPE_SIZE
411 #define LONG_TYPE_SIZE BITS_PER_WORD
412 #endif
414 #ifndef LONG_LONG_TYPE_SIZE
415 #define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
416 #endif
418 #ifndef WCHAR_TYPE_SIZE
419 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
420 #endif
422 #ifndef FLOAT_TYPE_SIZE
423 #define FLOAT_TYPE_SIZE BITS_PER_WORD
424 #endif
426 #ifndef DOUBLE_TYPE_SIZE
427 #define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
428 #endif
430 #ifndef LONG_DOUBLE_TYPE_SIZE
431 #define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
432 #endif
434 #ifndef DECIMAL32_TYPE_SIZE
435 #define DECIMAL32_TYPE_SIZE 32
436 #endif
438 #ifndef DECIMAL64_TYPE_SIZE
439 #define DECIMAL64_TYPE_SIZE 64
440 #endif
442 #ifndef DECIMAL128_TYPE_SIZE
443 #define DECIMAL128_TYPE_SIZE 128
444 #endif
446 /* Width in bits of a pointer. Mind the value of the macro `Pmode'. */
447 #ifndef POINTER_SIZE
448 #define POINTER_SIZE BITS_PER_WORD
449 #endif
451 #ifndef PIC_OFFSET_TABLE_REGNUM
452 #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
453 #endif
455 #ifndef TARGET_DLLIMPORT_DECL_ATTRIBUTES
456 #define TARGET_DLLIMPORT_DECL_ATTRIBUTES 0
457 #endif
459 #ifndef TARGET_DECLSPEC
460 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
461 /* If the target supports the "dllimport" attribute, users are
462 probably used to the "__declspec" syntax. */
463 #define TARGET_DECLSPEC 1
464 #else
465 #define TARGET_DECLSPEC 0
466 #endif
467 #endif
469 /* By default, the preprocessor should be invoked the same way in C++
470 as in C. */
471 #ifndef CPLUSPLUS_CPP_SPEC
472 #ifdef CPP_SPEC
473 #define CPLUSPLUS_CPP_SPEC CPP_SPEC
474 #endif
475 #endif
477 #ifndef ACCUMULATE_OUTGOING_ARGS
478 #define ACCUMULATE_OUTGOING_ARGS 0
479 #endif
481 /* Supply a default definition for PUSH_ARGS. */
482 #ifndef PUSH_ARGS
483 #ifdef PUSH_ROUNDING
484 #define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS
485 #else
486 #define PUSH_ARGS 0
487 #endif
488 #endif
490 /* Decide whether a function's arguments should be processed
491 from first to last or from last to first.
493 They should if the stack and args grow in opposite directions, but
494 only if we have push insns. */
496 #ifdef PUSH_ROUNDING
498 #ifndef PUSH_ARGS_REVERSED
499 #if defined (STACK_GROWS_DOWNWARD) != defined (ARGS_GROW_DOWNWARD)
500 #define PUSH_ARGS_REVERSED PUSH_ARGS
501 #endif
502 #endif
504 #endif
506 #ifndef PUSH_ARGS_REVERSED
507 #define PUSH_ARGS_REVERSED 0
508 #endif
510 /* If PREFERRED_STACK_BOUNDARY is not defined, set it to STACK_BOUNDARY.
511 STACK_BOUNDARY is required. */
512 #ifndef PREFERRED_STACK_BOUNDARY
513 #define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
514 #endif
516 #ifndef TARGET_DEFAULT_PACK_STRUCT
517 #define TARGET_DEFAULT_PACK_STRUCT 0
518 #endif
520 /* By default, the C++ compiler will use function addresses in the
521 vtable entries. Setting this nonzero tells the compiler to use
522 function descriptors instead. The value of this macro says how
523 many words wide the descriptor is (normally 2). It is assumed
524 that the address of a function descriptor may be treated as a
525 pointer to a function. */
526 #ifndef TARGET_VTABLE_USES_DESCRIPTORS
527 #define TARGET_VTABLE_USES_DESCRIPTORS 0
528 #endif
530 /* By default, the vtable entries are void pointers, the so the alignment
531 is the same as pointer alignment. The value of this macro specifies
532 the alignment of the vtable entry in bits. It should be defined only
533 when special alignment is necessary. */
534 #ifndef TARGET_VTABLE_ENTRY_ALIGN
535 #define TARGET_VTABLE_ENTRY_ALIGN POINTER_SIZE
536 #endif
538 /* There are a few non-descriptor entries in the vtable at offsets below
539 zero. If these entries must be padded (say, to preserve the alignment
540 specified by TARGET_VTABLE_ENTRY_ALIGN), set this to the number of
541 words in each data entry. */
542 #ifndef TARGET_VTABLE_DATA_ENTRY_DISTANCE
543 #define TARGET_VTABLE_DATA_ENTRY_DISTANCE 1
544 #endif
546 /* Decide whether it is safe to use a local alias for a virtual function
547 when constructing thunks. */
548 #ifndef TARGET_USE_LOCAL_THUNK_ALIAS_P
549 #ifdef ASM_OUTPUT_DEF
550 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 1
551 #else
552 #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) 0
553 #endif
554 #endif
556 /* Select a format to encode pointers in exception handling data. We
557 prefer those that result in fewer dynamic relocations. Assume no
558 special support here and encode direct references. */
559 #ifndef ASM_PREFERRED_EH_DATA_FORMAT
560 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) DW_EH_PE_absptr
561 #endif
563 /* By default, the C++ compiler will use the lowest bit of the pointer
564 to function to indicate a pointer-to-member-function points to a
565 virtual member function. However, if FUNCTION_BOUNDARY indicates
566 function addresses aren't always even, the lowest bit of the delta
567 field will be used. */
568 #ifndef TARGET_PTRMEMFUNC_VBIT_LOCATION
569 #define TARGET_PTRMEMFUNC_VBIT_LOCATION \
570 (FUNCTION_BOUNDARY >= 2 * BITS_PER_UNIT \
571 ? ptrmemfunc_vbit_in_pfn : ptrmemfunc_vbit_in_delta)
572 #endif
574 #ifndef DEFAULT_GDB_EXTENSIONS
575 #define DEFAULT_GDB_EXTENSIONS 1
576 #endif
578 /* If more than one debugging type is supported, you must define
579 PREFERRED_DEBUGGING_TYPE to choose the default. */
581 #if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) \
582 + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \
583 + defined (VMS_DEBUGGING_INFO))
584 #ifndef PREFERRED_DEBUGGING_TYPE
585 #error You must define PREFERRED_DEBUGGING_TYPE
586 #endif /* no PREFERRED_DEBUGGING_TYPE */
588 /* If only one debugging format is supported, define PREFERRED_DEBUGGING_TYPE
589 here so other code needn't care. */
590 #elif defined DBX_DEBUGGING_INFO
591 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
593 #elif defined SDB_DEBUGGING_INFO
594 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
596 #elif defined DWARF2_DEBUGGING_INFO
597 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
599 #elif defined VMS_DEBUGGING_INFO
600 #define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
602 #elif defined XCOFF_DEBUGGING_INFO
603 #define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
605 #else
606 /* No debugging format is supported by this target. */
607 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
608 #endif
610 /* Define codes for all the float formats that we know of. */
611 #define UNKNOWN_FLOAT_FORMAT 0
612 #define IEEE_FLOAT_FORMAT 1
613 #define VAX_FLOAT_FORMAT 2
614 #define IBM_FLOAT_FORMAT 3
615 #define C4X_FLOAT_FORMAT 4
617 /* Default to IEEE float if not specified. Nearly all machines use it. */
618 #ifndef TARGET_FLOAT_FORMAT
619 #define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
620 #endif
622 /* Some macros can be defined by the backend in either a mode-dependent
623 or mode-independent form. The compiler proper should only use the
624 mode-dependent form, providing VOIDmode when the mode is unknown.
625 We can't poison the macros because the backend may reference them. */
627 #ifndef REGNO_MODE_OK_FOR_BASE_P
628 #define REGNO_MODE_OK_FOR_BASE_P(REGNO, MODE) REGNO_OK_FOR_BASE_P (REGNO)
629 #endif
631 #ifndef REG_MODE_OK_FOR_BASE_P
632 #define REG_MODE_OK_FOR_BASE_P(REG, MODE) REG_OK_FOR_BASE_P (REG)
633 #endif
635 /* Determine the register class for registers suitable to be the base
636 address register in a MEM. Allow the choice to be dependent upon
637 the mode of the memory access. */
638 #ifndef MODE_BASE_REG_CLASS
639 #define MODE_BASE_REG_CLASS(MODE) BASE_REG_CLASS
640 #endif
642 /* Some machines require a different base register class if the index
643 is a register. By default, assume that a base register is acceptable. */
644 #ifndef MODE_BASE_REG_REG_CLASS
645 #define MODE_BASE_REG_REG_CLASS(MODE) MODE_BASE_REG_CLASS(MODE)
646 #endif
648 #ifndef REGNO_MODE_OK_FOR_REG_BASE_P
649 #define REGNO_MODE_OK_FOR_REG_BASE_P(REGNO, MODE) REGNO_MODE_OK_FOR_BASE_P (REGNO, MODE)
650 #endif
652 #ifndef REG_MODE_OK_FOR_REG_BASE_P
653 #define REG_MODE_OK_FOR_REG_BASE_P(REGNO, MODE) REG_MODE_OK_FOR_BASE_P (REGNO, MODE)
654 #endif
656 #ifndef LARGEST_EXPONENT_IS_NORMAL
657 #define LARGEST_EXPONENT_IS_NORMAL(SIZE) 0
658 #endif
660 #ifndef ROUND_TOWARDS_ZERO
661 #define ROUND_TOWARDS_ZERO 0
662 #endif
664 #ifndef MODE_HAS_NANS
665 #define MODE_HAS_NANS(MODE) \
666 (FLOAT_MODE_P (MODE) \
667 && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT \
668 && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
669 #endif
671 #ifndef MODE_HAS_INFINITIES
672 #define MODE_HAS_INFINITIES(MODE) \
673 (FLOAT_MODE_P (MODE) \
674 && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT \
675 && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
676 #endif
678 #ifndef MODE_HAS_SIGNED_ZEROS
679 #define MODE_HAS_SIGNED_ZEROS(MODE) \
680 (FLOAT_MODE_P (MODE) && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT)
681 #endif
683 #ifndef MODE_HAS_SIGN_DEPENDENT_ROUNDING
684 #define MODE_HAS_SIGN_DEPENDENT_ROUNDING(MODE) \
685 (FLOAT_MODE_P (MODE) \
686 && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT \
687 && !ROUND_TOWARDS_ZERO)
688 #endif
690 #ifndef FLOAT_LIB_COMPARE_RETURNS_BOOL
691 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) false
692 #endif
694 /* True if the targets integer-comparison functions return { 0, 1, 2
695 } to indicate { <, ==, > }. False if { -1, 0, 1 } is used
696 instead. The libgcc routines are biased. */
697 #ifndef TARGET_LIB_INT_CMP_BIASED
698 #define TARGET_LIB_INT_CMP_BIASED (true)
699 #endif
701 /* If FLOAT_WORDS_BIG_ENDIAN is not defined in the header files,
702 then the word-endianness is the same as for integers. */
703 #ifndef FLOAT_WORDS_BIG_ENDIAN
704 #define FLOAT_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
705 #endif
707 #ifndef TARGET_FLT_EVAL_METHOD
708 #define TARGET_FLT_EVAL_METHOD 0
709 #endif
711 #ifndef TARGET_DEC_EVAL_METHOD
712 #define TARGET_DEC_EVAL_METHOD 2
713 #endif
715 #ifndef HOT_TEXT_SECTION_NAME
716 #define HOT_TEXT_SECTION_NAME ".text.hot"
717 #endif
719 #ifndef UNLIKELY_EXECUTED_TEXT_SECTION_NAME
720 #define UNLIKELY_EXECUTED_TEXT_SECTION_NAME ".text.unlikely"
721 #endif
723 #ifndef HAS_LONG_COND_BRANCH
724 #define HAS_LONG_COND_BRANCH 0
725 #endif
727 #ifndef HAS_LONG_UNCOND_BRANCH
728 #define HAS_LONG_UNCOND_BRANCH 0
729 #endif
731 /* By default, only attempt to parallelize bitwise operations, and
732 possibly adds/subtracts using bit-twiddling. */
733 #ifndef UNITS_PER_SIMD_WORD
734 #define UNITS_PER_SIMD_WORD UNITS_PER_WORD
735 #endif
737 /* Determine whether __cxa_atexit, rather than atexit, is used to
738 register C++ destructors for local statics and global objects. */
739 #ifndef DEFAULT_USE_CXA_ATEXIT
740 #define DEFAULT_USE_CXA_ATEXIT 0
741 #endif
743 /* Determine whether extra constraint letter should be handled
744 via address reload (like 'o'). */
745 #ifndef EXTRA_MEMORY_CONSTRAINT
746 #define EXTRA_MEMORY_CONSTRAINT(C,STR) 0
747 #endif
749 /* Determine whether extra constraint letter should be handled
750 as an address (like 'p'). */
751 #ifndef EXTRA_ADDRESS_CONSTRAINT
752 #define EXTRA_ADDRESS_CONSTRAINT(C,STR) 0
753 #endif
755 /* When a port defines CONSTRAINT_LEN, it should use DEFAULT_CONSTRAINT_LEN
756 for all the characters that it does not want to change, so things like the
757 'length' of a digit in a matching constraint is an implementation detail,
758 and not part of the interface. */
759 #define DEFAULT_CONSTRAINT_LEN(C,STR) 1
761 #ifndef CONSTRAINT_LEN
762 #define CONSTRAINT_LEN(C,STR) DEFAULT_CONSTRAINT_LEN (C, STR)
763 #endif
765 #if defined (CONST_OK_FOR_LETTER_P) && ! defined (CONST_OK_FOR_CONSTRAINT_P)
766 #define CONST_OK_FOR_CONSTRAINT_P(VAL,C,STR) CONST_OK_FOR_LETTER_P (VAL, C)
767 #endif
769 #if defined (CONST_DOUBLE_OK_FOR_LETTER_P) && ! defined (CONST_DOUBLE_OK_FOR_CONSTRAINT_P)
770 #define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(OP,C,STR) \
771 CONST_DOUBLE_OK_FOR_LETTER_P (OP, C)
772 #endif
774 #ifndef REG_CLASS_FROM_CONSTRAINT
775 #define REG_CLASS_FROM_CONSTRAINT(C,STR) REG_CLASS_FROM_LETTER (C)
776 #endif
778 #if defined (EXTRA_CONSTRAINT) && ! defined (EXTRA_CONSTRAINT_STR)
779 #define EXTRA_CONSTRAINT_STR(OP, C,STR) EXTRA_CONSTRAINT (OP, C)
780 #endif
782 #ifndef REGISTER_MOVE_COST
783 #define REGISTER_MOVE_COST(m, x, y) 2
784 #endif
786 /* Determine whether the entire c99 runtime
787 is present in the runtime library. */
788 #ifndef TARGET_C99_FUNCTIONS
789 #define TARGET_C99_FUNCTIONS 0
790 #endif
792 /* Indicate that CLZ and CTZ are undefined at zero. */
793 #ifndef CLZ_DEFINED_VALUE_AT_ZERO
794 #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0
795 #endif
796 #ifndef CTZ_DEFINED_VALUE_AT_ZERO
797 #define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) 0
798 #endif
800 /* Provide a default value for STORE_FLAG_VALUE. */
801 #ifndef STORE_FLAG_VALUE
802 #define STORE_FLAG_VALUE 1
803 #endif
805 /* This macro is used to determine what the largest unit size that
806 move_by_pieces can use is. */
808 /* MOVE_MAX_PIECES is the number of bytes at a time which we can
809 move efficiently, as opposed to MOVE_MAX which is the maximum
810 number of bytes we can move with a single instruction. */
812 #ifndef MOVE_MAX_PIECES
813 #define MOVE_MAX_PIECES MOVE_MAX
814 #endif
816 #ifndef STACK_POINTER_OFFSET
817 #define STACK_POINTER_OFFSET 0
818 #endif
820 #ifndef LOCAL_REGNO
821 #define LOCAL_REGNO(REGNO) 0
822 #endif
824 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
825 the stack pointer does not matter. The value is tested only in
826 functions that have frame pointers. */
827 #ifndef EXIT_IGNORE_STACK
828 #define EXIT_IGNORE_STACK 0
829 #endif
831 /* Assume that case vectors are not pc-relative. */
832 #ifndef CASE_VECTOR_PC_RELATIVE
833 #define CASE_VECTOR_PC_RELATIVE 0
834 #endif
836 /* Assume that trampolines need function alignment. */
837 #ifndef TRAMPOLINE_ALIGNMENT
838 #define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY
839 #endif
841 /* Register mappings for target machines without register windows. */
842 #ifndef INCOMING_REGNO
843 #define INCOMING_REGNO(N) (N)
844 #endif
846 #ifndef OUTGOING_REGNO
847 #define OUTGOING_REGNO(N) (N)
848 #endif
850 #ifndef SHIFT_COUNT_TRUNCATED
851 #define SHIFT_COUNT_TRUNCATED 0
852 #endif
854 #ifndef LEGITIMIZE_ADDRESS
855 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
856 #endif
858 #ifndef LEGITIMATE_PIC_OPERAND_P
859 #define LEGITIMATE_PIC_OPERAND_P(X) 1
860 #endif
862 #ifndef REVERSIBLE_CC_MODE
863 #define REVERSIBLE_CC_MODE(MODE) 0
864 #endif
866 /* Biggest alignment supported by the object file format of this machine. */
867 #ifndef MAX_OFILE_ALIGNMENT
868 #define MAX_OFILE_ALIGNMENT BIGGEST_ALIGNMENT
869 #endif
871 #ifndef FRAME_GROWS_DOWNWARD
872 #define FRAME_GROWS_DOWNWARD 0
873 #endif
875 /* On most machines, the CFA coincides with the first incoming parm. */
876 #ifndef ARG_POINTER_CFA_OFFSET
877 #define ARG_POINTER_CFA_OFFSET(FNDECL) FIRST_PARM_OFFSET (FNDECL)
878 #endif
880 /* The offset from the incoming value of %sp to the top of the stack frame
881 for the current function. */
882 #ifndef INCOMING_FRAME_SP_OFFSET
883 #define INCOMING_FRAME_SP_OFFSET 0
884 #endif
886 #endif /* ! GCC_DEFAULTS_H */