|
|
1.1 root 1: Info file gcc.info, produced by Makeinfo, -*- Text -*- from input
2: file gcc.texinfo.
3:
4: This file documents the use and the internals of the GNU compiler.
5:
1.1.1.2 ! root 6: Copyright (C) 1988, 1989 Free Software Foundation, Inc.
1.1 root 7:
8: Permission is granted to make and distribute verbatim copies of this
9: manual provided the copyright notice and this permission notice are
10: preserved on all copies.
11:
12: Permission is granted to copy and distribute modified versions of
13: this manual under the conditions for verbatim copying, provided also
1.1.1.2 ! root 14: that the section entitled ``GNU General Public License'' is included
! 15: exactly as in the original, and provided that the entire resulting
! 16: derived work is distributed under the terms of a permission notice
! 17: identical to this one.
1.1 root 18:
19: Permission is granted to copy and distribute translations of this
20: manual into another language, under the above conditions for modified
1.1.1.2 ! root 21: versions, except that the section entitled ``GNU General Public
1.1 root 22: License'' and this permission notice may be included in translations
23: approved by the Free Software Foundation instead of in the original
24: English.
25:
26:
27:
1.1.1.2 ! root 28: File: gcc.info, Node: Addressing Modes, Next: Cross-compilation, Prev: Library Names, Up: Machine Macros
! 29:
! 30: Addressing Modes
! 31: ================
! 32:
! 33: `HAVE_POST_INCREMENT'
! 34: Define this macro if the machine supports post-increment
! 35: addressing.
! 36:
! 37: `HAVE_PRE_INCREMENT'
! 38: `HAVE_POST_DECREMENT'
! 39: `HAVE_PRE_DECREMENT'
! 40: Similar for other kinds of addressing.
! 41:
! 42: `CONSTANT_ADDRESS_P (X)'
! 43: A C expression that is 1 if the RTX X is a constant whose value
! 44: is an integer. This includes integers whose values are not
! 45: explicitly known, such as `symbol_ref' and `label_ref'
! 46: expressions and `const' arithmetic expressions.
! 47:
! 48: On most machines, this can be defined as `CONSTANT_P (X)', but a
! 49: few machines are more restrictive in which constant addresses
! 50: are supported.
! 51:
! 52: `MAX_REGS_PER_ADDRESS'
! 53: A number, the maximum number of registers that can appear in a
! 54: valid memory address.
! 55:
! 56: `GO_IF_LEGITIMATE_ADDRESS (MODE, X, LABEL)'
! 57: A C compound statement with a conditional `goto LABEL;' executed
! 58: if X (an RTX) is a legitimate memory address on the target
! 59: machine for a memory operand of mode MODE.
! 60:
! 61: It usually pays to define several simpler macros to serve as
! 62: subroutines for this one. Otherwise it may be too complicated
! 63: to understand.
! 64:
! 65: This macro must exist in two variants: a strict variant and a
! 66: non-strict one. The strict variant is used in the reload pass.
! 67: It must be defined so that any pseudo-register that has not been
! 68: allocated a hard register is considered a memory reference. In
! 69: contexts where some kind of register is required, a
! 70: pseudo-register with no hard register must be rejected.
! 71:
! 72: The non-strict variant is used in other passes. It must be
! 73: defined to accept all pseudo-registers in every context where
! 74: some kind of register is required.
! 75:
! 76: Compiler source files that want to use the strict variant of
! 77: this macro define the macro `REG_OK_STRICT'. You should use an
! 78: `#ifdef REG_OK_STRICT' conditional to define the strict variant
! 79: in that case and the non-strict variant otherwise.
! 80:
! 81: Typically among the subroutines used to define
! 82: `GO_IF_LEGITIMATE_ADDRESS' are subroutines to check for
! 83: acceptable registers for various purposes (one for base
! 84: registers, one for index registers, and so on). Then only these
! 85: subroutine macros need have two variants; the higher levels of
! 86: macros may be the same whether strict or not.
! 87:
! 88: `REG_OK_FOR_BASE_P (X)'
! 89: A C expression that is nonzero if X (assumed to be a `reg' RTX)
! 90: is valid for use as a base register. For hard registers, it
! 91: should always accept those which the hardware permits and reject
! 92: the others. Whether the macro accepts or rejects pseudo
! 93: registers must be controlled by `REG_OK_STRICT' as described
! 94: above. This usually requires two variant definitions, of which
! 95: `REG_OK_STRICT' controls the one actually used.
! 96:
! 97: `REG_OK_FOR_INDEX_P (X)'
! 98: A C expression that is nonzero if X (assumed to be a `reg' RTX)
! 99: is valid for use as an index register.
! 100:
! 101: The difference between an index register and a base register is
! 102: that the index register may be scaled. If an address involves
! 103: the sum of two registers, neither one of them scaled, then
! 104: either one may be labeled the ``base'' and the other the
! 105: ``index''; but whichever labeling is used must fit the machine's
! 106: constraints of which registers may serve in each capacity. The
! 107: compiler will try both labelings, looking for one that is valid,
! 108: and will reload one or both registers only if neither labeling
! 109: works.
! 110:
! 111: `LEGITIMIZE_ADDRESS (X, OLDX, MODE, WIN)'
! 112: A C compound statement that attempts to replace X with a valid
! 113: memory address for an operand of mode MODE. WIN will be a C
! 114: statement label elsewhere in the code; the macro definition may
! 115: use
! 116:
! 117: GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
! 118:
! 119: to avoid further processing if the address has become legitimate.
! 120:
! 121: X will always be the result of a call to
! 122: `break_out_memory_refs', and OLDX will be the operand that was
! 123: given to that function to produce X.
! 124:
! 125: The code generated by this macro should not alter the
! 126: substructure of X. If it transforms X into a more legitimate
! 127: form, it should assign X (which will always be a C variable) a
! 128: new value.
! 129:
! 130: It is not necessary for this macro to come up with a legitimate
! 131: address. The compiler has standard ways of doing so in all
! 132: cases. In fact, it is safe for this macro to do nothing. But
! 133: often a machine-dependent strategy can generate better code.
! 134:
! 135: `GO_IF_MODE_DEPENDENT_ADDRESS (ADDR, LABEL)'
! 136: A C statement or compound statement with a conditional `goto
! 137: LABEL;' executed if memory address X (an RTX) can have different
! 138: meanings depending on the machine mode of the memory reference
! 139: it is used for.
! 140:
! 141: Autoincrement and autodecrement addresses typically have
! 142: mode-dependent effects because the amount of the increment or
! 143: decrement is the size of the operand being addressed. Some
! 144: machines have other mode-dependent addresses. Many RISC
! 145: machines have no mode-dependent addresses.
! 146:
! 147: You may assume that ADDR is a valid address for the machine.
! 148:
! 149: `LEGITIMATE_CONSTANT_P (X)'
! 150: A C expression that is nonzero if X is a legitimate constant for
! 151: an immediate operand on the target machine. You can assume that
! 152: either X is a `const_double' or it satisfies `CONSTANT_P', so
! 153: you need not check these things. In fact, `1' is a suitable
! 154: definition for this macro on machines where any `const_double'
! 155: is valid and anything `CONSTANT_P' is valid.
! 156:
! 157:
! 158:
! 159: File: gcc.info, Node: Cross-compilation, Next: Misc, Prev: Addressing Modes, Up: Machine Macros
! 160:
! 161: Cross Compilation and Floating-Point Format
! 162: ===========================================
! 163:
! 164: While all modern machines use 2's compliment representation for
! 165: integers, there are a variety of representations for floating point
! 166: numbers. This means that in a cross-compiler the representation of
! 167: floating point numbers in the compiled program may be different from
! 168: that used in the machine doing the compilation.
! 169:
! 170: Because different representation systems may offer different amounts
! 171: of range and precision, the cross compiler cannot safely use the host
! 172: machine's floating point arithmetic. Therefore, floating point
! 173: constants must be represented in the target machine's format. This
! 174: means that the cross compiler cannot use `atof' to parse a floating
! 175: point constant; it must have its own special routine to use instead.
! 176: Also, constant folding must emulate the target machine's arithmetic
! 177: (or must not be done at all).
! 178:
! 179: The macros in the following table should be defined only if you are
! 180: cross compiling between different floating point formats.
! 181:
! 182: Otherwise, don't define them. Then default definitions will be set up
! 183: which use `double' as the data type, `==' to test for equality, etc.
! 184:
! 185: You don't need to worry about how many times you use an operand of
! 186: any of these macros. The compiler never uses operands which have
! 187: side effects.
! 188:
! 189: `REAL_VALUE_TYPE'
! 190: A macro for the C data type to be used to hold a floating point
! 191: value in the target machine's format. Typically this would be a
! 192: `struct' containing an array of `int'.
! 193:
! 194: `REAL_VALUES_EQUAL (X, Y)'
! 195: A macro for a C expression which compares for equality the two
! 196: values, X and Y, both of type `REAL_VALUE_TYPE'.
! 197:
! 198: `REAL_VALUES_LESS (X, Y)'
! 199: A macro for a C expression which tests whether X is less than Y,
! 200: both values being of type `REAL_VALUE_TYPE' and interpreted as
! 201: floating point numbers in the target machine's representation.
! 202:
! 203: `REAL_VALUE_LDEXP (X, SCALE)'
! 204: A macro for a C expression which performs the standard library
! 205: function `ldexp', but using the target machine's floating point
! 206: representation. Both X and the value of the expression have
! 207: type `REAL_VALUE_TYPE'. The second argument, SCALE, is an
! 208: integer.
! 209:
! 210: `REAL_VALUE_ATOF (STRING)'
! 211: A macro for a C expression which converts STRING, an expression
! 212: of type `char *', into a floating point number in the target
! 213: machine's representation. The value has type `REAL_VALUE_TYPE'.
! 214:
! 215: Define the following additional macros if you want to make floating
! 216: point constant folding work while cross compiling. If you don't
! 217: define them, cross compilation is still possible, but constant
! 218: folding will not happen for floating point values.
! 219:
! 220: `REAL_ARITHMETIC (OUTPUT, CODE, X, Y)'
! 221: A macro for a C statement which calculates an arithmetic
! 222: operation of the two floating point values X and Y, both of type
! 223: `REAL_VALUE_TYPE' in the target machine's representation, to
! 224: produce a result of the same type and representation which is
! 225: stored in OUTPUT (which will be a variable).
! 226:
! 227: The operation to be performed is specified by CODE, a tree code
! 228: which will always be one of the following: `PLUS_EXPR',
! 229: `MINUS_EXPR', `MULT_EXPR', `RDIV_EXPR', `MAX_EXPR', `MIN_EXPR'.
! 230:
! 231: The expansion of this macro is responsible for checking for
! 232: overflow. If overflow happens, the macro expansion should
! 233: execute the statement `return 0;', which indicates the inability
! 234: to perform the arithmetic operation requested.
! 235:
! 236: `REAL_VALUE_NEGATE (X)'
! 237: A macro for a C expression which returns the negative of the
! 238: floating point value X. Both X and the value of the expression
! 239: have type `REAL_VALUE_TYPE' and are in the target machine's
! 240: floating point representation.
! 241:
! 242: There is no way for this macro to report overflow, since
! 243: overflow can't happen in the negation operation.
! 244:
! 245: `REAL_VALUE_TO_INT (LOW, HIGH, X)'
! 246: A macro for a C expression which converts a floating point value
! 247: X into a double-precision integer which is then stored into LOW
! 248: and HIGH, two variables of type INT.
! 249:
! 250: `REAL_VALUE_FROM_INT (X, LOW, HIGH)'
! 251: A macro for a C expression which converts a double-precision
! 252: integer found in LOW and HIGH, two variables of type INT, into a
! 253: floating point value which is then stored into X.
! 254:
! 255:
! 256:
! 257: File: gcc.info, Node: Misc, Next: Condition Code, Prev: Cross-compilation, Up: Machine Macros
! 258:
! 259: Miscellaneous Parameters
! 260: ========================
! 261:
! 262: `CASE_VECTOR_MODE'
! 263: An alias for a machine mode name. This is the machine mode that
! 264: elements of a jump-table should have.
! 265:
! 266: `CASE_VECTOR_PC_RELATIVE'
! 267: Define this macro if jump-tables should contain relative
! 268: addresses.
! 269:
! 270: `CASE_DROPS_THROUGH'
! 271: Define this if control falls through a `case' insn when the
! 272: index value is out of range. This means the specified
! 273: default-label is actually ignored by the `case' insn proper.
! 274:
! 275: `IMPLICIT_FIX_EXPR'
! 276: An alias for a tree code that should be used by default for
! 277: conversion of floating point values to fixed point. Normally,
! 278: `FIX_ROUND_EXPR' is used.
! 279:
! 280: `FIXUNS_TRUNC_LIKE_FIX_TRUNC'
! 281: Define this macro if the same instructions that convert a
! 282: floating point number to a signed fixed point number also
! 283: convert validly to an unsigned one.
! 284:
! 285: `EASY_DIV_EXPR'
! 286: An alias for a tree code that is the easiest kind of division to
! 287: compile code for in the general case. It may be
! 288: `TRUNC_DIV_EXPR', `FLOOR_DIV_EXPR', `CEIL_DIV_EXPR' or
! 289: `ROUND_DIV_EXPR'. These four division operators differ in how
! 290: they round the result to an integer. `EASY_DIV_EXPR' is used
! 291: when it is permissible to use any of those kinds of division and
! 292: the choice should be made on the basis of efficiency.
! 293:
! 294: `DEFAULT_SIGNED_CHAR'
! 295: An expression whose value is 1 or 0, according to whether the
! 296: type `char' should be signed or unsigned by default. The user
! 297: can always override this default with the options
! 298: `-fsigned-char' and `-funsigned-char'.
! 299:
! 300: `SCCS_DIRECTIVE'
! 301: Define this if the preprocessor should ignore `#sccs' directives
! 302: and print no error message.
! 303:
! 304: `HAVE_VPRINTF'
! 305: Define this if the library function `vprintf' is available on
! 306: your system.
! 307:
! 308: `MOVE_MAX'
! 309: The maximum number of bytes that a single instruction can move
! 310: quickly from memory to memory.
! 311:
! 312: `INT_TYPE_SIZE'
! 313: A C expression for the size in bits of the type `int' on the
! 314: target machine.
! 315:
! 316: `SLOW_BYTE_ACCESS'
! 317: Define this macro as a C expression which is nonzero if
! 318: accessing less than a word of memory (i.e. a `char' or a
! 319: `short') is slow (requires more than one instruction).
! 320:
! 321: `SLOW_ZERO_EXTEND'
! 322: Define this macro if zero-extension (of a `char' or `short' to
! 323: an `int') can be done faster if the destination is a register
! 324: that is known to be zero.
! 325:
! 326: If you define this macro, you must have instruction patterns
! 327: that recognize RTL structures like this:
! 328:
! 329: (set (strict-low-part (subreg:QI (reg:SI ...) 0)) ...)
! 330:
! 331: and likewise for `HImode'.
! 332:
! 333: `SHIFT_COUNT_TRUNCATED'
! 334: Define this macro if shift instructions ignore all but the
! 335: lowest few bits of the shift count. It implies that a
! 336: sign-extend or zero-extend instruction for the shift count can
! 337: be omitted.
! 338:
! 339: `TRULY_NOOP_TRUNCATION (OUTPREC, INPREC)'
! 340: A C expression which is nonzero if on this machine it is safe to
! 341: ``convert'' an integer of INPREC bits to one of OUTPREC bits
! 342: (where OUTPREC is smaller than INPREC) by merely operating on it
! 343: as if it had only OUTPREC bits.
! 344:
! 345: On many machines, this expression can be 1.
! 346:
! 347: `NO_FUNCTION_CSE'
! 348: Define this macro if it is as good or better to call a constant
! 349: function address than to call an address kept in a register.
! 350:
! 351: `PROMOTE_PROTOTYPES'
! 352: Define this macro if an argument declared as `char' or `short'
! 353: in a prototype should actually be passed as an `int'. In
! 354: addition to avoiding errors in certain cases of mismatch, it
! 355: also makes for better code on certain machines.
! 356:
! 357: `STORE_FLAG_VALUE'
! 358: A C expression for the value stored by a store-flag instruction
! 359: (`sCOND') when the condition is true. This is usually 1 or -1;
! 360: it is required to be an odd number.
! 361:
! 362: Do not define `STORE_FLAG_VALUE' if the machine has no
! 363: store-flag instructions.
! 364:
! 365: `Pmode'
! 366: An alias for the machine mode for pointers. Normally the
! 367: definition can be
! 368:
! 369: #define Pmode SImode
! 370:
! 371: `FUNCTION_MODE'
! 372: An alias for the machine mode used for memory references to
! 373: functions being called, in `call' RTL expressions. On most
! 374: machines this should be `QImode'.
! 375:
! 376: `INSN_MACHINE_INFO'
! 377: This macro should expand into a C structure type to use for the
! 378: machine-dependent info field specified with the optional last
! 379: argument in `define_insn' and `define_peephole' patterns. For
! 380: example, it might expand into `struct machine_info'; then it
! 381: would be up to you to define this structure in the `tm.h' file.
! 382:
! 383: You do not need to define this macro if you do not write the
! 384: optional last argument in any of the patterns in the machine
! 385: description.
! 386:
! 387: `CONST_COSTS (X, CODE)'
! 388: A part of a C `switch' statement that describes the relative
! 389: costs of constant RTL expressions. It must contain `case'
! 390: labels for expression codes `const_int', `const', `symbol_ref',
! 391: `label_ref' and `const_double'. Each case must ultimately reach
! 392: a `return' statement to return the relative cost of the use of
! 393: that kind of constant value in an expression. The cost may
! 394: depend on the precise value of the constant, which is available
! 395: for examination in X.
! 396:
! 397: CODE is the expression code--redundant, since it can be obtained
! 398: with `GET_CODE (X)'.
! 399:
! 400: `DOLLARS_IN_IDENTIFIERS'
! 401: Define this to be nonzero if the character `$' should be allowed
! 402: by default in identifier names.
! 403:
! 404: `USE_C_ALLOCA'
! 405: Define this macro to indicate that the compiler is running with
! 406: the `alloca' implemented in C. This version of `alloca' can be
! 407: found in the file `alloca.c'; to use it, you must also edit the
! 408: `Makefile'.
! 409:
! 410: This macro, unlike most, describes the machine that the compiler
! 411: is running on, rather than the one the compiler is compiling for.
! 412: Therefore, it should be set in the `xm-MACHINE.h' file rather
! 413: than in the `xm-MACHINE.h' file.
! 414:
! 415: If you do define this macro, you should probably do it as follows:
! 416:
! 417: #ifndef __GNUC__
! 418: #define USE_C_ALLOCA
! 419: #else
! 420: #deifne alloca __builtin_alloca
! 421: #endif
! 422:
! 423: so that when the compiler is compiled with GNU CC it uses the
! 424: more efficient built-in `alloca' function.
! 425:
! 426:
! 427:
! 428: File: gcc.info, Node: Condition Code, Next: Assembler Format, Prev: Misc, Up: Machine Macros
! 429:
! 430: Condition Code Information
! 431: ==========================
! 432:
! 433: The file `conditions.h' defines a variable `cc_status' to describe
! 434: how the condition code was computed (in case the interpretation of
! 435: the condition code depends on the instruction that it was set by).
! 436: This variable contains the RTL expressions on which the condition
! 437: code is currently based, and several standard flags.
! 438:
! 439: Sometimes additional machine-specific flags must be defined in the
! 440: machine description header file. It can also add additional
! 441: machine-specific information by defining `CC_STATUS_MDEP'.
! 442:
! 443: `CC_STATUS_MDEP'
! 444: C code for a data type which is used for declaring the `mdep'
! 445: component of `cc_status'. It defaults to `int'.
! 446:
! 447: `CC_STATUS_MDEP_INIT'
! 448: A C expression for the initial value of the `mdep' field. It
! 449: defaults to 0.
! 450:
! 451: `NOTICE_UPDATE_CC (EXP, INSN)'
! 452: A C compound statement to set the components of `cc_status'
! 453: appropriately for an insn INSN whose body is EXP. It is this
! 454: macro's responsibility to recognize insns that set the condition
! 455: code as a byproduct of other activity as well as those that
! 456: explicitly set `(cc0)'.
! 457:
! 458: If there are insn that do not set the condition code but do
! 459: alter other machine registers, this macro must check to see
! 460: whether they invalidate the expressions that the condition code
! 461: is recorded as reflecting. For example, on the 68000, insns
! 462: that store in address registers do not set the condition code,
! 463: which means that usually `NOTICE_UPDATE_CC' can leave
! 464: `cc_status' unaltered for such insns. But suppose that the
! 465: previous insn set the condition code based on location
! 466: `a4@(102)' and the current insn stores a new value in `a4'.
! 467: Although the condition code is not changed by this, it will no
! 468: longer be true that it reflects the contents of `a4@(102)'.
! 469: Therefore, `NOTICE_UPDATE_CC' must alter `cc_status' in this
! 470: case to say that nothing is known about the condition code value.
! 471:
! 472: The definition of `NOTICE_UPDATE_CC' must be prepared to deal
! 473: with the results of peephole optimization: insns whose patterns
! 474: are `parallel' RTXs containing various `reg', `mem' or constants
! 475: which are just the operands. The RTL structure of these insns
! 476: is not sufficient to indicate what the insns actually do. What
! 477: `NOTICE_UPDATE_CC' should do when it sees one is just to run
! 478: `CC_STATUS_INIT'.
! 479:
! 480:
! 481:
1.1 root 482: File: gcc.info, Node: Assembler Format, Prev: Condition Code, Up: Machine Macros
483:
484: Output of Assembler Code
485: ========================
486:
487: `ASM_SPEC'
488: A C string constant that tells the GNU CC driver program options
489: to pass to the assembler. It can also specify how to translate
490: options you give to GNU CC into options for GNU CC to pass to
491: the assembler. See the file `tm-sun3.h' for an example of this.
492:
493: Do not define this macro if it does not need to do anything.
494:
495: `LINK_SPEC'
496: A C string constant that tells the GNU CC driver program options
497: to pass to the linker. It can also specify how to translate
498: options you give to GNU CC into options for GNU CC to pass to
499: the linker.
500:
501: Do not define this macro if it does not need to do anything.
502:
503: `LIB_SPEC'
504: Another C string constant used much like `LINK_SPEC'. The
505: difference between the two is that `LIBS_SPEC' is used at the
506: end of the command given to the linker.
507:
508: If this macro is not defined, a default is provided that loads
509: the standard C library from the usual place. See `gcc.c'.
510:
511: `STARTFILE_SPEC'
512: Another C string constant used much like `LINK_SPEC'. The
513: difference between the two is that `STARTFILE_SPEC' is used at
514: the very beginning of the command given to the linker.
515:
516: If this macro is not defined, a default is provided that loads
517: the standard C startup file from the usual place. See `gcc.c'.
518:
1.1.1.2 ! root 519: `STANDARD_EXEC_PREFIX'
! 520: Define this macro as a C string constant if you wish to override
! 521: the standard choice of `/usr/local/lib/gcc-' as the default
! 522: prefix to try when searching for the executable files of the
! 523: compiler.
! 524:
! 525: The prefix specified by the `-B' option, if any, is tried before
! 526: the default prefix. After the default prefix, if the executable
! 527: is not found that way, `/usr/lib/gcc-' is tried next; then the
! 528: directories in your search path for shell commands are searched.
! 529:
! 530: `STANDARD_STARTFILE_PREFIX'
! 531: Define this macro as a C string constant if you wish to override
! 532: the standard choice of `/usr/local/lib/' as the default prefix
! 533: to try when searching for startup files such as `crt0.o'.
! 534:
! 535: In this search, all the prefixes tried for executable files are
! 536: tried first. Then comes the default startfile prefix specified
! 537: by this macro, followed by the prefixes `/lib/' and `/usr/lib/'
! 538: as last resorts.
! 539:
1.1 root 540: `ASM_FILE_START (STREAM)'
541: A C expression which outputs to the stdio stream STREAM some
542: appropriate text to go at the start of an assembler file.
543:
544: Normally this macro is defined to output a line containing
545: `#NO_APP', which is a comment that has no effect on most
546: assemblers but tells the GNU assembler that it can save time by
547: not checking for certain assembler constructs.
548:
549: On systems that use SDB, it is necessary to output certain
550: commands; see `tm-attasm.h'.
551:
552: `ASM_APP_ON'
553: A C string constant for text to be output before each `asm'
554: statement or group of consecutive ones. Normally this is
555: `"#APP"', which is a comment that has no effect on most
556: assemblers but tells the GNU assembler that it must check the
557: lines that follow for all valid assembler constructs.
558:
559: `ASM_APP_OFF'
560: A C string constant for text to be output after each `asm'
561: statement or group of consecutive ones. Normally this is
562: `"#NO_APP"', which tells the GNU assembler to resume making the
563: time-saving assumptions that are valid for ordinary compiler
564: output.
565:
566: `TEXT_SECTION_ASM_OP'
567: A C string constant for the assembler operation that should
568: precede instructions and read-only data. Normally `".text"' is
569: right.
570:
571: `DATA_SECTION_ASM_OP'
572: A C string constant for the assembler operation to identify the
573: following data as writable initialized data. Normally `".data"'
574: is right.
575:
576: `REGISTER_NAMES'
577: A C initializer containing the assembler's names for the machine
578: registers, each one as a C string constant. This is what
579: translates register numbers in the compiler into assembler
580: language.
581:
582: `DBX_REGISTER_NUMBER (REGNO)'
583: A C expression that returns the DBX register number for the
584: compiler register number REGNO. In simple cases, the value of
585: this expression may be REGNO itself. But sometimes there are
586: some registers that the compiler knows about and DBX does not,
587: or vice versa. In such cases, some register may need to have
588: one number in the compiler and another for DBX.
589:
590: `DBX_DEBUGGING_INFO'
591: Define this macro if GNU CC should produce debugging output for
592: DBX in response to the `-g' option.
593:
594: `SDB_DEBUGGING_INFO'
595: Define this macro if GNU CC should produce debugging output for
596: SDB in response to the `-g' option.
597:
598: `PUT_SDB_OP'
599: Define these macros to override the assembler syntax for the
600: special SDB assembler directives. See `sdbout.c' for a list of
601: these macros and their arguments. If the standard syntax is
602: used, you need not define them yourself.
603:
604: `SDB_GENERATE_FAKE'
605: Define this macro to override the usual method of constructing a
606: dummy name for anonymous structure and union types. See
607: `sdbout.c' for more infomation.
608:
609: `DBX_NO_XREFS'
610: Define this macro if DBX on your system does not support the
611: construct `xsTAGNAME'. On some systems, this construct is used
612: to describe a forward reference to a structure named TAGNAME.
613: On other systems, this construct is not supported at all.
614:
615: `DBX_CONTIN_LENGTH'
616: A symbol name in DBX-format debugging information is normally
617: continued (split into two separate `.stabs' directives) when it
618: exceeds a certain length (by default, 80 characters). On some
619: operating systems, DBX requires this splitting; on others,
620: splitting must not be done. You can inhibit splitting by
621: defining this macro with the value zero. You can override the
622: default splitting-length by defining this macro as an expression
623: for the length you desire.
624:
625: `DBX_CONTIN_CHAR'
626: Normally continuation is indicated by adding a `\' character to
627: the end of a `.stabs' string when a continuation follows. To
628: use a different character instead, define this macro as a
629: character constant for the character you want to use. Do not
630: define this macro if backslash is correct for your system.
631:
632: `ASM_OUTPUT_LABEL (STREAM, NAME)'
633: A C statement (sans semicolon) to output to the stdio stream
634: STREAM the assembler definition of a label named NAME. Use the
635: expression `assemble_name (STREAM, NAME)' to output the name
636: itself; before and after that, output the additional assembler
637: syntax for defining the name, and a newline.
638:
639: `ASM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL)'
640: A C statement (sans semicolon) to output to the stdio stream
641: STREAM any text necessary for declaring the name NAME of a
642: function which is being defined. This macro is responsible for
643: outputting the label definition (perhaps using
644: `ASM_OUTPUT_LABEL'). The argument DECL is the `FUNCTION_DECL'
645: tree node representing the function.
646:
647: If this macro is not defined, then the function name is defined
648: in the usual manner as a label (by means of `ASM_OUTPUT_LABEL').
649:
650: `ASM_GLOBALIZE_LABEL (STREAM, NAME)'
651: A C statement (sans semicolon) to output to the stdio stream
652: STREAM some commands that will make the label NAME global; that
653: is, available for reference from other files. Use the
654: expression `assemble_name (STREAM, NAME)' to output the name
655: itself; before and after that, output the additional assembler
656: syntax for making that name global, and a newline.
657:
658: `ASM_OUTPUT_EXTERNAL (STREAM, NAME, DECL)'
659: A C statement (sans semicolon) to output to the stdio stream
660: STREAM any text necessary for declaring the name of an external
661: symbol named NAME which is referenced in this compilation but
662: not defined. The value of DECL is the tree node for the
663: declaration.
664:
665: This macro need not be defined if it does not need to output
666: anything. The GNU assembler and most Unix assemblers don't
667: require anything.
668:
669: `ASM_OUTPUT_LABELREF (STREAM, NAME)'
670: A C statement to output to the stdio stream STREAM a reference
671: in assembler syntax to a label named NAME. The character `_'
672: should be added to the front of the name, if that is customary
673: on your operating system, as it is in most Berkeley Unix
674: systems. This macro is used in `assemble_name'.
675:
676: `ASM_GENERATE_INTERNAL_LABEL (STRING, PREFIX, NUM)'
677: A C statement to store into the string STRING a label whose name
678: is made from the string PREFIX and the number NUM.
679:
680: This string, when output subsequently by `ASM_OUTPUT_LABELREF',
681: should produce the same output that `ASM_OUTPUT_INTERNAL_LABEL'
682: would produce with the same PREFIX and NUM.
683:
684: `ASM_OUTPUT_INTERNAL_LABEL (STREAM, PREFIX, NUM)'
685: A C statement to output to the stdio stream STREAM a label whose
686: name is made from the string PREFIX and the number NUM. These
687: labels are used for internal purposes, and there is no reason
688: for them to appear in the symbol table of the object file. On
689: many systems, the letter `L' at the beginning of a label has
690: this effect. The usual definition of this macro is as follows:
691:
692: fprintf (STREAM, "L%s%d:\n", PREFIX, NUM)
693:
694: `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)'
695: Define this if the label before a jump-table needs to be output
696: specially. The first three arguments are the same as for
697: `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the
698: jump-table which follows (a `jump_insn' containing an `addr_vec'
699: or `addr_diff_vec').
700:
701: This feature is used on system V to output a `swbeg' statement
702: for the table.
703:
704: If this macro is not defined, these labels are output with
705: `ASM_OUTPUT_INTERNAL_LABEL'.
706:
707: `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
708: Define this if something special must be output at the end of a
709: jump-table. The definition should be a C statement to be
710: executed after the assembler code for the table is written. It
711: should write the appropriate code to stdio stream STREAM. The
712: argument TABLE is the jump-table insn, and NUM is the
713: label-number of the preceding label.
714:
715: If this macro is not defined, nothing special is output at the
716: end of the jump-table.
717:
1.1.1.2 ! root 718: `ASM_OUTPUT_ALIGN_CODE (FILE)'
! 719: A C expression to output text to align the location counter in
! 720: the way that is desirable at a point in the code that is reached
! 721: only by jumping.
! 722:
! 723: This macro need not be defined if you don't want any special
! 724: alignment to be done at such a time. Most machine descriptions
! 725: do not currently define the macro.
! 726:
1.1 root 727: `ASM_FORMAT_PRIVATE_NAME (OUTVAR, NAME, NUMBER)'
728: A C expression to assign to OUTVAR (which is a variable of type
729: `char *') a newly allocated string made from the string NAME and
730: the number NUMBER, with some suitable punctuation added. Use
731: `alloca' to get space for the string.
732:
733: This string will be used as the argument to
734: `ASM_OUTPUT_LABELREF' to produce an assembler label for an
735: internal static variable whose name is NAME. Therefore, the
736: string must be such as to result in valid assembler code. The
737: argument NUMBER is different each time this macro is executed;
738: it prevents conflicts between similarly-named internal static
739: variables in different scopes.
740:
741: Ideally this string should not be a valid C identifier, to
742: prevent any conflict with the user's own symbols. Most
743: assemblers allow periods or percent signs in assembler symbols;
744: putting at least one of these between the name and the number
745: will suffice.
746:
747: `ASM_OUTPUT_REG_PUSH (STREAM, REGNO)'
748: A C expression to output to STREAM some assembler code which
749: will push hard register number REGNO onto the stack. The code
750: need not be optimal, since this macro is used only when profiling.
751:
752: `ASM_OUTPUT_REG_POP (STREAM, REGNO)'
753: A C expression to output to STREAM some assembler code which
754: will pop hard register number REGNO off of the stack. The code
755: need not be optimal, since this macro is used only when profiling.
756:
757: `ASM_OUTPUT_ADDR_DIFF_ELT (STREAM, VALUE, REL)'
758: This macro should be provided on machines where the addresses in
759: a dispatch table are relative to the table's own address.
760:
761: The definition should be a C statement to output to the stdio
762: stream STREAM an assembler pseudo-instruction to generate a
763: difference between two labels. VALUE and REL are the numbers of
764: two internal labels. The definitions of these labels are output
765: using `ASM_OUTPUT_INTERNAL_LABEL', and they must be printed in
766: the same way here. For example,
767:
768: fprintf (STREAM, "\t.word L%d-L%d\n",
769: VALUE, REL)
770:
771: `ASM_OUTPUT_ADDR_VEC_ELT (STREAM, VALUE)'
772: This macro should be provided on machines where the addresses in
773: a dispatch table are absolute.
774:
775: The definition should be a C statement to output to the stdio
776: stream STREAM an assembler pseudo-instruction to generate a
777: reference to a label. VALUE is the number of an internal label
778: whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'.
779: For example,
780:
781: fprintf (STREAM, "\t.word L%d\n", VALUE)
782:
783: `ASM_OUTPUT_DOUBLE (STREAM, VALUE)'
784: A C statement to output to the stdio stream STREAM an assembler
785: instruction to assemble a `double' constant whose value is
786: VALUE. VALUE will be a C expression of type `double'.
787:
788: `ASM_OUTPUT_FLOAT (STREAM, VALUE)'
789: A C statement to output to the stdio stream STREAM an assembler
790: instruction to assemble a `float' constant whose value is VALUE.
791: vALUE will be a C expression of type `float'.
792:
793: `ASM_OUTPUT_INT (STREAM, EXP)'
794: `ASM_OUTPUT_SHORT (STREAM, EXP)'
795: `ASM_OUTPUT_CHAR (STREAM, EXP)'
796: A C statement to output to the stdio stream STREAM an assembler
797: instruction to assemble a `int', `short' or `char' constant
798: whose value is VALUE. The argument EXP will be an RTL
799: expression which represents a constant value. Use
800: `output_addr_const (EXP)' to output this value as an assembler
801: expression.
802:
803: `ASM_OUTPUT_BYTE (STREAM, VALUE)'
804: A C statement to output to the stdio stream STREAM an assembler
805: instruction to assemble a single byte containing the number VALUE.
806:
807: `ASM_OUTPUT_ASCII (STREAM, PTR, LEN)'
808: A C statement to output to the stdio stream STREAM an assembler
809: instruction to assemble a string constant containing the LEN
810: bytes at PTR. PTR will be a C expression of type `char *' and
811: LEN a C expression of type `int'.
812:
813: If the assembler has a `.ascii' pseudo-op as found in the
814: Berkeley Unix assembler, do not define the macro
815: `ASM_OUTPUT_ASCII'.
816:
817: `ASM_OUTPUT_SKIP (STREAM, NBYTES)'
818: A C statement to output to the stdio stream STREAM an assembler
819: instruction to advance the location counter by NBYTES bytes.
820: NBYTES will be a C expression of type `int'.
821:
822: `ASM_OUTPUT_ALIGN (STREAM, POWER)'
823: A C statement to output to the stdio stream STREAM an assembler
824: instruction to advance the location counter to a multiple of 2
825: to the POWER bytes. POWER will be a C expression of type `int'.
826:
1.1.1.2 ! root 827: `ASM_OUTPUT_COMMON (STREAM, NAME, SIZE, ROUNDED)'
1.1 root 828: A C statement (sans semicolon) to output to the stdio stream
829: STREAM the assembler definition of a common-label named NAME
1.1.1.2 ! root 830: whose size is SIZE bytes. The variable ROUNDED is the size
! 831: rounded up to whatever alignment the caller wants.
! 832:
! 833: Use the expression `assemble_name (STREAM, NAME)' to output the
! 834: name itself; before and after that, output the additional
! 835: assembler syntax for defining the name, and a newline.
1.1 root 836:
837: This macro controls how the assembler definitions of
838: uninitialized global variables are output.
839:
1.1.1.2 ! root 840: `ASM_OUTPUT_LOCAL (STREAM, NAME, SIZE, ROUNDED)'
1.1 root 841: A C statement (sans semicolon) to output to the stdio stream
842: STREAM the assembler definition of a local-common-label named
1.1.1.2 ! root 843: NAME whose size is SIZE bytes. The variable ROUNDED is the size
! 844: rounded up to whatever alignment the caller wants.
! 845:
! 846: Use the expression `assemble_name (STREAM, NAME)' to output the
! 847: name itself; before and after that, output the additional
! 848: assembler syntax for defining the name, and a newline.
1.1 root 849:
850: This macro controls how the assembler definitions of
851: uninitialized static variables are output.
852:
853: `ASM_OUTPUT_SOURCE_LINE (STREAM, LINE)'
854: A C statment to output DBX or SDB debugging information before
855: code for line number LINE of the current source file to the
856: stdio stream STREAM.
857:
858: This macro need not be defined if the standard form of debugging
859: information for the debugger in use is appropriate.
860:
861: `ASM_OUTPUT_IDENT (STREAM, STRING)'
862: A C statement to output something to the assembler file to
863: handle a `#ident' directive containing the text STRING. If this
1.1.1.2 ! root 864: macro is not defined, nothing is output for a `#ident' directive.
1.1 root 865:
866: `TARGET_BELL'
867: A C constant expression for the integer value for escape
868: sequence `\a'.
869:
870: `TARGET_BS'
871: `TARGET_TAB'
872: `TARGET_NEWLINE'
873: C constant expressions for the integer values for escape
874: sequences `\b', `\t' and `\n'.
875:
876: `TARGET_VT'
877: `TARGET_FF'
878: `TARGET_CR'
879: C constant expressions for the integer values for escape
880: sequences `\v', `\f' and `\r'.
881:
882: `ASM_OUTPUT_OPCODE (STREAM, PTR)'
883: Define this macro if you are using an unusual assembler that
884: requires different names for the machine instructions.
885:
886: The definition is a C statement or statements which output an
887: assembler instruction opcode to the stdio stream STREAM. The
888: macro-operand PTR is a variable of type `char *' which points to
889: the opcode name in its ``internal'' form--the form that is
890: written in the machine description. The definition should
891: output the opcode name to STREAM, performing any translation you
892: desire, and increment the variable PTR to point at the end of
893: the opcode so that it will not be output twice.
894:
895: In fact, your macro definition may process less than the entire
896: opcode name, or more than the opcode name; but if you want to
897: process text that includes `%'-sequences to substitute operands,
898: you must take care of the substitution yourself. Just be sure
899: to increment PTR over whatever text should not be output normally.
900:
901: If the macro definition does nothing, the instruction is output
902: in the usual way.
903:
904: `FINAL_PRESCAN_INSN (INSN, OPVEC, NOPERANDS)'
905: If defined, a C statement to be executed just prior to the
906: output of assembler code for INSN, to modify the extracted
907: operands so they will be output differently.
908:
909: Here the argument OPVEC is the vector containing the operands
910: extracted from INSN, and NOPERANDS is the number of elements of
911: the vector which contain meaningful data for this insn. The
912: contents of this vector are what will be used to convert the
913: insn template into assembler code, so you can change the
914: assembler output by changing the contents of the vector.
915:
916: This macro is useful when various assembler syntaxes share a
917: single file of instruction patterns; by defining this macro
918: differently, you can cause a large class of instructions to be
919: output differently (such as with rearranged operands).
920: Naturally, variations in assembler syntax affecting individual
921: insn patterns ought to be handled by writing conditional output
922: routines in those patterns.
923:
924: If this macro is not defined, it is equivalent to a null
925: statement.
926:
927: `PRINT_OPERAND (STREAM, X, CODE)'
928: A C compound statement to output to stdio stream STREAM the
929: assembler syntax for an instruction operand X. X is an RTL
930: expression.
931:
932: CODE is a value that can be used to specify one of several ways
933: of printing the operand. It is used when identical operands
934: must be printed differently depending on the context. CODE
935: comes from the `%' specification that was used to request
936: printing of the operand. If the specification was just `%DIGIT'
937: then CODE is 0; if the specification was `%LTR DIGIT' then CODE
938: is the ASCII code for LTR.
939:
940: If X is a register, this macro should print the register's name.
941: The names can be found in an array `reg_names' whose type is
942: `char *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
943:
944: When the machine description has a specification `%PUNCT' (a `%'
945: followed by a punctuation character), this macro is called with
946: a null pointer for X and the punctuation character for CODE.
947:
948: `PRINT_OPERAND_ADDRESS (STREAM, X)'
949: A C compound statement to output to stdio stream STREAM the
950: assembler syntax for an instruction operand that is a memory
951: reference whose address is X. X is an RTL expression.
952:
953: `ASM_OPEN_PAREN'
954: `ASM_CLOSE_PAREN'
955: These macros are defined as C string constant, describing the
956: syntax in the assembler for grouping arithmetic expressions.
957: The following definitions are correct for most assemblers:
958:
959: #define ASM_OPEN_PAREN "("
960: #define ASM_CLOSE_PAREN ")"
961:
962:
963:
964: File: gcc.info, Node: Config, Prev: Machine Macros, Up: Top
965:
966: The Configuration File
967: **********************
968:
969: The configuration file `xm-MACHINE.h' contains macro definitions that
970: describe the machine and system on which the compiler is running.
971: Most of the values in it are actually the same on all machines that
972: GNU CC runs on, so large parts of all configuration files are
973: identical. But there are some macros that vary:
974:
975: `FAILURE_EXIT_CODE'
976: A C expression for the status code to be returned when the
977: compiler exits after serious errors.
978:
979: `SUCCESS_EXIT_CODE'
980: A C expression for the status code to be returned when the
981: compiler exits without serious errors.
982:
983: In addition, configuration files for system V define `bcopy', `bzero'
984: and `bcmp' as aliases. Some files define `alloca' as a macro when
985: compiled with GNU CC, in order to take advantage of the benefit of
986: GNU CC's built-in `alloca'.
987:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.