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