OSDN Git Service

* config/rs6000/rs6000.md: Remove ppc630 fpcompare from single
[pf3gnuchains/gcc-fork.git] / gcc / defaults.h
1 /* Definitions of various defaults for tm.h macros.
2    Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000, 2001, 2002
3    Free Software Foundation, Inc.
4    Contributed by Ron Guilmette (rfg@monkeys.com)
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
11 version.
12
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 for more details.
17
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 the Free
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
21 02111-1307, USA.  */
22
23 #ifndef GCC_DEFAULTS_H
24 #define GCC_DEFAULTS_H
25
26 /* Define default standard character escape sequences.  */
27 #ifndef TARGET_BELL
28 #  define TARGET_BELL 007
29 #  define TARGET_BS 010
30 #  define TARGET_TAB 011
31 #  define TARGET_NEWLINE 012
32 #  define TARGET_VT 013
33 #  define TARGET_FF 014
34 #  define TARGET_CR 015
35 #  define TARGET_ESC 033
36 #endif
37
38 /* When removal of CPP_PREDEFINES is complete, TARGET_CPU_CPP_BULITINS
39    can also be removed from here.  */
40 #ifndef TARGET_OS_CPP_BUILTINS
41 # define TARGET_OS_CPP_BUILTINS()
42 #endif
43 #ifndef TARGET_CPU_CPP_BUILTINS
44 # define TARGET_CPU_CPP_BUILTINS()
45 #endif
46 #ifndef CPP_PREDEFINES
47 # define CPP_PREDEFINES ""
48 #endif
49
50 /* Store in OUTPUT a string (made with alloca) containing
51    an assembler-name for a local static variable or function named NAME.
52    LABELNO is an integer which is different for each call.  */
53
54 #ifndef ASM_FORMAT_PRIVATE_NAME
55 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)                  \
56   do {                                                                  \
57     int len = strlen (NAME);                                            \
58     char *temp = (char *) alloca (len + 3);                             \
59     temp[0] = 'L';                                                      \
60     strcpy (&temp[1], (NAME));                                          \
61     temp[len + 1] = '.';                                                \
62     temp[len + 2] = 0;                                                  \
63     (OUTPUT) = (char *) alloca (strlen (NAME) + 11);                    \
64     ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO);                \
65   } while (0)
66 #endif
67
68 #ifndef ASM_STABD_OP
69 #define ASM_STABD_OP "\t.stabd\t"
70 #endif
71
72 /* This is how to output an element of a case-vector that is absolute.
73    Some targets don't use this, but we have to define it anyway.  */
74
75 #ifndef ASM_OUTPUT_ADDR_VEC_ELT
76 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
77 do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \
78      ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", (VALUE));                    \
79      fputc ('\n', FILE);                                                \
80    } while (0)
81 #endif
82
83 /* choose a reasonable default for ASM_OUTPUT_ASCII.  */
84
85 #ifndef ASM_OUTPUT_ASCII
86 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
87   do {                                                                        \
88     FILE *_hide_asm_out_file = (MYFILE);                                      \
89     const unsigned char *_hide_p = (const unsigned char *) (MYSTRING);        \
90     int _hide_thissize = (MYLENGTH);                                          \
91     {                                                                         \
92       FILE *asm_out_file = _hide_asm_out_file;                                \
93       const unsigned char *p = _hide_p;                                       \
94       int thissize = _hide_thissize;                                          \
95       int i;                                                                  \
96       fprintf (asm_out_file, "\t.ascii \"");                                  \
97                                                                               \
98       for (i = 0; i < thissize; i++)                                          \
99         {                                                                     \
100           int c = p[i];                                                       \
101           if (c == '\"' || c == '\\')                                         \
102             putc ('\\', asm_out_file);                                        \
103           if (ISPRINT(c))                                                     \
104             putc (c, asm_out_file);                                           \
105           else                                                                \
106             {                                                                 \
107               fprintf (asm_out_file, "\\%o", c);                              \
108               /* After an octal-escape, if a digit follows,                   \
109                  terminate one string constant and start another.             \
110                  The VAX assembler fails to stop reading the escape           \
111                  after three digits, so this is the only way we               \
112                  can get it to parse the data properly.  */                   \
113               if (i < thissize - 1 && ISDIGIT(p[i + 1]))                      \
114                 fprintf (asm_out_file, "\"\n\t.ascii \"");                    \
115           }                                                                   \
116         }                                                                     \
117       fprintf (asm_out_file, "\"\n");                                         \
118     }                                                                         \
119   }                                                                           \
120   while (0)
121 #endif
122
123 /* This is how we tell the assembler to equate two values.  */
124 #ifdef SET_ASM_OP
125 #ifndef ASM_OUTPUT_DEF
126 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2)                              \
127  do {   fprintf ((FILE), "%s", SET_ASM_OP);                             \
128         assemble_name (FILE, LABEL1);                                   \
129         fprintf (FILE, ",");                                            \
130         assemble_name (FILE, LABEL2);                                   \
131         fprintf (FILE, "\n");                                           \
132   } while (0)
133 #endif
134 #endif
135
136 /* This is how to output a reference to a user-level label named NAME.  */
137
138 #ifndef ASM_OUTPUT_LABELREF
139 #define ASM_OUTPUT_LABELREF(FILE,NAME)  asm_fprintf ((FILE), "%U%s", (NAME))
140 #endif
141
142 /* Allow target to print debug info labels specially.  This is useful for
143    VLIW targets, since debug info labels should go into the middle of
144    instruction bundles instead of breaking them.  */
145
146 #ifndef ASM_OUTPUT_DEBUG_LABEL
147 #define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
148   ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM)
149 #endif
150
151 /* This is how we tell the assembler that a symbol is weak.  */
152 #ifndef ASM_OUTPUT_WEAK_ALIAS
153 #if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
154 #define ASM_OUTPUT_WEAK_ALIAS(STREAM, NAME, VALUE)      \
155   do                                                    \
156     {                                                   \
157       ASM_WEAKEN_LABEL (STREAM, NAME);                  \
158       if (VALUE)                                        \
159         ASM_OUTPUT_DEF (STREAM, NAME, VALUE);           \
160     }                                                   \
161   while (0)
162 #endif
163 #endif
164
165 /* This determines whether or not we support weak symbols.  */
166 #ifndef SUPPORTS_WEAK
167 #if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
168 #define SUPPORTS_WEAK 1
169 #else
170 #define SUPPORTS_WEAK 0
171 #endif
172 #endif
173
174 /* This determines whether or not we support link-once semantics.  */
175 #ifndef SUPPORTS_ONE_ONLY
176 #ifdef MAKE_DECL_ONE_ONLY
177 #define SUPPORTS_ONE_ONLY 1
178 #else
179 #define SUPPORTS_ONE_ONLY 0
180 #endif
181 #endif
182
183 /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
184    provide a weak attribute.  Else define it to nothing. 
185
186    This would normally belong in ansidecl.h, but SUPPORTS_WEAK is
187    not available at that time.
188
189    Note, this is only for use by target files which we know are to be
190    compiled by GCC.  */
191 #ifndef TARGET_ATTRIBUTE_WEAK
192 # if SUPPORTS_WEAK
193 #  define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak))
194 # else
195 #  define TARGET_ATTRIBUTE_WEAK
196 # endif
197 #endif
198
199 /* If the target supports init_priority C++ attribute, give
200    SUPPORTS_INIT_PRIORITY a nonzero value.  */
201 #ifndef SUPPORTS_INIT_PRIORITY
202 #define SUPPORTS_INIT_PRIORITY 1
203 #endif /* SUPPORTS_INIT_PRIORITY */
204
205 /* If duplicate library search directories can be removed from a
206    linker command without changing the linker's semantics, give this
207    symbol a nonzero.  */
208 #ifndef LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
209 #define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 0
210 #endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */
211
212 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
213    the rest of the DWARF 2 frame unwind support is also provided.  */
214 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX)
215 #define DWARF2_UNWIND_INFO 1
216 #endif
217
218 /* If we have named sections, and we're using crtstuff to run ctors,
219    use them for registering eh frame information.  */
220 #if defined (TARGET_ASM_NAMED_SECTION) && DWARF2_UNWIND_INFO \
221     && !defined(EH_FRAME_IN_DATA_SECTION)
222 #ifndef EH_FRAME_SECTION_NAME
223 #define EH_FRAME_SECTION_NAME ".eh_frame"
224 #endif
225 #endif
226
227 /* If we have named section and we support weak symbols, then use the
228    .jcr section for recording java classes which need to be registered
229    at program start-up time.  */
230 #if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
231 #ifndef JCR_SECTION_NAME
232 #define JCR_SECTION_NAME ".jcr"
233 #endif
234 #endif
235
236 /* By default, we generate a label at the beginning and end of the
237    text section, and compute the size of the text section by
238    subtracting the two.  However, on some platforms that doesn't 
239    work, and we use the section itself, rather than a label at the
240    beginning of it, to indicate the start of the section.  On such
241    platforms, define this to zero.  */
242 #ifndef DWARF2_GENERATE_TEXT_SECTION_LABEL
243 #define DWARF2_GENERATE_TEXT_SECTION_LABEL 1
244 #endif
245
246 /* Supply a default definition for PROMOTE_PROTOTYPES.  */
247 #ifndef PROMOTE_PROTOTYPES
248 #define PROMOTE_PROTOTYPES      0
249 #endif
250
251 /* Number of hardware registers that go into the DWARF-2 unwind info.
252    If not defined, equals FIRST_PSEUDO_REGISTER  */
253
254 #ifndef DWARF_FRAME_REGISTERS
255 #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
256 #endif
257
258 /* How to renumber registers for dbx and gdb.  If not defined, assume
259    no renumbering is necessary.  */
260
261 #ifndef DBX_REGISTER_NUMBER
262 #define DBX_REGISTER_NUMBER(REGNO) (REGNO)
263 #endif
264
265 /* Default sizes for base C types.  If the sizes are different for
266    your target, you should override these values by defining the
267    appropriate symbols in your tm.h file.  */
268
269 #ifndef BITS_PER_UNIT
270 #define BITS_PER_UNIT 8
271 #endif
272
273 #ifndef BITS_PER_WORD
274 #define BITS_PER_WORD (BITS_PER_UNIT * UNITS_PER_WORD)
275 #endif
276
277 #ifndef CHAR_TYPE_SIZE
278 #define CHAR_TYPE_SIZE BITS_PER_UNIT
279 #endif
280
281 #ifndef BOOL_TYPE_SIZE
282 /* `bool' has size and alignment `1', on almost all platforms.  */
283 #define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
284 #endif
285
286 #ifndef SHORT_TYPE_SIZE
287 #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
288 #endif
289
290 #ifndef INT_TYPE_SIZE
291 #define INT_TYPE_SIZE BITS_PER_WORD
292 #endif
293
294 #ifndef LONG_TYPE_SIZE
295 #define LONG_TYPE_SIZE BITS_PER_WORD
296 #endif
297
298 #ifndef LONG_LONG_TYPE_SIZE
299 #define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
300 #endif
301
302 #ifndef WCHAR_TYPE_SIZE
303 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
304 #endif
305
306 #ifndef FLOAT_TYPE_SIZE
307 #define FLOAT_TYPE_SIZE BITS_PER_WORD
308 #endif
309
310 #ifndef DOUBLE_TYPE_SIZE
311 #define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
312 #endif
313
314 #ifndef LONG_DOUBLE_TYPE_SIZE
315 #define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
316 #endif
317
318 /* Width in bits of a pointer.  Mind the value of the macro `Pmode'.  */
319 #ifndef POINTER_SIZE
320 #define POINTER_SIZE BITS_PER_WORD
321 #endif
322
323 #ifndef BUILD_VA_LIST_TYPE
324 #define BUILD_VA_LIST_TYPE(X) ((X) = ptr_type_node)
325 #endif
326
327 #ifndef PIC_OFFSET_TABLE_REGNUM
328 #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
329 #endif
330
331 /* Type used by GCOV counters.  Use 64bit data type if target supports
332    it.  */
333 #if LONG_TYPE_SIZE >= 64
334 #define GCOV_TYPE_SIZE LONG_TYPE_SIZE
335 #else
336 #define GCOV_TYPE_SIZE LONG_LONG_TYPE_SIZE
337 #endif
338
339
340 /* By default, the preprocessor should be invoked the same way in C++
341    as in C.  */
342 #ifndef CPLUSPLUS_CPP_SPEC
343 #ifdef CPP_SPEC
344 #define CPLUSPLUS_CPP_SPEC CPP_SPEC
345 #endif
346 #endif
347
348 #ifndef ACCUMULATE_OUTGOING_ARGS
349 #define ACCUMULATE_OUTGOING_ARGS 0
350 #endif
351
352 /* Supply a default definition for PUSH_ARGS.  */
353 #ifndef PUSH_ARGS
354 #ifdef PUSH_ROUNDING
355 #define PUSH_ARGS       !ACCUMULATE_OUTGOING_ARGS
356 #else
357 #define PUSH_ARGS       0
358 #endif
359 #endif
360
361 /* If PREFERRED_STACK_BOUNDARY is not defined, set it to STACK_BOUNDARY.
362    STACK_BOUNDARY is required.  */
363 #ifndef PREFERRED_STACK_BOUNDARY
364 #define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
365 #endif
366
367 /* By default, the C++ compiler will use function addresses in the
368    vtable entries.  Setting this non-zero tells the compiler to use
369    function descriptors instead.  The value of this macro says how
370    many words wide the descriptor is (normally 2).  It is assumed 
371    that the address of a function descriptor may be treated as a
372    pointer to a function.  */
373 #ifndef TARGET_VTABLE_USES_DESCRIPTORS
374 #define TARGET_VTABLE_USES_DESCRIPTORS 0
375 #endif
376
377 /* By default, the vtable entries are void pointers, the so the alignment
378    is the same as pointer alignment.  The value of this macro specifies
379    the alignment of the vtable entry in bits.  It should be defined only
380    when special alignment is necessary. */
381 #ifndef TARGET_VTABLE_ENTRY_ALIGN
382 #define TARGET_VTABLE_ENTRY_ALIGN POINTER_SIZE
383 #endif
384
385 /* There are a few non-descriptor entries in the vtable at offsets below
386    zero.  If these entries must be padded (say, to preserve the alignment
387    specified by TARGET_VTABLE_ENTRY_ALIGN), set this to the number of
388    words in each data entry.  */
389 #ifndef TARGET_VTABLE_DATA_ENTRY_DISTANCE
390 #define TARGET_VTABLE_DATA_ENTRY_DISTANCE 1
391 #endif
392
393 /* Select a format to encode pointers in exception handling data.  We
394    prefer those that result in fewer dynamic relocations.  Assume no
395    special support here and encode direct references.  */
396 #ifndef ASM_PREFERRED_EH_DATA_FORMAT
397 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)  DW_EH_PE_absptr
398 #endif
399
400 /* By default, the C++ compiler will use the lowest bit of the pointer
401    to function to indicate a pointer-to-member-function points to a
402    virtual member function.  However, if FUNCTION_BOUNDARY indicates
403    function addresses aren't always even, the lowest bit of the delta
404    field will be used.  */
405 #ifndef TARGET_PTRMEMFUNC_VBIT_LOCATION
406 #define TARGET_PTRMEMFUNC_VBIT_LOCATION \
407   (FUNCTION_BOUNDARY >= 2 * BITS_PER_UNIT \
408    ? ptrmemfunc_vbit_in_pfn : ptrmemfunc_vbit_in_delta)
409 #endif
410
411 #ifndef DEFAULT_GDB_EXTENSIONS
412 #define DEFAULT_GDB_EXTENSIONS 1
413 #endif
414
415 /* If more than one debugging type is supported, you must define
416    PREFERRED_DEBUGGING_TYPE to choose a format in a system-dependent way.
417
418    This is one long line cause VAXC can't handle a \-newline.  */
419 #if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF_DEBUGGING_INFO) + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) + defined (VMS_DEBUGGING_INFO))
420 #ifndef PREFERRED_DEBUGGING_TYPE
421 You Lose!  You must define PREFERRED_DEBUGGING_TYPE!
422 #endif /* no PREFERRED_DEBUGGING_TYPE */
423 #else /* Only one debugging format supported.  Define PREFERRED_DEBUGGING_TYPE
424          so other code needn't care.  */
425 #ifdef DBX_DEBUGGING_INFO
426 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
427 #endif
428 #ifdef SDB_DEBUGGING_INFO
429 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
430 #endif
431 #ifdef DWARF_DEBUGGING_INFO
432 #define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
433 #endif
434 #ifdef DWARF2_DEBUGGING_INFO
435 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
436 #endif
437 #ifdef VMS_DEBUGGING_INFO
438 #define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
439 #endif
440 #ifdef XCOFF_DEBUGGING_INFO
441 #define PREFERRED_DEBUGGING_TYPE XCOFF_DEBUG
442 #endif
443 #endif /* More than one debugger format enabled.  */
444
445 /* If still not defined, must have been because no debugging formats
446    are supported.  */
447 #ifndef PREFERRED_DEBUGGING_TYPE
448 #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
449 #endif
450
451 /* This is set to 1 if BYTES_BIG_ENDIAN is defined but the target uses a
452    little-endian method of passing and returning structures in registers.
453    On the HP-UX IA64 and PA64 platforms structures are aligned differently
454    then integral values and setting this value to 1 will allow for the
455    special handling of structure arguments and return values in regs.  */
456
457 #ifndef FUNCTION_ARG_REG_LITTLE_ENDIAN
458 #define FUNCTION_ARG_REG_LITTLE_ENDIAN 0
459 #endif
460
461 /* Determine the register class for registers suitable to be the base
462    address register in a MEM.  Allow the choice to be dependent upon
463    the mode of the memory access.  */
464 #ifndef MODE_BASE_REG_CLASS
465 #define MODE_BASE_REG_CLASS(MODE) BASE_REG_CLASS
466 #endif
467
468 #ifndef LARGEST_EXPONENT_IS_NORMAL
469 #define LARGEST_EXPONENT_IS_NORMAL(SIZE) 0
470 #endif
471
472 #ifndef ROUND_TOWARDS_ZERO
473 #define ROUND_TOWARDS_ZERO 0
474 #endif
475
476 #ifndef MODE_HAS_NANS
477 #define MODE_HAS_NANS(MODE)                                     \
478   (FLOAT_MODE_P (MODE)                                          \
479    && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT                  \
480    && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
481 #endif
482
483 #ifndef MODE_HAS_INFINITIES
484 #define MODE_HAS_INFINITIES(MODE)                               \
485   (FLOAT_MODE_P (MODE)                                          \
486    && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT                  \
487    && !LARGEST_EXPONENT_IS_NORMAL (GET_MODE_BITSIZE (MODE)))
488 #endif
489
490 #ifndef MODE_HAS_SIGNED_ZEROS
491 #define MODE_HAS_SIGNED_ZEROS(MODE) \
492   (FLOAT_MODE_P (MODE) && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT)
493 #endif
494
495 #ifndef MODE_HAS_SIGN_DEPENDENT_ROUNDING
496 #define MODE_HAS_SIGN_DEPENDENT_ROUNDING(MODE)                  \
497   (FLOAT_MODE_P (MODE)                                          \
498    && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT                  \
499    && !ROUND_TOWARDS_ZERO)
500 #endif
501
502 #ifndef HOT_TEXT_SECTION_NAME
503 #define HOT_TEXT_SECTION_NAME "text.hot"
504 #endif
505
506 #ifndef UNLIKELY_EXECUTED_TEXT_SECTION_NAME
507 #define UNLIKELY_EXECUTED_TEXT_SECTION_NAME "text.unlikely"
508 #endif
509
510 #ifndef VECTOR_MODE_SUPPORTED_P
511 #define VECTOR_MODE_SUPPORTED_P(MODE) 0
512 #endif
513
514 /* Determine whether __cxa_atexit, rather than atexit, is used to
515    register C++ destructors for local statics and global objects. */
516 #ifndef DEFAULT_USE_CXA_ATEXIT
517 #define DEFAULT_USE_CXA_ATEXIT 0
518 #endif
519
520 #endif  /* ! GCC_DEFAULTS_H */