|
|
1.1.1.5 ! root 1: This is Info file gcc.info, produced by Makeinfo-1.55 from the input 1.1 root 2: file gcc.texi. 3: 4: This file documents the use and the internals of the GNU compiler. 5: 1.1.1.3 root 6: Published by the Free Software Foundation 675 Massachusetts Avenue 7: Cambridge, MA 02139 USA 8: 1.1.1.5 ! root 9: Copyright (C) 1988, 1989, 1992, 1993, 1994 Free Software Foundation, ! 10: Inc. 1.1 root 11: 12: Permission is granted to make and distribute verbatim copies of this 13: manual provided the copyright notice and this permission notice are 14: preserved on all copies. 15: 16: Permission is granted to copy and distribute modified versions of 17: this manual under the conditions for verbatim copying, provided also 1.1.1.5 ! root 18: that the sections entitled "GNU General Public License," "Funding for ! 19: Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are ! 20: included exactly as in the original, and provided that the entire ! 21: resulting derived work is distributed under the terms of a permission ! 22: notice identical to this one. 1.1 root 23: 24: Permission is granted to copy and distribute translations of this 25: manual into another language, under the above conditions for modified 26: versions, except that the sections entitled "GNU General Public 1.1.1.5 ! root 27: License," "Funding for Free Software," and "Protect Your Freedom--Fight ! 28: `Look And Feel'", and this permission notice, may be included in ! 29: translations approved by the Free Software Foundation instead of in the ! 30: original English. 1.1 root 31: 32: 1.1.1.5 ! root 33: File: gcc.info, Node: Driver, Next: Run-time Target, Up: Target Macros 1.1 root 34: 1.1.1.5 ! root 35: Controlling the Compilation Driver, `gcc' ! 36: ========================================= 1.1.1.2 root 37: 1.1.1.5 ! root 38: You can control the compilation driver. 1.1.1.3 root 39: 1.1.1.5 ! root 40: `SWITCH_TAKES_ARG (CHAR)' ! 41: A C expression which determines whether the option `-CHAR' takes ! 42: arguments. The value should be the number of arguments that ! 43: option takes-zero, for many options. ! 44: ! 45: By default, this macro is defined to handle the standard options ! 46: properly. You need not define it unless you wish to add additional ! 47: options which take arguments. ! 48: ! 49: `WORD_SWITCH_TAKES_ARG (NAME)' ! 50: A C expression which determines whether the option `-NAME' takes ! 51: arguments. The value should be the number of arguments that ! 52: option takes-zero, for many options. This macro rather than ! 53: `SWITCH_TAKES_ARG' is used for multi-character option names. ! 54: ! 55: By default, this macro is defined as ! 56: `DEFAULT_WORD_SWITCH_TAKES_ARG', which handles the standard options ! 57: properly. You need not define `WORD_SWITCH_TAKES_ARG' unless you ! 58: wish to add additional options which take arguments. Any ! 59: redefinition should call `DEFAULT_WORD_SWITCH_TAKES_ARG' and then ! 60: check for additional options. ! 61: ! 62: `SWITCHES_NEED_SPACES' ! 63: A string-valued C expression which is nonempty if the linker needs ! 64: a space between the `-L' or `-o' option and its argument. ! 65: ! 66: If this macro is not defined, the default value is 0. ! 67: ! 68: `CPP_SPEC' ! 69: A C string constant that tells the GNU CC driver program options to ! 70: pass to CPP. It can also specify how to translate options you ! 71: give to GNU CC into options for GNU CC to pass to the CPP. ! 72: ! 73: Do not define this macro if it does not need to do anything. ! 74: ! 75: `NO_BUILTIN_SIZE_TYPE' ! 76: If this macro is defined, the preprocessor will not define the ! 77: builtin macro `__SIZE_TYPE__'. The macro `__SIZE_TYPE__' must ! 78: then be defined by `CPP_SPEC' instead. ! 79: ! 80: This should be defined if `SIZE_TYPE' depends on target dependent ! 81: flags which are not accessible to the preprocessor. Otherwise, it ! 82: should not be defined. ! 83: ! 84: `NO_BUILTIN_PTRDIFF_TYPE' ! 85: If this macro is defined, the preprocessor will not define the ! 86: builtin macro `__PTRDIFF_TYPE__'. The macro `__PTRDIFF_TYPE__' ! 87: must then be defined by `CPP_SPEC' instead. ! 88: ! 89: This should be defined if `PTRDIFF_TYPE' depends on target ! 90: dependent flags which are not accessible to the preprocessor. ! 91: Otherwise, it should not be defined. ! 92: ! 93: `SIGNED_CHAR_SPEC' ! 94: A C string constant that tells the GNU CC driver program options to ! 95: pass to CPP. By default, this macro is defined to pass the option ! 96: `-D__CHAR_UNSIGNED__' to CPP if `char' will be treated as ! 97: `unsigned char' by `cc1'. ! 98: ! 99: Do not define this macro unless you need to override the default ! 100: definition. ! 101: ! 102: `CC1_SPEC' ! 103: A C string constant that tells the GNU CC driver program options to ! 104: pass to `cc1'. It can also specify how to translate options you ! 105: give to GNU CC into options for GNU CC to pass to the `cc1'. ! 106: ! 107: Do not define this macro if it does not need to do anything. ! 108: ! 109: `CC1PLUS_SPEC' ! 110: A C string constant that tells the GNU CC driver program options to ! 111: pass to `cc1plus'. It can also specify how to translate options ! 112: you give to GNU CC into options for GNU CC to pass to the ! 113: `cc1plus'. ! 114: ! 115: Do not define this macro if it does not need to do anything. ! 116: ! 117: `ASM_SPEC' ! 118: A C string constant that tells the GNU CC driver program options to ! 119: pass to the assembler. It can also specify how to translate ! 120: options you give to GNU CC into options for GNU CC to pass to the ! 121: assembler. See the file `sun3.h' for an example of this. ! 122: ! 123: Do not define this macro if it does not need to do anything. ! 124: ! 125: `ASM_FINAL_SPEC' ! 126: A C string constant that tells the GNU CC driver program how to ! 127: run any programs which cleanup after the normal assembler. ! 128: Normally, this is not needed. See the file `mips.h' for an ! 129: example of this. ! 130: ! 131: Do not define this macro if it does not need to do anything. ! 132: ! 133: `LINK_SPEC' ! 134: A C string constant that tells the GNU CC driver program options to ! 135: pass to the linker. It can also specify how to translate options ! 136: you give to GNU CC into options for GNU CC to pass to the linker. ! 137: ! 138: Do not define this macro if it does not need to do anything. ! 139: ! 140: `LIB_SPEC' ! 141: Another C string constant used much like `LINK_SPEC'. The ! 142: difference between the two is that `LIB_SPEC' is used at the end ! 143: of the command given to the linker. ! 144: ! 145: If this macro is not defined, a default is provided that loads the ! 146: standard C library from the usual place. See `gcc.c'. ! 147: ! 148: `STARTFILE_SPEC' ! 149: Another C string constant used much like `LINK_SPEC'. The ! 150: difference between the two is that `STARTFILE_SPEC' is used at the ! 151: very beginning of the command given to the linker. ! 152: ! 153: If this macro is not defined, a default is provided that loads the ! 154: standard C startup file from the usual place. See `gcc.c'. ! 155: ! 156: `ENDFILE_SPEC' ! 157: Another C string constant used much like `LINK_SPEC'. The ! 158: difference between the two is that `ENDFILE_SPEC' is used at the ! 159: very end of the command given to the linker. ! 160: ! 161: Do not define this macro if it does not need to do anything. ! 162: ! 163: `LINK_LIBGCC_SPECIAL' ! 164: Define this macro meaning that `gcc' should find the library ! 165: `libgcc.a' by hand, rather than passing the argument `-lgcc' to ! 166: tell the linker to do the search; also, `gcc' should not generate ! 167: `-L' options to pass to the linker (as it normally does). ! 168: ! 169: `LINK_LIBGCC_SPECIAL_1' ! 170: Define this macro meaning that `gcc' should find the library ! 171: `libgcc.a' by hand, rather than passing the argument `-lgcc' to ! 172: tell the linker to do the search. ! 173: ! 174: `RELATIVE_PREFIX_NOT_LINKDIR' ! 175: Define this macro to tell `gcc' that it should only translate a ! 176: `-B' prefix into a `-L' linker option if the prefix indicates an ! 177: absolute file name. ! 178: ! 179: `STANDARD_EXEC_PREFIX' ! 180: Define this macro as a C string constant if you wish to override ! 181: the standard choice of `/usr/local/lib/gcc-lib/' as the default ! 182: prefix to try when searching for the executable files of the ! 183: compiler. ! 184: ! 185: `MD_EXEC_PREFIX' ! 186: If defined, this macro is an additional prefix to try after ! 187: `STANDARD_EXEC_PREFIX'. `MD_EXEC_PREFIX' is not searched when the ! 188: `-b' option is used, or the compiler is built as a cross compiler. ! 189: ! 190: `STANDARD_STARTFILE_PREFIX' ! 191: Define this macro as a C string constant if you wish to override ! 192: the standard choice of `/usr/local/lib/' as the default prefix to ! 193: try when searching for startup files such as `crt0.o'. ! 194: ! 195: `MD_STARTFILE_PREFIX' ! 196: If defined, this macro supplies an additional prefix to try after ! 197: the standard prefixes. `MD_EXEC_PREFIX' is not searched when the ! 198: `-b' option is used, or when the compiler is built as a cross ! 199: compiler. ! 200: ! 201: `MD_STARTFILE_PREFIX_1' ! 202: If defined, this macro supplies yet another prefix to try after the ! 203: standard prefixes. It is not searched when the `-b' option is ! 204: used, or when the compiler is built as a cross compiler. ! 205: ! 206: `LOCAL_INCLUDE_DIR' ! 207: Define this macro as a C string constant if you wish to override ! 208: the standard choice of `/usr/local/include' as the default prefix ! 209: to try when searching for local header files. `LOCAL_INCLUDE_DIR' ! 210: comes before `SYSTEM_INCLUDE_DIR' in the search order. ! 211: ! 212: Cross compilers do not use this macro and do not search either ! 213: `/usr/local/include' or its replacement. ! 214: ! 215: `SYSTEM_INCLUDE_DIR' ! 216: Define this macro as a C string constant if you wish to specify a ! 217: system-specific directory to search for header files before the ! 218: standard directory. `SYSTEM_INCLUDE_DIR' comes before ! 219: `STANDARD_INCLUDE_DIR' in the search order. ! 220: ! 221: Cross compilers do not use this macro and do not search the ! 222: directory specified. ! 223: ! 224: `STANDARD_INCLUDE_DIR' ! 225: Define this macro as a C string constant if you wish to override ! 226: the standard choice of `/usr/include' as the default prefix to try ! 227: when searching for header files. ! 228: ! 229: Cross compilers do not use this macro and do not search either ! 230: `/usr/include' or its replacement. ! 231: ! 232: `INCLUDE_DEFAULTS' ! 233: Define this macro if you wish to override the entire default ! 234: search path for include files. The default search path includes ! 235: `GCC_INCLUDE_DIR', `LOCAL_INCLUDE_DIR', `SYSTEM_INCLUDE_DIR', ! 236: `GPLUSPLUS_INCLUDE_DIR', and `STANDARD_INCLUDE_DIR'. In addition, ! 237: `GPLUSPLUS_INCLUDE_DIR' and `GCC_INCLUDE_DIR' are defined ! 238: automatically by `Makefile', and specify private search areas for ! 239: GCC. The directory `GPLUSPLUS_INCLUDE_DIR' is used only for C++ ! 240: programs. ! 241: ! 242: The definition should be an initializer for an array of structures. ! 243: Each array element should have two elements: the directory name (a ! 244: string constant) and a flag for C++-only directories. Mark the ! 245: end of the array with a null element. For example, here is the ! 246: definition used for VMS: ! 247: ! 248: #define INCLUDE_DEFAULTS \ ! 249: { \ ! 250: { "GNU_GXX_INCLUDE:", 1}, \ ! 251: { "GNU_CC_INCLUDE:", 0}, \ ! 252: { "SYS$SYSROOT:[SYSLIB.]", 0}, \ ! 253: { ".", 0}, \ ! 254: { 0, 0} \ ! 255: } ! 256: ! 257: Here is the order of prefixes tried for exec files: ! 258: ! 259: 1. Any prefixes specified by the user with `-B'. ! 260: ! 261: 2. The environment variable `GCC_EXEC_PREFIX', if any. ! 262: ! 263: 3. The directories specified by the environment variable ! 264: `COMPILER_PATH'. ! 265: ! 266: 4. The macro `STANDARD_EXEC_PREFIX'. ! 267: ! 268: 5. `/usr/lib/gcc/'. ! 269: ! 270: 6. The macro `MD_EXEC_PREFIX', if any. ! 271: ! 272: Here is the order of prefixes tried for startfiles: ! 273: ! 274: 1. Any prefixes specified by the user with `-B'. ! 275: ! 276: 2. The environment variable `GCC_EXEC_PREFIX', if any. ! 277: ! 278: 3. The directories specified by the environment variable ! 279: `LIBRARY_PATH'. ! 280: ! 281: 4. The macro `STANDARD_EXEC_PREFIX'. ! 282: ! 283: 5. `/usr/lib/gcc/'. ! 284: ! 285: 6. The macro `MD_EXEC_PREFIX', if any. ! 286: ! 287: 7. The macro `MD_STARTFILE_PREFIX', if any. ! 288: ! 289: 8. The macro `STANDARD_STARTFILE_PREFIX'. ! 290: ! 291: 9. `/lib/'. ! 292: ! 293: 10. `/usr/lib/'. ! 294: ! 295: ! 296: File: gcc.info, Node: Run-time Target, Next: Storage Layout, Prev: Driver, Up: Target Macros ! 297: ! 298: Run-time Target Specification ! 299: ============================= ! 300: ! 301: Here are run-time target specifications. ! 302: ! 303: `CPP_PREDEFINES' ! 304: Define this to be a string constant containing `-D' options to ! 305: define the predefined macros that identify this machine and system. ! 306: These macros will be predefined unless the `-ansi' option is ! 307: specified. ! 308: ! 309: In addition, a parallel set of macros are predefined, whose names ! 310: are made by appending `__' at the beginning and at the end. These ! 311: `__' macros are permitted by the ANSI standard, so they are ! 312: predefined regardless of whether `-ansi' is specified. ! 313: ! 314: For example, on the Sun, one can use the following value: ! 315: ! 316: "-Dmc68000 -Dsun -Dunix" ! 317: ! 318: The result is to define the macros `__mc68000__', `__sun__' and ! 319: `__unix__' unconditionally, and the macros `mc68000', `sun' and ! 320: `unix' provided `-ansi' is not specified. ! 321: ! 322: `STDC_VALUE' ! 323: Define the value to be assigned to the built-in macro `__STDC__'. ! 324: The default is the value `1'. ! 325: ! 326: `extern int target_flags;' ! 327: This declaration should be present. ! 328: ! 329: `TARGET_...' ! 330: This series of macros is to allow compiler command arguments to ! 331: enable or disable the use of optional features of the target ! 332: machine. For example, one machine description serves both the ! 333: 68000 and the 68020; a command argument tells the compiler whether ! 334: it should use 68020-only instructions or not. This command ! 335: argument works by means of a macro `TARGET_68020' that tests a bit ! 336: in `target_flags'. ! 337: ! 338: Define a macro `TARGET_FEATURENAME' for each such option. Its ! 339: definition should test a bit in `target_flags'; for example: ! 340: ! 341: #define TARGET_68020 (target_flags & 1) ! 342: ! 343: One place where these macros are used is in the ! 344: condition-expressions of instruction patterns. Note how ! 345: `TARGET_68020' appears frequently in the 68000 machine description ! 346: file, `m68k.md'. Another place they are used is in the ! 347: definitions of the other macros in the `MACHINE.h' file. ! 348: ! 349: `TARGET_SWITCHES' ! 350: This macro defines names of command options to set and clear bits ! 351: in `target_flags'. Its definition is an initializer with a ! 352: subgrouping for each command option. ! 353: ! 354: Each subgrouping contains a string constant, that defines the ! 355: option name, and a number, which contains the bits to set in ! 356: `target_flags'. A negative number says to clear bits instead; the ! 357: negative of the number is which bits to clear. The actual option ! 358: name is made by appending `-m' to the specified name. ! 359: ! 360: One of the subgroupings should have a null string. The number in ! 361: this grouping is the default value for `target_flags'. Any target ! 362: options act starting with that value. ! 363: ! 364: Here is an example which defines `-m68000' and `-m68020' with ! 365: opposite meanings, and picks the latter as the default: ! 366: ! 367: #define TARGET_SWITCHES \ ! 368: { { "68020", 1}, \ ! 369: { "68000", -1}, \ ! 370: { "", 1}} ! 371: ! 372: `TARGET_OPTIONS' ! 373: This macro is similar to `TARGET_SWITCHES' but defines names of ! 374: command options that have values. Its definition is an ! 375: initializer with a subgrouping for each command option. ! 376: ! 377: Each subgrouping contains a string constant, that defines the ! 378: fixed part of the option name, and the address of a variable. The ! 379: variable, type `char *', is set to the variable part of the given ! 380: option if the fixed part matches. The actual option name is made ! 381: by appending `-m' to the specified name. ! 382: ! 383: Here is an example which defines `-mshort-data-NUMBER'. If the ! 384: given option is `-mshort-data-512', the variable `m88k_short_data' ! 385: will be set to the string `"512"'. ! 386: ! 387: extern char *m88k_short_data; ! 388: #define TARGET_OPTIONS \ ! 389: { { "short-data-", &m88k_short_data } } ! 390: ! 391: `TARGET_VERSION' ! 392: This macro is a C statement to print on `stderr' a string ! 393: describing the particular machine description choice. Every ! 394: machine description should define `TARGET_VERSION'. For example: ! 395: ! 396: #ifdef MOTOROLA ! 397: #define TARGET_VERSION \ ! 398: fprintf (stderr, " (68k, Motorola syntax)"); ! 399: #else ! 400: #define TARGET_VERSION \ ! 401: fprintf (stderr, " (68k, MIT syntax)"); ! 402: #endif ! 403: ! 404: `OVERRIDE_OPTIONS' ! 405: Sometimes certain combinations of command options do not make ! 406: sense on a particular target machine. You can define a macro ! 407: `OVERRIDE_OPTIONS' to take account of this. This macro, if ! 408: defined, is executed once just after all the command options have ! 409: been parsed. ! 410: ! 411: Don't use this macro to turn on various extra optimizations for ! 412: `-O'. That is what `OPTIMIZATION_OPTIONS' is for. ! 413: ! 414: `OPTIMIZATION_OPTIONS (LEVEL)' ! 415: Some machines may desire to change what optimizations are ! 416: performed for various optimization levels. This macro, if ! 417: defined, is executed once just after the optimization level is ! 418: determined and before the remainder of the command options have ! 419: been parsed. Values set in this macro are used as the default ! 420: values for the other command line options. ! 421: ! 422: LEVEL is the optimization level specified; 2 if `-O2' is ! 423: specified, 1 if `-O' is specified, and 0 if neither is specified. ! 424: ! 425: You should not use this macro to change options that are not ! 426: machine-specific. These should uniformly selected by the same ! 427: optimization level on all supported machines. Use this macro to ! 428: enable machbine-specific optimizations. ! 429: ! 430: *Do not examine `write_symbols' in this macro!* The debugging ! 431: options are not supposed to alter the generated code. ! 432: ! 433: `CAN_DEBUG_WITHOUT_FP' ! 434: Define this macro if debugging can be performed even without a ! 435: frame pointer. If this macro is defined, GNU CC will turn on the ! 436: `-fomit-frame-pointer' option whenever `-O' is specified. 1.1.1.2 root 437: 438: 1.1.1.5 ! root 439: File: gcc.info, Node: Storage Layout, Next: Type Layout, Prev: Run-time Target, Up: Target Macros 1.1.1.2 root 440: 1.1.1.5 ! root 441: Storage Layout ! 442: ============== 1.1.1.2 root 443: 1.1.1.5 ! root 444: Note that the definitions of the macros in this table which are ! 445: sizes or alignments measured in bits do not need to be constant. They ! 446: can be C expressions that refer to static variables, such as the ! 447: `target_flags'. *Note Run-time Target::. ! 448: ! 449: `BITS_BIG_ENDIAN' ! 450: Define this macro to be the value 1 if the most significant bit in ! 451: a byte has the lowest number; otherwise define it to be the value ! 452: zero. This means that bit-field instructions count from the most ! 453: significant bit. If the machine has no bit-field instructions, ! 454: then this must still be defined, but it doesn't matter which value ! 455: it is defined to. ! 456: ! 457: This macro does not affect the way structure fields are packed into ! 458: bytes or words; that is controlled by `BYTES_BIG_ENDIAN'. ! 459: ! 460: `BYTES_BIG_ENDIAN' ! 461: Define this macro to be 1 if the most significant byte in a word ! 462: has the lowest number. ! 463: ! 464: `WORDS_BIG_ENDIAN' ! 465: Define this macro to be 1 if, in a multiword object, the most ! 466: significant word has the lowest number. This applies to both ! 467: memory locations and registers; GNU CC fundamentally assumes that ! 468: the order of words in memory is the same as the order in registers. ! 469: ! 470: `FLOAT_WORDS_BIG_ENDIAN' ! 471: Define this macro to be 1 if `DFmode', `XFmode' or `TFmode' ! 472: floating point numbers are stored in memory with the word ! 473: containing the sign bit at the lowest address; otherwise define it ! 474: to be 0. ! 475: ! 476: You need not define this macro if the ordering is the same as for ! 477: multi-word integers. ! 478: ! 479: `BITS_PER_UNIT' ! 480: Define this macro to be the number of bits in an addressable ! 481: storage unit (byte); normally 8. ! 482: ! 483: `BITS_PER_WORD' ! 484: Number of bits in a word; normally 32. ! 485: ! 486: `MAX_BITS_PER_WORD' ! 487: Maximum number of bits in a word. If this is undefined, the ! 488: default is `BITS_PER_WORD'. Otherwise, it is the constant value ! 489: that is the largest value that `BITS_PER_WORD' can have at ! 490: run-time. ! 491: ! 492: `UNITS_PER_WORD' ! 493: Number of storage units in a word; normally 4. ! 494: ! 495: `MAX_UNITS_PER_WORD' ! 496: Maximum number of units in a word. If this is undefined, the ! 497: default is `UNITS_PER_WORD'. Otherwise, it is the constant value ! 498: that is the largest value that `UNITS_PER_WORD' can have at ! 499: run-time. ! 500: ! 501: `POINTER_SIZE' ! 502: Width of a pointer, in bits. ! 503: ! 504: `PROMOTE_MODE (M, UNSIGNEDP, TYPE)' ! 505: A macro to update M and UNSIGNEDP when an object whose type is ! 506: TYPE and which has the specified mode and signedness is to be ! 507: stored in a register. This macro is only called when TYPE is a ! 508: scalar type. ! 509: ! 510: On most RISC machines, which only have operations that operate on ! 511: a full register, define this macro to set M to `word_mode' if M is ! 512: an integer mode narrower than `BITS_PER_WORD'. In most cases, ! 513: only integer modes should be widened because wider-precision ! 514: floating-point operations are usually more expensive than their ! 515: narrower counterparts. ! 516: ! 517: For most machines, the macro definition does not change UNSIGNEDP. ! 518: However, some machines, have instructions that preferentially ! 519: handle either signed or unsigned quantities of certain modes. For ! 520: example, on the DEC Alpha, 32-bit loads from memory and 32-bit add ! 521: instructions sign-extend the result to 64 bits. On such machines, ! 522: set UNSIGNEDP according to which kind of extension is more ! 523: efficient. ! 524: ! 525: Do not define this macro if it would never modify M. ! 526: ! 527: `PROMOTE_FUNCTION_ARGS' ! 528: Define this macro if the promotion described by `PROMOTE_MODE' ! 529: should also be done for outgoing function arguments. ! 530: ! 531: `PROMOTE_FUNCTION_RETURN' ! 532: Define this macro if the promotion described by `PROMOTE_MODE' ! 533: should also be done for the return value of functions. ! 534: ! 535: If this macro is defined, `FUNCTION_VALUE' must perform the same ! 536: promotions done by `PROMOTE_MODE'. ! 537: ! 538: `PROMOTE_FOR_CALL_ONLY' ! 539: Define this macro if the promotion described by `PROMOTE_MODE' ! 540: should *only* be performed for outgoing function arguments or ! 541: function return values, as specified by `PROMOTE_FUNCTION_ARGS' ! 542: and `PROMOTE_FUNCTION_RETURN', respectively. ! 543: ! 544: `PARM_BOUNDARY' ! 545: Normal alignment required for function parameters on the stack, in ! 546: bits. All stack parameters receive at least this much alignment ! 547: regardless of data type. On most machines, this is the same as the ! 548: size of an integer. ! 549: ! 550: `STACK_BOUNDARY' ! 551: Define this macro if you wish to preserve a certain alignment for ! 552: the stack pointer. The definition is a C expression for the ! 553: desired alignment (measured in bits). ! 554: ! 555: If `PUSH_ROUNDING' is not defined, the stack will always be aligned ! 556: to the specified boundary. If `PUSH_ROUNDING' is defined and ! 557: specifies a less strict alignment than `STACK_BOUNDARY', the stack ! 558: may be momentarily unaligned while pushing arguments. ! 559: ! 560: `FUNCTION_BOUNDARY' ! 561: Alignment required for a function entry point, in bits. ! 562: ! 563: `BIGGEST_ALIGNMENT' ! 564: Biggest alignment that any data type can require on this machine, ! 565: in bits. ! 566: ! 567: `BIGGEST_FIELD_ALIGNMENT' ! 568: Biggest alignment that any structure field can require on this ! 569: machine, in bits. If defined, this overrides `BIGGEST_ALIGNMENT' ! 570: for structure fields only. ! 571: ! 572: `MAX_OFILE_ALIGNMENT' ! 573: Biggest alignment supported by the object file format of this ! 574: machine. Use this macro to limit the alignment which can be ! 575: specified using the `__attribute__ ((aligned (N)))' construct. If ! 576: not defined, the default value is `BIGGEST_ALIGNMENT'. ! 577: ! 578: `DATA_ALIGNMENT (TYPE, BASIC-ALIGN)' ! 579: If defined, a C expression to compute the alignment for a static ! 580: variable. TYPE is the data type, and BASIC-ALIGN is the alignment ! 581: that the object would ordinarily have. The value of this macro is ! 582: used instead of that alignment to align the object. ! 583: ! 584: If this macro is not defined, then BASIC-ALIGN is used. ! 585: ! 586: One use of this macro is to increase alignment of medium-size data ! 587: to make it all fit in fewer cache lines. Another is to cause ! 588: character arrays to be word-aligned so that `strcpy' calls that ! 589: copy constants to character arrays can be done inline. ! 590: ! 591: `CONSTANT_ALIGNMENT (CONSTANT, BASIC-ALIGN)' ! 592: If defined, a C expression to compute the alignment given to a ! 593: constant that is being placed in memory. CONSTANT is the constant ! 594: and BASIC-ALIGN is the alignment that the object would ordinarily ! 595: have. The value of this macro is used instead of that alignment to ! 596: align the object. ! 597: ! 598: If this macro is not defined, then BASIC-ALIGN is used. ! 599: ! 600: The typical use of this macro is to increase alignment for string ! 601: constants to be word aligned so that `strcpy' calls that copy ! 602: constants can be done inline. ! 603: ! 604: `EMPTY_FIELD_BOUNDARY' ! 605: Alignment in bits to be given to a structure bit field that ! 606: follows an empty field such as `int : 0;'. ! 607: ! 608: Note that `PCC_BITFIELD_TYPE_MATTERS' also affects the alignment ! 609: that results from an empty field. ! 610: ! 611: `STRUCTURE_SIZE_BOUNDARY' ! 612: Number of bits which any structure or union's size must be a ! 613: multiple of. Each structure or union's size is rounded up to a ! 614: multiple of this. ! 615: ! 616: If you do not define this macro, the default is the same as ! 617: `BITS_PER_UNIT'. ! 618: ! 619: `STRICT_ALIGNMENT' ! 620: Define this macro to be the value 1 if instructions will fail to ! 621: work if given data not on the nominal alignment. If instructions ! 622: will merely go slower in that case, define this macro as 0. ! 623: ! 624: `PCC_BITFIELD_TYPE_MATTERS' ! 625: Define this if you wish to imitate the way many other C compilers ! 626: handle alignment of bitfields and the structures that contain them. ! 627: ! 628: The behavior is that the type written for a bitfield (`int', ! 629: `short', or other integer type) imposes an alignment for the ! 630: entire structure, as if the structure really did contain an ! 631: ordinary field of that type. In addition, the bitfield is placed ! 632: within the structure so that it would fit within such a field, not ! 633: crossing a boundary for it. ! 634: ! 635: Thus, on most machines, a bitfield whose type is written as `int' ! 636: would not cross a four-byte boundary, and would force four-byte ! 637: alignment for the whole structure. (The alignment used may not be ! 638: four bytes; it is controlled by the other alignment parameters.) ! 639: ! 640: If the macro is defined, its definition should be a C expression; ! 641: a nonzero value for the expression enables this behavior. ! 642: ! 643: Note that if this macro is not defined, or its value is zero, some ! 644: bitfields may cross more than one alignment boundary. The ! 645: compiler can support such references if there are `insv', `extv', ! 646: and `extzv' insns that can directly reference memory. ! 647: ! 648: The other known way of making bitfields work is to define ! 649: `STRUCTURE_SIZE_BOUNDARY' as large as `BIGGEST_ALIGNMENT'. Then ! 650: every structure can be accessed with fullwords. ! 651: ! 652: Unless the machine has bitfield instructions or you define ! 653: `STRUCTURE_SIZE_BOUNDARY' that way, you must define ! 654: `PCC_BITFIELD_TYPE_MATTERS' to have a nonzero value. ! 655: ! 656: If your aim is to make GNU CC use the same conventions for laying ! 657: out bitfields as are used by another compiler, here is how to ! 658: investigate what the other compiler does. Compile and run this ! 659: program: ! 660: ! 661: struct foo1 ! 662: { ! 663: char x; ! 664: char :0; ! 665: char y; ! 666: }; ! 667: ! 668: struct foo2 ! 669: { ! 670: char x; ! 671: int :0; ! 672: char y; ! 673: }; ! 674: ! 675: main () ! 676: { ! 677: printf ("Size of foo1 is %d\n", ! 678: sizeof (struct foo1)); ! 679: printf ("Size of foo2 is %d\n", ! 680: sizeof (struct foo2)); ! 681: exit (0); ! 682: } ! 683: ! 684: If this prints 2 and 5, then the compiler's behavior is what you ! 685: would get from `PCC_BITFIELD_TYPE_MATTERS'. ! 686: ! 687: `BITFIELD_NBYTES_LIMITED' ! 688: Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to ! 689: aligning a bitfield within the structure. ! 690: ! 691: `ROUND_TYPE_SIZE (STRUCT, SIZE, ALIGN)' ! 692: Define this macro as an expression for the overall size of a ! 693: structure (given by STRUCT as a tree node) when the size computed ! 694: from the fields is SIZE and the alignment is ALIGN. ! 695: ! 696: The default is to round SIZE up to a multiple of ALIGN. ! 697: ! 698: `ROUND_TYPE_ALIGN (STRUCT, COMPUTED, SPECIFIED)' ! 699: Define this macro as an expression for the alignment of a structure ! 700: (given by STRUCT as a tree node) if the alignment computed in the ! 701: usual way is COMPUTED and the alignment explicitly specified was ! 702: SPECIFIED. ! 703: ! 704: The default is to use SPECIFIED if it is larger; otherwise, use ! 705: the smaller of COMPUTED and `BIGGEST_ALIGNMENT' ! 706: ! 707: `MAX_FIXED_MODE_SIZE' ! 708: An integer expression for the size in bits of the largest integer ! 709: machine mode that should actually be used. All integer machine ! 710: modes of this size or smaller can be used for structures and ! 711: unions with the appropriate sizes. If this macro is undefined, ! 712: `GET_MODE_BITSIZE (DImode)' is assumed. ! 713: ! 714: `CHECK_FLOAT_VALUE (MODE, VALUE, OVERFLOW)' ! 715: A C statement to validate the value VALUE (of type `double') for ! 716: mode MODE. This means that you check whether VALUE fits within ! 717: the possible range of values for mode MODE on this target machine. ! 718: The mode MODE is always a mode of class `MODE_FLOAT'. OVERFLOW ! 719: is nonzero if the value is already known to be out of range. ! 720: ! 721: If VALUE is not valid or if OVERFLOW is nonzero, you should set ! 722: OVERFLOW to 1 and then assign some valid value to VALUE. Allowing ! 723: an invalid value to go through the compiler can produce incorrect ! 724: assembler code which may even cause Unix assemblers to crash. ! 725: ! 726: This macro need not be defined if there is no work for it to do. ! 727: ! 728: `TARGET_FLOAT_FORMAT' ! 729: A code distinguishing the floating point format of the target ! 730: machine. There are three defined values: ! 731: ! 732: `IEEE_FLOAT_FORMAT' ! 733: This code indicates IEEE floating point. It is the default; ! 734: there is no need to define this macro when the format is IEEE. ! 735: ! 736: `VAX_FLOAT_FORMAT' ! 737: This code indicates the peculiar format used on the Vax. ! 738: ! 739: `UNKNOWN_FLOAT_FORMAT' ! 740: This code indicates any other format. ! 741: ! 742: The value of this macro is compared with `HOST_FLOAT_FORMAT' ! 743: (*note Config::.) to determine whether the target machine has the ! 744: same format as the host machine. If any other formats are ! 745: actually in use on supported machines, new codes should be defined ! 746: for them. ! 747: ! 748: The ordering of the component words of floating point values ! 749: stored in memory is controlled by `FLOAT_WORDS_BIG_ENDIAN' for the ! 750: target machine and `HOST_FLOAT_WORDS_BIG_ENDIAN' for the host. 1.1.1.2 root 751: 752: 1.1.1.5 ! root 753: File: gcc.info, Node: Type Layout, Next: Registers, Prev: Storage Layout, Up: Target Macros 1.1.1.2 root 754: 1.1.1.5 ! root 755: Layout of Source Language Data Types 1.1.1.4 root 756: ==================================== 1.1.1.2 root 757: 1.1.1.5 ! root 758: These macros define the sizes and other characteristics of the ! 759: standard basic data types used in programs being compiled. Unlike the ! 760: macros in the previous section, these apply to specific features of C ! 761: and related languages, rather than to fundamental aspects of storage ! 762: layout. ! 763: ! 764: `INT_TYPE_SIZE' ! 765: A C expression for the size in bits of the type `int' on the ! 766: target machine. If you don't define this, the default is one word. ! 767: ! 768: `MAX_INT_TYPE_SIZE' ! 769: Maximum number for the size in bits of the type `int' on the target ! 770: machine. If this is undefined, the default is `INT_TYPE_SIZE'. ! 771: Otherwise, it is the constant value that is the largest value that ! 772: `INT_TYPE_SIZE' can have at run-time. This is used in `cpp'. ! 773: ! 774: `SHORT_TYPE_SIZE' ! 775: A C expression for the size in bits of the type `short' on the ! 776: target machine. If you don't define this, the default is half a ! 777: word. (If this would be less than one storage unit, it is rounded ! 778: up to one unit.) ! 779: ! 780: `LONG_TYPE_SIZE' ! 781: A C expression for the size in bits of the type `long' on the ! 782: target machine. If you don't define this, the default is one word. ! 783: ! 784: `MAX_LONG_TYPE_SIZE' ! 785: Maximum number for the size in bits of the type `long' on the ! 786: target machine. If this is undefined, the default is ! 787: `LONG_TYPE_SIZE'. Otherwise, it is the constant value that is the ! 788: largest value that `LONG_TYPE_SIZE' can have at run-time. This is ! 789: used in `cpp'. ! 790: ! 791: `LONG_LONG_TYPE_SIZE' ! 792: A C expression for the size in bits of the type `long long' on the ! 793: target machine. If you don't define this, the default is two ! 794: words. ! 795: ! 796: `CHAR_TYPE_SIZE' ! 797: A C expression for the size in bits of the type `char' on the ! 798: target machine. If you don't define this, the default is one ! 799: quarter of a word. (If this would be less than one storage unit, ! 800: it is rounded up to one unit.) ! 801: ! 802: `MAX_CHAR_TYPE_SIZE' ! 803: Maximum number for the size in bits of the type `char' on the ! 804: target machine. If this is undefined, the default is ! 805: `CHAR_TYPE_SIZE'. Otherwise, it is the constant value that is the ! 806: largest value that `CHAR_TYPE_SIZE' can have at run-time. This is ! 807: used in `cpp'. ! 808: ! 809: `FLOAT_TYPE_SIZE' ! 810: A C expression for the size in bits of the type `float' on the ! 811: target machine. If you don't define this, the default is one word. ! 812: ! 813: `DOUBLE_TYPE_SIZE' ! 814: A C expression for the size in bits of the type `double' on the ! 815: target machine. If you don't define this, the default is two ! 816: words. ! 817: ! 818: `LONG_DOUBLE_TYPE_SIZE' ! 819: A C expression for the size in bits of the type `long double' on ! 820: the target machine. If you don't define this, the default is two ! 821: words. ! 822: ! 823: `DEFAULT_SIGNED_CHAR' ! 824: An expression whose value is 1 or 0, according to whether the type ! 825: `char' should be signed or unsigned by default. The user can ! 826: always override this default with the options `-fsigned-char' and ! 827: `-funsigned-char'. ! 828: ! 829: `DEFAULT_SHORT_ENUMS' ! 830: A C expression to determine whether to give an `enum' type only as ! 831: many bytes as it takes to represent the range of possible values ! 832: of that type. A nonzero value means to do that; a zero value ! 833: means all `enum' types should be allocated like `int'. ! 834: ! 835: If you don't define the macro, the default is 0. ! 836: ! 837: `SIZE_TYPE' ! 838: A C expression for a string describing the name of the data type ! 839: to use for size values. The typedef name `size_t' is defined ! 840: using the contents of the string. ! 841: ! 842: The string can contain more than one keyword. If so, separate ! 843: them with spaces, and write first any length keyword, then ! 844: `unsigned' if appropriate, and finally `int'. The string must ! 845: exactly match one of the data type names defined in the function ! 846: `init_decl_processing' in the file `c-decl.c'. You may not omit ! 847: `int' or change the order--that would cause the compiler to crash ! 848: on startup. ! 849: ! 850: If you don't define this macro, the default is `"long unsigned ! 851: int"'. ! 852: ! 853: `PTRDIFF_TYPE' ! 854: A C expression for a string describing the name of the data type ! 855: to use for the result of subtracting two pointers. The typedef ! 856: name `ptrdiff_t' is defined using the contents of the string. See ! 857: `SIZE_TYPE' above for more information. ! 858: ! 859: If you don't define this macro, the default is `"long int"'. ! 860: ! 861: `WCHAR_TYPE' ! 862: A C expression for a string describing the name of the data type ! 863: to use for wide characters. The typedef name `wchar_t' is defined ! 864: using the contents of the string. See `SIZE_TYPE' above for more ! 865: information. ! 866: ! 867: If you don't define this macro, the default is `"int"'. 1.1.1.2 root 868: 1.1.1.5 ! root 869: `WCHAR_TYPE_SIZE' ! 870: A C expression for the size in bits of the data type for wide ! 871: characters. This is used in `cpp', which cannot make use of ! 872: `WCHAR_TYPE'. ! 873: ! 874: `MAX_WCHAR_TYPE_SIZE' ! 875: Maximum number for the size in bits of the data type for wide ! 876: characters. If this is undefined, the default is ! 877: `WCHAR_TYPE_SIZE'. Otherwise, it is the constant value that is the ! 878: largest value that `WCHAR_TYPE_SIZE' can have at run-time. This is ! 879: used in `cpp'. ! 880: ! 881: `OBJC_INT_SELECTORS' ! 882: Define this macro if the type of Objective C selectors should be ! 883: `int'. ! 884: ! 885: If this macro is not defined, then selectors should have the type ! 886: `struct objc_selector *'. ! 887: ! 888: `OBJC_SELECTORS_WITHOUT_LABELS' ! 889: Define this macro if the compiler can group all the selectors ! 890: together into a vector and use just one label at the beginning of ! 891: the vector. Otherwise, the compiler must give each selector its ! 892: own assembler label. ! 893: ! 894: On certain machines, it is important to have a separate label for ! 895: each selector because this enables the linker to eliminate ! 896: duplicate selectors. ! 897: ! 898: `TARGET_BELL' ! 899: A C constant expression for the integer value for escape sequence ! 900: `\a'. ! 901: ! 902: `TARGET_BS' ! 903: `TARGET_TAB' ! 904: `TARGET_NEWLINE' ! 905: C constant expressions for the integer values for escape sequences ! 906: `\b', `\t' and `\n'. ! 907: ! 908: `TARGET_VT' ! 909: `TARGET_FF' ! 910: `TARGET_CR' ! 911: C constant expressions for the integer values for escape sequences ! 912: `\v', `\f' and `\r'. 1.1.1.2 root 913: 914: 1.1.1.5 ! root 915: File: gcc.info, Node: Registers, Next: Register Classes, Prev: Type Layout, Up: Target Macros 1.1.1.2 root 916: 1.1.1.5 ! root 917: Register Usage ! 918: ============== 1.1.1.2 root 919: 1.1.1.5 ! root 920: This section explains how to describe what registers the target ! 921: machine has, and how (in general) they can be used. 1.1.1.4 root 922: 1.1.1.5 ! root 923: The description of which registers a specific instruction can use is ! 924: done with register classes; see *Note Register Classes::. For ! 925: information on using registers to access a stack frame, see *Note Frame ! 926: Registers::. For passing values in registers, see *Note Register ! 927: Arguments::. For returning values in registers, see *Note Scalar ! 928: Return::. 1.1.1.4 root 929: 1.1.1.5 ! root 930: * Menu: ! 931: ! 932: * Register Basics:: Number and kinds of registers. ! 933: * Allocation Order:: Order in which registers are allocated. ! 934: * Values in Registers:: What kinds of values each reg can hold. ! 935: * Leaf Functions:: Renumbering registers for leaf functions. ! 936: * Stack Registers:: Handling a register stack such as 80387. ! 937: * Obsolete Register Macros:: Macros formerly used for the 80387. 1.1.1.2 root 938: 939: 1.1.1.5 ! root 940: File: gcc.info, Node: Register Basics, Next: Allocation Order, Up: Registers 1.1.1.2 root 941: 1.1.1.5 ! root 942: Basic Characteristics of Registers ! 943: ---------------------------------- 1.1.1.2 root 944: 1.1.1.5 ! root 945: Registers have various characteristics. 1.1.1.3 root 946: 1.1.1.5 ! root 947: `FIRST_PSEUDO_REGISTER' ! 948: Number of hardware registers known to the compiler. They receive ! 949: numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the first ! 950: pseudo register's number really is assigned the number ! 951: `FIRST_PSEUDO_REGISTER'. ! 952: ! 953: `FIXED_REGISTERS' ! 954: An initializer that says which registers are used for fixed ! 955: purposes all throughout the compiled code and are therefore not ! 956: available for general allocation. These would include the stack ! 957: pointer, the frame pointer (except on machines where that can be ! 958: used as a general register when no frame pointer is needed), the ! 959: program counter on machines where that is considered one of the ! 960: addressable registers, and any other numbered register with a ! 961: standard use. ! 962: ! 963: This information is expressed as a sequence of numbers, separated ! 964: by commas and surrounded by braces. The Nth number is 1 if ! 965: register N is fixed, 0 otherwise. ! 966: ! 967: The table initialized from this macro, and the table initialized by ! 968: the following one, may be overridden at run time either ! 969: automatically, by the actions of the macro ! 970: `CONDITIONAL_REGISTER_USAGE', or by the user with the command ! 971: options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'. ! 972: ! 973: `CALL_USED_REGISTERS' ! 974: Like `FIXED_REGISTERS' but has 1 for each register that is ! 975: clobbered (in general) by function calls as well as for fixed ! 976: registers. This macro therefore identifies the registers that are ! 977: not available for general allocation of values that must live ! 978: across function calls. ! 979: ! 980: If a register has 0 in `CALL_USED_REGISTERS', the compiler ! 981: automatically saves it on function entry and restores it on ! 982: function exit, if the register is used within the function. ! 983: ! 984: `CONDITIONAL_REGISTER_USAGE' ! 985: Zero or more C statements that may conditionally modify two ! 986: variables `fixed_regs' and `call_used_regs' (both of type `char ! 987: []') after they have been initialized from the two preceding ! 988: macros. ! 989: ! 990: This is necessary in case the fixed or call-clobbered registers ! 991: depend on target flags. ! 992: ! 993: You need not define this macro if it has no work to do. ! 994: ! 995: If the usage of an entire class of registers depends on the target ! 996: flags, you may indicate this to GCC by using this macro to modify ! 997: `fixed_regs' and `call_used_regs' to 1 for each of the registers ! 998: in the classes which should not be used by GCC. Also define the ! 999: macro `REG_CLASS_FROM_LETTER' to return `NO_REGS' if it is called ! 1000: with a letter for a class that shouldn't be used. ! 1001: ! 1002: (However, if this class is not included in `GENERAL_REGS' and all ! 1003: of the insn patterns whose constraints permit this class are ! 1004: controlled by target switches, then GCC will automatically avoid ! 1005: using these registers when the target switches are opposed to ! 1006: them.) ! 1007: ! 1008: `NON_SAVING_SETJMP' ! 1009: If this macro is defined and has a nonzero value, it means that ! 1010: `setjmp' and related functions fail to save the registers, or that ! 1011: `longjmp' fails to restore them. To compensate, the compiler ! 1012: avoids putting variables in registers in functions that use ! 1013: `setjmp'. ! 1014: ! 1015: `INCOMING_REGNO (OUT)' ! 1016: Define this macro if the target machine has register windows. ! 1017: This C expression returns the register number as seen by the ! 1018: called function corresponding to the register number OUT as seen ! 1019: by the calling function. Return OUT if register number OUT is not ! 1020: an outbound register. ! 1021: ! 1022: `OUTGOING_REGNO (IN)' ! 1023: Define this macro if the target machine has register windows. ! 1024: This C expression returns the register number as seen by the ! 1025: calling function corresponding to the register number IN as seen ! 1026: by the called function. Return IN if register number IN is not an ! 1027: inbound register. 1.1.1.2 root 1028: 1029: 1.1.1.5 ! root 1030: File: gcc.info, Node: Allocation Order, Next: Values in Registers, Prev: Register Basics, Up: Registers 1.1.1.2 root 1031: 1.1.1.5 ! root 1032: Order of Allocation of Registers ! 1033: -------------------------------- 1.1.1.2 root 1034: 1.1.1.5 ! root 1035: Registers are allocated in order. ! 1036: ! 1037: `REG_ALLOC_ORDER' ! 1038: If defined, an initializer for a vector of integers, containing the ! 1039: numbers of hard registers in the order in which GNU CC should ! 1040: prefer to use them (from most preferred to least). ! 1041: ! 1042: If this macro is not defined, registers are used lowest numbered ! 1043: first (all else being equal). 1.1.1.4 root 1044: 1.1.1.5 ! root 1045: One use of this macro is on machines where the highest numbered ! 1046: registers must always be saved and the save-multiple-registers ! 1047: instruction supports only sequences of consecutive registers. On ! 1048: such machines, define `REG_ALLOC_ORDER' to be an initializer that ! 1049: lists the highest numbered allocatable register first. 1.1.1.4 root 1050: 1.1.1.5 ! root 1051: `ORDER_REGS_FOR_LOCAL_ALLOC' ! 1052: A C statement (sans semicolon) to choose the order in which to ! 1053: allocate hard registers for pseudo-registers local to a basic ! 1054: block. ! 1055: ! 1056: Store the desired register order in the array `reg_alloc_order'. ! 1057: Element 0 should be the register to allocate first; element 1, the ! 1058: next register; and so on. ! 1059: ! 1060: The macro body should not assume anything about the contents of ! 1061: `reg_alloc_order' before execution of the macro. ! 1062: ! 1063: On most machines, it is not necessary to define this macro. 1.1.1.2 root 1064: 1065: 1.1.1.5 ! root 1066: File: gcc.info, Node: Values in Registers, Next: Leaf Functions, Prev: Allocation Order, Up: Registers 1.1.1.2 root 1067: 1.1.1.5 ! root 1068: How Values Fit in Registers ! 1069: --------------------------- ! 1070: ! 1071: This section discusses the macros that describe which kinds of values ! 1072: (specifically, which machine modes) each register can hold, and how many ! 1073: consecutive registers are needed for a given mode. ! 1074: ! 1075: `HARD_REGNO_NREGS (REGNO, MODE)' ! 1076: A C expression for the number of consecutive hard registers, ! 1077: starting at register number REGNO, required to hold a value of mode ! 1078: MODE. ! 1079: ! 1080: On a machine where all registers are exactly one word, a suitable ! 1081: definition of this macro is ! 1082: ! 1083: #define HARD_REGNO_NREGS(REGNO, MODE) \ ! 1084: ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \ ! 1085: / UNITS_PER_WORD)) ! 1086: ! 1087: `HARD_REGNO_MODE_OK (REGNO, MODE)' ! 1088: A C expression that is nonzero if it is permissible to store a ! 1089: value of mode MODE in hard register number REGNO (or in several ! 1090: registers starting with that one). For a machine where all ! 1091: registers are equivalent, a suitable definition is ! 1092: ! 1093: #define HARD_REGNO_MODE_OK(REGNO, MODE) 1 ! 1094: ! 1095: It is not necessary for this macro to check for the numbers of ! 1096: fixed registers, because the allocation mechanism considers them ! 1097: to be always occupied. ! 1098: ! 1099: On some machines, double-precision values must be kept in even/odd ! 1100: register pairs. The way to implement that is to define this macro ! 1101: to reject odd register numbers for such modes. ! 1102: ! 1103: The minimum requirement for a mode to be OK in a register is that ! 1104: the `movMODE' instruction pattern support moves between the ! 1105: register and any other hard register for which the mode is OK; and ! 1106: that moving a value into the register and back out not alter it. ! 1107: ! 1108: Since the same instruction used to move `SImode' will work for all ! 1109: narrower integer modes, it is not necessary on any machine for ! 1110: `HARD_REGNO_MODE_OK' to distinguish between these modes, provided ! 1111: you define patterns `movhi', etc., to take advantage of this. This ! 1112: is useful because of the interaction between `HARD_REGNO_MODE_OK' ! 1113: and `MODES_TIEABLE_P'; it is very desirable for all integer modes ! 1114: to be tieable. ! 1115: ! 1116: Many machines have special registers for floating point arithmetic. ! 1117: Often people assume that floating point machine modes are allowed ! 1118: only in floating point registers. This is not true. Any ! 1119: registers that can hold integers can safely *hold* a floating ! 1120: point machine mode, whether or not floating arithmetic can be done ! 1121: on it in those registers. Integer move instructions can be used ! 1122: to move the values. ! 1123: ! 1124: On some machines, though, the converse is true: fixed-point machine ! 1125: modes may not go in floating registers. This is true if the ! 1126: floating registers normalize any value stored in them, because ! 1127: storing a non-floating value there would garble it. In this case, ! 1128: `HARD_REGNO_MODE_OK' should reject fixed-point machine modes in ! 1129: floating registers. But if the floating registers do not ! 1130: automatically normalize, if you can store any bit pattern in one ! 1131: and retrieve it unchanged without a trap, then any machine mode ! 1132: may go in a floating register, so you can define this macro to say ! 1133: so. ! 1134: ! 1135: The primary significance of special floating registers is rather ! 1136: that they are the registers acceptable in floating point arithmetic ! 1137: instructions. However, this is of no concern to ! 1138: `HARD_REGNO_MODE_OK'. You handle it by writing the proper ! 1139: constraints for those instructions. ! 1140: ! 1141: On some machines, the floating registers are especially slow to ! 1142: access, so that it is better to store a value in a stack frame ! 1143: than in such a register if floating point arithmetic is not being ! 1144: done. As long as the floating registers are not in class ! 1145: `GENERAL_REGS', they will not be used unless some pattern's ! 1146: constraint asks for one. ! 1147: ! 1148: `MODES_TIEABLE_P (MODE1, MODE2)' ! 1149: A C expression that is nonzero if it is desirable to choose ! 1150: register allocation so as to avoid move instructions between a ! 1151: value of mode MODE1 and a value of mode MODE2. ! 1152: ! 1153: If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, ! 1154: MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1, ! 1155: MODE2)' must be zero. ! 1156: ! 1157: ! 1158: File: gcc.info, Node: Leaf Functions, Next: Stack Registers, Prev: Values in Registers, Up: Registers 1.1.1.2 root 1159: 1.1.1.5 ! root 1160: Handling Leaf Functions ! 1161: ----------------------- ! 1162: ! 1163: On some machines, a leaf function (i.e., one which makes no calls) ! 1164: can run more efficiently if it does not make its own register window. ! 1165: Often this means it is required to receive its arguments in the ! 1166: registers where they are passed by the caller, instead of the registers ! 1167: where they would normally arrive. ! 1168: ! 1169: The special treatment for leaf functions generally applies only when ! 1170: other conditions are met; for example, often they may use only those ! 1171: registers for its own variables and temporaries. We use the term "leaf ! 1172: function" to mean a function that is suitable for this special ! 1173: handling, so that functions with no calls are not necessarily "leaf ! 1174: functions". ! 1175: ! 1176: GNU CC assigns register numbers before it knows whether the function ! 1177: is suitable for leaf function treatment. So it needs to renumber the ! 1178: registers in order to output a leaf function. The following macros ! 1179: accomplish this. ! 1180: ! 1181: `LEAF_REGISTERS' ! 1182: A C initializer for a vector, indexed by hard register number, ! 1183: which contains 1 for a register that is allowable in a candidate ! 1184: for leaf function treatment. ! 1185: ! 1186: If leaf function treatment involves renumbering the registers, ! 1187: then the registers marked here should be the ones before ! 1188: renumbering--those that GNU CC would ordinarily allocate. The ! 1189: registers which will actually be used in the assembler code, after ! 1190: renumbering, should not be marked with 1 in this vector. ! 1191: ! 1192: Define this macro only if the target machine offers a way to ! 1193: optimize the treatment of leaf functions. ! 1194: ! 1195: `LEAF_REG_REMAP (REGNO)' ! 1196: A C expression whose value is the register number to which REGNO ! 1197: should be renumbered, when a function is treated as a leaf 1.1.1.4 root 1198: function. 1199: 1.1.1.5 ! root 1200: If REGNO is a register number which should not appear in a leaf ! 1201: function before renumbering, then the expression should yield -1, ! 1202: which will cause the compiler to abort. ! 1203: ! 1204: Define this macro only if the target machine offers a way to ! 1205: optimize the treatment of leaf functions, and registers need to be ! 1206: renumbered to do this. ! 1207: ! 1208: Normally, `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE' must treat ! 1209: leaf functions specially. It can test the C variable `leaf_function' ! 1210: which is nonzero for leaf functions. (The variable `leaf_function' is ! 1211: defined only if `LEAF_REGISTERS' is defined.) 1.1.1.2 root 1212: 1.1.1.3 root 1213: 1.1.1.5 ! root 1214: File: gcc.info, Node: Stack Registers, Next: Obsolete Register Macros, Prev: Leaf Functions, Up: Registers ! 1215: ! 1216: Registers That Form a Stack ! 1217: --------------------------- ! 1218: ! 1219: There are special features to handle computers where some of the ! 1220: "registers" form a stack, as in the 80387 coprocessor for the 80386. ! 1221: Stack registers are normally written by pushing onto the stack, and are ! 1222: numbered relative to the top of the stack. ! 1223: ! 1224: Currently, GNU CC can only handle one group of stack-like registers, ! 1225: and they must be consecutively numbered. ! 1226: ! 1227: `STACK_REGS' ! 1228: Define this if the machine has any stack-like registers. 1.1.1.3 root 1229: 1.1.1.5 ! root 1230: `FIRST_STACK_REG' ! 1231: The number of the first stack-like register. This one is the top ! 1232: of the stack. 1.1.1.2 root 1233: 1.1.1.5 ! root 1234: `LAST_STACK_REG' ! 1235: The number of the last stack-like register. This one is the ! 1236: bottom of the stack. 1.1 root 1237:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.