|
|
1.1 root 1: This is Info file gcc.info, produced by Makeinfo-1.43 from the input
2: file gcc.texi.
3:
4: This file documents the use and the internals of the GNU compiler.
5:
6: Copyright (C) 1988, 1989, 1992 Free Software Foundation, Inc.
7:
8: Permission is granted to make and distribute verbatim copies of
9: this manual provided the copyright notice and this permission notice
10: are 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
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.
18:
19: Permission is granted to copy and distribute translations of this
20: manual into another language, under the above conditions for modified
21: versions, except that the section entitled "GNU General Public
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: File: gcc.info, Node: Uninitialized Data, Next: Label Output, Prev: Data Output, Up: Assembler Format
28:
29: Output of Uninitialized Variables
30: ---------------------------------
31:
32: Each of the macros in this section is used to do the whole job of
33: outputting a single uninitialized variable.
34:
35: `ASM_OUTPUT_COMMON (STREAM, NAME, SIZE, ROUNDED)'
36: A C statement (sans semicolon) to output to the stdio stream
37: STREAM the assembler definition of a common-label named NAME
38: whose size is SIZE bytes. The variable ROUNDED is the size
39: rounded up to whatever alignment the caller wants.
40:
41: Use the expression `assemble_name (STREAM, NAME)' to output the
42: name itself; before and after that, output the additional
43: assembler syntax for defining the name, and a newline.
44:
45: This macro controls how the assembler definitions of uninitialized
46: global variables are output.
47:
48: `ASM_OUTPUT_ALIGNED_COMMON (STREAM, NAME, SIZE, ALIGNMENT)'
49: Like `ASM_OUTPUT_COMMON' except takes the required alignment as a
50: separate, explicit argument. If you define this macro, it is
51: used in place of `ASM_OUTPUT_COMMON', and gives you more
52: flexibility in handling the required alignment of the variable.
53:
54: `ASM_OUTPUT_SHARED_COMMON (STREAM, NAME, SIZE, ROUNDED)'
55: If defined, it is similar to `ASM_OUTPUT_COMMON', except that it
56: is used when NAME is shared. If not defined, `ASM_OUTPUT_COMMON'
57: will be used.
58:
59: `ASM_OUTPUT_LOCAL (STREAM, NAME, SIZE, ROUNDED)'
60: A C statement (sans semicolon) to output to the stdio stream
61: STREAM the assembler definition of a local-common-label named
62: NAME whose size is SIZE bytes. The variable ROUNDED is the size
63: rounded up to whatever alignment the caller wants.
64:
65: Use the expression `assemble_name (STREAM, NAME)' to output the
66: name itself; before and after that, output the additional
67: assembler syntax for defining the name, and a newline.
68:
69: This macro controls how the assembler definitions of uninitialized
70: static variables are output.
71:
72: `ASM_OUTPUT_ALIGNED_LOCAL (STREAM, NAME, SIZE, ALIGNMENT)'
73: Like `ASM_OUTPUT_LOCAL' except takes the required alignment as a
74: separate, explicit argument. If you define this macro, it is
75: used in place of `ASM_OUTPUT_LOCAL', and gives you more
76: flexibility in handling the required alignment of the variable.
77:
78: `ASM_OUTPUT_SHARED_LOCAL (STREAM, NAME, SIZE, ROUNDED)'
79: If defined, it is similar to `ASM_OUTPUT_LOCAL', except that it
80: is used when NAME is shared. If not defined, `ASM_OUTPUT_LOCAL'
81: will be used.
82:
83:
84: File: gcc.info, Node: Label Output, Next: Constructor Output, Prev: Uninitialized Data, Up: Assembler Format
85:
86: Output and Generation of Labels
87: -------------------------------
88:
89: `ASM_OUTPUT_LABEL (STREAM, NAME)'
90: A C statement (sans semicolon) to output to the stdio stream
91: STREAM the assembler definition of a label named NAME. Use the
92: expression `assemble_name (STREAM, NAME)' to output the name
93: itself; before and after that, output the additional assembler
94: syntax for defining the name, and a newline.
95:
96: `ASM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL)'
97: A C statement (sans semicolon) to output to the stdio stream
98: STREAM any text necessary for declaring the name NAME of a
99: function which is being defined. This macro is responsible for
100: outputting the label definition (perhaps using
101: `ASM_OUTPUT_LABEL'). The argument DECL is the `FUNCTION_DECL'
102: tree node representing the function.
103:
104: If this macro is not defined, then the function name is defined
105: in the usual manner as a label (by means of `ASM_OUTPUT_LABEL').
106:
107: `ASM_DECLARE_FUNCTION_SIZE (STREAM, NAME, DECL)'
108: A C statement (sans semicolon) to output to the stdio stream
109: STREAM any text necessary for declaring the size of a function
110: which is being defined. The argument NAME is the name of the
111: function. The argument DECL is the `FUNCTION_DECL' tree node
112: representing the function.
113:
114: If this macro is not defined, then the function size is not
115: defined.
116:
117: `ASM_DECLARE_OBJECT_NAME (STREAM, NAME, DECL)'
118: A C statement (sans semicolon) to output to the stdio stream
119: STREAM any text necessary for declaring the name NAME of an
120: initialized variable which is being defined. This macro must
121: output the label definition (perhaps using `ASM_OUTPUT_LABEL').
122: The argument DECL is the `VAR_DECL' tree node representing the
123: variable.
124:
125: If this macro is not defined, then the variable name is defined
126: in the usual manner as a label (by means of `ASM_OUTPUT_LABEL').
127:
128: `ASM_GLOBALIZE_LABEL (STREAM, NAME)'
129: A C statement (sans semicolon) to output to the stdio stream
130: STREAM some commands that will make the label NAME global; that
131: is, available for reference from other files. Use the expression
132: `assemble_name (STREAM, NAME)' to output the name itself; before
133: and after that, output the additional assembler syntax for making
134: that name global, and a newline.
135:
136: `ASM_OUTPUT_EXTERNAL (STREAM, DECL, NAME)'
137: A C statement (sans semicolon) to output to the stdio stream
138: STREAM any text necessary for declaring the name of an external
139: symbol named NAME which is referenced in this compilation but not
140: defined. The value of DECL is the tree node for the declaration.
141:
142: This macro need not be defined if it does not need to output
143: anything. The GNU assembler and most Unix assemblers don't
144: require anything.
145:
146: `ASM_OUTPUT_EXTERNAL_LIBCALL (STREAM, SYMREF)'
147: A C statement (sans semicolon) to output on STREAM an assembler
148: pseudo-op to declare a library function name external. The name
149: of the library function is given by SYMREF, which has type `rtx'
150: and is a `symbol_ref'.
151:
152: This macro need not be defined if it does not need to output
153: anything. The GNU assembler and most Unix assemblers don't
154: require anything.
155:
156: `ASM_OUTPUT_LABELREF (STREAM, NAME)'
157: A C statement (sans semicolon) to output to the stdio stream
158: STREAM a reference in assembler syntax to a label named NAME.
159: This should add `_' to the front of the name, if that is
160: customary on your operating system, as it is in most Berkeley Unix
161: systems. This macro is used in `assemble_name'.
162:
163: `ASM_OUTPUT_LABELREF_AS_INT (FILE, LABEL)'
164: Define this macro for systems that use the program `collect2'.
165: The definition should be a C statement to output a word containing
166: a reference to the label LABEL.
167:
168: `ASM_GENERATE_INTERNAL_LABEL (STRING, PREFIX, NUM)'
169: A C statement to store into the string STRING a label whose name
170: is made from the string PREFIX and the number NUM.
171:
172: This string, when output subsequently by `ASM_OUTPUT_LABELREF',
173: should produce the same output that `ASM_OUTPUT_INTERNAL_LABEL'
174: would produce with the same PREFIX and NUM.
175:
176: `ASM_OUTPUT_INTERNAL_LABEL (STREAM, PREFIX, NUM)'
177: A C statement to output to the stdio stream STREAM a label whose
178: name is made from the string PREFIX and the number NUM. These
179: labels are used for internal purposes, and there is no reason for
180: them to appear in the symbol table of the object file. On many
181: systems, the letter `L' at the beginning of a label has this
182: effect. The usual definition of this macro is as follows:
183:
184: fprintf (STREAM, "L%s%d:\n", PREFIX, NUM)
185:
186: `ASM_FORMAT_PRIVATE_NAME (OUTVAR, NAME, NUMBER)'
187: A C expression to assign to OUTVAR (which is a variable of type
188: `char *') a newly allocated string made from the string NAME and
189: the number NUMBER, with some suitable punctuation added. Use
190: `alloca' to get space for the string.
191:
192: This string will be used as the argument to `ASM_OUTPUT_LABELREF'
193: to produce an assembler label for an internal static variable
194: whose name is NAME. Therefore, the string must be such as to
195: result in valid assembler code. The argument NUMBER is different
196: each time this macro is executed; it prevents conflicts between
197: similarly-named internal static variables in different scopes.
198:
199: Ideally this string should not be a valid C identifier, to
200: prevent any conflict with the user's own symbols. Most
201: assemblers allow periods or percent signs in assembler symbols;
202: putting at least one of these between the name and the number
203: will suffice.
204:
205: `OBJC_GEN_METHOD_LABEL (BUF, IS_INST, CLASS_NAME, CAT_NAME, SEL_NAME)'
206: Define this macro to override the default assembler names used for
207: Objective C methods.
208:
209: The default name is a unique method number followed by the name
210: of the class (e.g. `_1_Foo'). For methods in categories, the
211: name of the category is also included in the assembler name (e.g.
212: `_1_Foo_Bar').
213:
214: These names are safe on most systems, but make debugging
215: difficult since the method's selector is not present in the name.
216: Therefore, particular systems define other ways of computing
217: names.
218:
219: BUF is a buffer in which to store the name (256 chars max);
220: IS_INST specifies whether the method is an instance method or a
221: class method; CLASS_NAME is the name of the class; CAT_NAME is
222: the name of the category (or NULL if the method is not in a
223: category); and SEL_NAME is the name of the selector.
224:
225: On systems where the assembler can handle quoted names, you can
226: use this macro to provide more human-readable names.
227:
228:
229: File: gcc.info, Node: Constructor Output, Next: Instruction Output, Prev: Label Output, Up: Assembler Format
230:
231: Output of Initialization Routines
232: ---------------------------------
233:
234: The compiled code for certain languages includes "constructors"
235: (also called "initialization routines")--functions to initialize data
236: in the program when the program is started. These functions need to
237: be called before the program is "started"--that is to say, before
238: `main' is called.
239:
240: Compiling some languages generates "destructors" (also called
241: "termination routines") that should be called when the program
242: terminates.
243:
244: To make the initialization and termination functions work, the
245: compiler must output something in the assembler code to cause those
246: functions to be called at the appropriate time. When you port the
247: compiler to a new system, you need to specify what assembler code is
248: needed to do this.
249:
250: Here are the two macros you should define if necessary:
251:
252: `ASM_OUTPUT_CONSTRUCTOR (STREAM, NAME)'
253: Define this macro as a C statement to output on the stream STREAM
254: the assembler code to arrange to call the function named NAME at
255: initialization time.
256:
257: Assume that NAME is the name of a C function generated
258: automatically by the compiler. This function takes no arguments.
259: Use the function `assemble_name' to output the name NAME; this
260: performs any system-specific syntactic transformations such as
261: adding an underscore.
262:
263: If you don't define this macro, nothing special is output to
264: arrange to call the function. This is correct when the function
265: will be called in some other manner--for example, by means of the
266: `collect' program, which looks through the symbol table to find
267: these functions by their names. If you want to use `collect',
268: then you need to arrange for it to be built and installed and
269: used on your system.
270:
271: `ASM_OUTPUT_DESTRUCTOR (STREAM, NAME)'
272: This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination
273: functions rather than initialization functions.
274:
275:
276: File: gcc.info, Node: Instruction Output, Next: Dispatch Tables, Prev: Constructor Output, Up: Assembler Format
277:
278: Output of Assembler Instructions
279: --------------------------------
280:
281: `REGISTER_NAMES'
282: A C initializer containing the assembler's names for the machine
283: registers, each one as a C string constant. This is what
284: translates register numbers in the compiler into assembler
285: language.
286:
287: `ADDITIONAL_REGISTER_NAMES'
288: If defined, a C initializer for an array of structures containing
289: a name and a register number. This macro defines additional
290: names for hard registers, thus allowing the `asm' option in
291: declarations to refer to registers using alternate names.
292:
293: `ASM_OUTPUT_OPCODE (STREAM, PTR)'
294: Define this macro if you are using an unusual assembler that
295: requires different names for the machine instructions.
296:
297: The definition is a C statement or statements which output an
298: assembler instruction opcode to the stdio stream STREAM. The
299: macro-operand PTR is a variable of type `char *' which points to
300: the opcode name in its "internal" form--the form that is written
301: in the machine description. The definition should output the
302: opcode name to STREAM, performing any translation you desire, and
303: increment the variable PTR to point at the end of the opcode so
304: that it will not be output twice.
305:
306: In fact, your macro definition may process less than the entire
307: opcode name, or more than the opcode name; but if you want to
308: process text that includes `%'-sequences to substitute operands,
309: you must take care of the substitution yourself. Just be sure to
310: increment PTR over whatever text should not be output normally.
311:
312: If you need to look at the operand values, they can be found as
313: the elements of `recog_operand'.
314:
315: If the macro definition does nothing, the instruction is output
316: in the usual way.
317:
318: `FINAL_PRESCAN_INSN (INSN, OPVEC, NOPERANDS)'
319: If defined, a C statement to be executed just prior to the output
320: of assembler code for INSN, to modify the extracted operands so
321: they will be output differently.
322:
323: Here the argument OPVEC is the vector containing the operands
324: extracted from INSN, and NOPERANDS is the number of elements of
325: the vector which contain meaningful data for this insn. The
326: contents of this vector are what will be used to convert the insn
327: template into assembler code, so you can change the assembler
328: output by changing the contents of the vector.
329:
330: This macro is useful when various assembler syntaxes share a
331: single file of instruction patterns; by defining this macro
332: differently, you can cause a large class of instructions to be
333: output differently (such as with rearranged operands).
334: Naturally, variations in assembler syntax affecting individual
335: insn patterns ought to be handled by writing conditional output
336: routines in those patterns.
337:
338: If this macro is not defined, it is equivalent to a null
339: statement.
340:
341: `PRINT_OPERAND (STREAM, X, CODE)'
342: A C compound statement to output to stdio stream STREAM the
343: assembler syntax for an instruction operand X. X is an RTL
344: expression.
345:
346: CODE is a value that can be used to specify one of several ways
347: of printing the operand. It is used when identical operands must
348: be printed differently depending on the context. CODE comes from
349: the `%' specification that was used to request printing of the
350: operand. If the specification was just `%DIGIT' then CODE is 0;
351: if the specification was `%LTR DIGIT' then CODE is the ASCII code
352: for LTR.
353:
354: If X is a register, this macro should print the register's name.
355: The names can be found in an array `reg_names' whose type is
356: `char *[]'. `reg_names' is initialized from `REGISTER_NAMES'.
357:
358: When the machine description has a specification `%PUNCT' (a `%'
359: followed by a punctuation character), this macro is called with a
360: null pointer for X and the punctuation character for CODE.
361:
362: `PRINT_OPERAND_PUNCT_VALID_P (CODE)'
363: A C expression which evaluates to true if CODE is a valid
364: punctuation character for use in the `PRINT_OPERAND' macro. If
365: `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
366: punctuation characters (except for the standard one, `%') are used
367: in this way.
368:
369: `PRINT_OPERAND_ADDRESS (STREAM, X)'
370: A C compound statement to output to stdio stream STREAM the
371: assembler syntax for an instruction operand that is a memory
372: reference whose address is X. X is an RTL expression.
373:
374: On some machines, the syntax for a symbolic address depends on the
375: section that the address refers to. On these machines, define
376: the macro `ENCODE_SECTION_INFO' to store the information into the
377: `symbol_ref', and then check for it here. *Note Assembler
378: Format::.
379:
380: `DBR_OUTPUT_SEQEND(FILE)'
381: A C statement, to be executed after all slot-filler instructions
382: have been output. If necessary, call `dbr_sequence_length' to
383: determine the number of slots filled in a sequence (zero if not
384: currently outputting a sequence), to decide how many no-ops to
385: output, or whatever.
386:
387: Don't define this macro if it has nothing to do, but it is
388: helpful in reading assembly output if the extent of the delay
389: sequence is made explicit (e.g. with white space).
390:
391: Note that output routines for instructions with delay slots must
392: be prepared to deal with not being output as part of a sequence
393: (i.e. when the scheduling pass is not run, or when no slot
394: fillers could be found.) The variable `final_sequence' is null
395: when not processing a sequence, otherwise it contains the
396: `sequence' rtx being output.
397:
398: `REGISTER_PREFIX'
399: `LOCAL_LABEL_PREFIX'
400: `USER_LABEL_PREFIX'
401: `IMMEDIATE_PREFIX'
402: If defined, C string expressions to be used for the `%R', `%L',
403: `%U', and `%I' options of `asm_fprintf' (see `final.c'). These
404: are useful when a single `md' file must support multiple
405: assembler formats. In that case, the various `tm.h' files can
406: define these macros differently.
407:
408: `ASM_OUTPUT_REG_PUSH (STREAM, REGNO)'
409: A C expression to output to STREAM some assembler code which will
410: push hard register number REGNO onto the stack. The code need
411: not be optimal, since this macro is used only when profiling.
412:
413: `ASM_OUTPUT_REG_POP (STREAM, REGNO)'
414: A C expression to output to STREAM some assembler code which will
415: pop hard register number REGNO off of the stack. The code need
416: not be optimal, since this macro is used only when profiling.
417:
418:
419: File: gcc.info, Node: Dispatch Tables, Next: Alignment Output, Prev: Instruction Output, Up: Assembler Format
420:
421: Output of Dispatch Tables
422: -------------------------
423:
424: `ASM_OUTPUT_ADDR_DIFF_ELT (STREAM, VALUE, REL)'
425: This macro should be provided on machines where the addresses in
426: a dispatch table are relative to the table's own address.
427:
428: The definition should be a C statement to output to the stdio
429: stream STREAM an assembler pseudo-instruction to generate a
430: difference between two labels. VALUE and REL are the numbers of
431: two internal labels. The definitions of these labels are output
432: using `ASM_OUTPUT_INTERNAL_LABEL', and they must be printed in
433: the same way here. For example,
434:
435: fprintf (STREAM, "\t.word L%d-L%d\n",
436: VALUE, REL)
437:
438: `ASM_OUTPUT_ADDR_VEC_ELT (STREAM, VALUE)'
439: This macro should be provided on machines where the addresses in
440: a dispatch table are absolute.
441:
442: The definition should be a C statement to output to the stdio
443: stream STREAM an assembler pseudo-instruction to generate a
444: reference to a label. VALUE is the number of an internal label
445: whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'.
446: For example,
447:
448: fprintf (STREAM, "\t.word L%d\n", VALUE)
449:
450: `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)'
451: Define this if the label before a jump-table needs to be output
452: specially. The first three arguments are the same as for
453: `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the
454: jump-table which follows (a `jump_insn' containing an `addr_vec'
455: or `addr_diff_vec').
456:
457: This feature is used on system V to output a `swbeg' statement
458: for the table.
459:
460: If this macro is not defined, these labels are output with
461: `ASM_OUTPUT_INTERNAL_LABEL'.
462:
463: `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
464: Define this if something special must be output at the end of a
465: jump-table. The definition should be a C statement to be executed
466: after the assembler code for the table is written. It should
467: write the appropriate code to stdio stream STREAM. The argument
468: TABLE is the jump-table insn, and NUM is the label-number of the
469: preceding label.
470:
471: If this macro is not defined, nothing special is output at the
472: end of the jump-table.
473:
474:
475: File: gcc.info, Node: Alignment Output, Prev: Dispatch Tables, Up: Assembler Format
476:
477: Assembler Commands for Alignment
478: --------------------------------
479:
480: `ASM_OUTPUT_ALIGN_CODE (FILE)'
481: A C expression to output text to align the location counter in
482: the way that is desirable at a point in the code that is reached
483: only by jumping.
484:
485: This macro need not be defined if you don't want any special
486: alignment to be done at such a time. Most machine descriptions
487: do not currently define the macro.
488:
489: `ASM_OUTPUT_LOOP_ALIGN (FILE)'
490: A C expression to output text to align the location counter in
491: the way that is desirable at the beginning of a loop.
492:
493: This macro need not be defined if you don't want any special
494: alignment to be done at such a time. Most machine descriptions
495: do not currently define the macro.
496:
497: `ASM_OUTPUT_SKIP (STREAM, NBYTES)'
498: A C statement to output to the stdio stream STREAM an assembler
499: instruction to advance the location counter by NBYTES bytes.
500: Those bytes should be zero when loaded. NBYTES will be a C
501: expression of type `int'.
502:
503: `ASM_NO_SKIP_IN_TEXT'
504: Define this macro if `ASM_OUTPUT_SKIP' should not be used in the
505: text section because it fails put zeros in the bytes that are
506: skipped. This is true on many Unix systems, where the pseudo--op
507: to skip bytes produces no-op instructions rather than zeros when
508: used in the text section.
509:
510: `ASM_OUTPUT_ALIGN (STREAM, POWER)'
511: A C statement to output to the stdio stream STREAM an assembler
512: command to advance the location counter to a multiple of 2 to the
513: POWER bytes. POWER will be a C expression of type `int'.
514:
515:
516: File: gcc.info, Node: Debugging Info, Next: Cross-compilation, Prev: Assembler Format, Up: Machine Macros
517:
518: Controlling Debugging Information Format
519: ========================================
520:
521: `DBX_REGISTER_NUMBER (REGNO)'
522: A C expression that returns the DBX register number for the
523: compiler register number REGNO. In simple cases, the value of
524: this expression may be REGNO itself. But sometimes there are some
525: registers that the compiler knows about and DBX does not, or vice
526: versa. In such cases, some register may need to have one number
527: in the compiler and another for DBX.
528:
529: If two registers have consecutive numbers inside GNU CC, and they
530: can be used as a pair to hold a multiword value, then they *must*
531: have consecutive numbers after renumbering with
532: `DBX_REGISTER_NUMBER'. Otherwise, debuggers will be unable to
533: access such a pair, because they expect register pairs to be
534: consecutive in their own numbering scheme.
535:
536: If you find yourself defining `DBX_REGISTER_NUMBER' in way that
537: does not preserve register pairs, then what you must do instead is
538: redefine the actual register numbering scheme.
539:
540: `DBX_DEBUGGING_INFO'
541: Define this macro if GNU CC should produce debugging output for
542: DBX in response to the `-g' option.
543:
544: `SDB_DEBUGGING_INFO'
545: Define this macro if GNU CC should produce COFF-style debugging
546: output for SDB in response to the `-g' option.
547:
548: `DWARF_DEBUGGING_INFO'
549: Define this macro if GNU CC should produce dwarf format debugging
550: output in response to the `-g' option.
551:
552: `DEFAULT_GDB_EXTENSIONS'
553: Define this macro to control whether GNU CC should by default
554: generate GDB's extended version of DBX debugging information
555: (assuming DBX-format debugging information is enabled at all).
556: If you don't define the macro, the default is 1: always generate
557: the extended information.
558:
559: `DEBUG_SYMS_TEXT'
560: Define this macro if all `.stabs' commands should be output while
561: in the text section.
562:
563: `DEBUGGER_AUTO_OFFSET (X)'
564: A C expression that returns the integer offset value for an
565: automatic variable having address X (an RTL expression). The
566: default computation assumes that X is based on the frame-pointer
567: and gives the offset from the frame-pointer. This is required
568: for targets that produce debugging output for DBX or COFF-style
569: debugging output for SDB and allow the frame-pointer to be
570: eliminated when the `-g' options is used.
571:
572: `DEBUGGER_ARG_OFFSET (OFFSET, X)'
573: A C expression that returns the integer offset value for an
574: argument having address X (an RTL expression). The nominal
575: offset is OFFSET.
576:
577: `ASM_STABS_OP'
578: A C string constant naming the assembler pseudo op to use instead
579: of `.stabs' to define an ordinary debugging symbol. If you don't
580: define this macro, `.stabs' is used. This macro applies only to
581: DBX debugging information format.
582:
583: `ASM_STABD_OP'
584: A C string constant naming the assembler pseudo op to use instead
585: of `.stabd' to define a debugging symbol whose value is the
586: current location. If you don't define this macro, `.stabd' is
587: used. This macro applies only to DBX debugging information
588: format.
589:
590: `ASM_STABN_OP'
591: A C string constant naming the assembler pseudo op to use instead
592: of `.stabn' to define a debugging symbol with no name. If you
593: don't define this macro, `.stabn' is used. This macro applies
594: only to DBX debugging information format.
595:
596: `PUT_SDB_...'
597: Define these macros to override the assembler syntax for the
598: special SDB assembler directives. See `sdbout.c' for a list of
599: these macros and their arguments. If the standard syntax is
600: used, you need not define them yourself.
601:
602: `SDB_DELIM'
603: Some assemblers do not support a semicolon as a delimiter, even
604: between SDB assembler directives. In that case, define this
605: macro to be the delimiter to use (usually `\n'). It is not
606: necessary to define a new set of `PUT_SDB_OP' macros if this is
607: the only change required.
608:
609: `SDB_GENERATE_FAKE'
610: Define this macro to override the usual method of constructing a
611: dummy name for anonymous structure and union types. See
612: `sdbout.c' for more information.
613:
614: `SDB_ALLOW_UNKNOWN_REFERENCES'
615: Define this macro to allow references to unknown structure,
616: union, or enumeration tags to be emitted. Standard COFF does not
617: allow handling of unknown references, MIPS ECOFF has support for
618: it.
619:
620: `SDB_ALLOW_FORWARD_REFERENCES'
621: Define this macro to allow references to structure, union, or
622: enumeration tags that have not yet been seen to be handled. Some
623: assemblers choke if forward tags are used, while some require it.
624:
625: `DBX_NO_XREFS'
626: Define this macro if DBX on your system does not support the
627: construct `xsTAGNAME'. On some systems, this construct is used to
628: describe a forward reference to a structure named TAGNAME. On
629: other systems, this construct is not supported at all.
630:
631: `DBX_CONTIN_LENGTH'
632: A symbol name in DBX-format debugging information is normally
633: continued (split into two separate `.stabs' directives) when it
634: exceeds a certain length (by default, 80 characters). On some
635: operating systems, DBX requires this splitting; on others,
636: splitting must not be done. You can inhibit splitting by
637: defining this macro with the value zero. You can override the
638: default splitting-length by defining this macro as an expression
639: for the length you desire.
640:
641: `DBX_CONTIN_CHAR'
642: Normally continuation is indicated by adding a `\' character to
643: the end of a `.stabs' string when a continuation follows. To use
644: a different character instead, define this macro as a character
645: constant for the character you want to use. Do not define this
646: macro if backslash is correct for your system.
647:
648: `DBX_STATIC_STAB_DATA_SECTION'
649: Define this macro if it is necessary to go to the data section
650: before outputting the `.stabs' pseudo-op for a non-global static
651: variable.
652:
653: `DBX_LBRAC_FIRST'
654: Define this macro if the `N_LBRAC' symbol for a block should
655: precede the debugging information for variables and functions
656: defined in that block. Normally, in DBX format, the `N_LBRAC'
657: symbol comes first.
658:
659: `DBX_FUNCTION_FIRST'
660: Define this macro if the DBX information for a function and its
661: arguments should precede the assembler code for the function.
662: Normally, in DBX format, the debugging information entirely
663: follows the assembler code.
664:
665: `DBX_OUTPUT_FUNCTION_END (STREAM, FUNCTION)'
666: Define this macro if the target machine requires special output
667: at the end of the debugging information for a function. The
668: definition should be a C statement (sans semicolon) to output the
669: appropriate information to STREAM. FUNCTION is the
670: `FUNCTION_DECL' node for the function.
671:
672: `DBX_OUTPUT_STANDARD_TYPES (SYMS)'
673: Define this macro if you need to control the order of output of
674: the standard data types at the beginning of compilation. The
675: argument SYMS is a `tree' which is a chain of all the predefined
676: global symbols, including names of data types.
677:
678: Normally, DBX output starts with definitions of the types for
679: integers and characters, followed by all the other predefined
680: types of the particular language in no particular order.
681:
682: On some machines, it is necessary to output different particular
683: types first. To do this, define `DBX_OUTPUT_STANDARD_TYPES' to
684: output those symbols in the necessary order. Any predefined
685: types that you don't explicitly output will be output afterward
686: in no particular order.
687:
688: Be careful not to define this macro so that it works only for C.
689: There are no global variables to access most of the built-in
690: types, because another language may have another set of types.
691: The way to output a particular type is to look through SYMS to
692: see if you can find it. Here is an example:
693:
694: {
695: tree decl;
696: for (decl = syms; decl; decl = TREE_CHAIN (decl))
697: if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "long int"))
698: dbxout_symbol (decl);
699: ...
700: }
701:
702: This does nothing if the expected type does not exist.
703:
704: See the function `init_decl_processing' in source file `c-decl.c'
705: to find the names to use for all the built-in C types.
706:
707: `DBX_OUTPUT_MAIN_SOURCE_FILENAME (STREAM, NAME)'
708: A C statement to output DBX debugging information to the stdio
709: stream STREAM which indicates that file NAME is the main source
710: file--the file specified as the input file for compilation. This
711: macro is called only once, at the beginning of compilation.
712:
713: This macro need not be defined if the standard form of output for
714: DBX debugging information is appropriate.
715:
716: `DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (STREAM, NAME)'
717: A C statement to output DBX debugging information to the stdio
718: stream STREAM which indicates that the current directory during
719: compilation is named NAME.
720:
721: This macro need not be defined if the standard form of output for
722: DBX debugging information is appropriate.
723:
724: `DBX_OUTPUT_MAIN_SOURCE_FILE_END (STREAM, NAME)'
725: A C statement to output DBX debugging information at the end of
726: compilation of the main source file NAME.
727:
728: If you don't define this macro, nothing special is output at the
729: end of compilation, which is correct for most machines.
730:
731: `DBX_OUTPUT_SOURCE_FILENAME (STREAM, NAME)'
732: A C statement to output DBX debugging information to the stdio
733: stream STREAM which indicates that file NAME is the current source
734: file. This output is generated each time input shifts to a
735: different source file as a result of `#include', the end of an
736: included file, or a `#line' command.
737:
738: This macro need not be defined if the standard form of output for
739: DBX debugging information is appropriate.
740:
741:
742: File: gcc.info, Node: Cross-compilation, Next: Misc, Prev: Debugging INfo, Up: Machine Macros
743:
744: Cross Compilation and Floating Point Format
745: ===========================================
746:
747: While all modern machines use 2's complement representation for
748: integers, there are a variety of representations for floating point
749: numbers. This means that in a cross-compiler the representation of
750: floating point numbers in the compiled program may be different from
751: that used in the machine doing the compilation.
752:
753: Because different representation systems may offer different
754: amounts of range and precision, the cross compiler cannot safely use
755: the host machine's floating point arithmetic. Therefore, floating
756: point constants must be represented in the target machine's format.
757: This means that the cross compiler cannot use `atof' to parse a
758: floating point constant; it must have its own special routine to use
759: instead. Also, constant folding must emulate the target machine's
760: arithmetic (or must not be done at all).
761:
762: The macros in the following table should be defined only if you are
763: cross compiling between different floating point formats.
764:
765: Otherwise, don't define them. Then default definitions will be set
766: up which use `double' as the data type, `==' to test for equality, etc.
767:
768: You don't need to worry about how many times you use an operand of
769: any of these macros. The compiler never uses operands which have side
770: effects.
771:
772: `REAL_VALUE_TYPE'
773: A macro for the C data type to be used to hold a floating point
774: value in the target machine's format. Typically this would be a
775: `struct' containing an array of `int'.
776:
777: `REAL_VALUES_EQUAL (X, Y)'
778: A macro for a C expression which compares for equality the two
779: values, X and Y, both of type `REAL_VALUE_TYPE'.
780:
781: `REAL_VALUES_LESS (X, Y)'
782: A macro for a C expression which tests whether X is less than Y,
783: both values being of type `REAL_VALUE_TYPE' and interpreted as
784: floating point numbers in the target machine's representation.
785:
786: `REAL_VALUE_LDEXP (X, SCALE)'
787: A macro for a C expression which performs the standard library
788: function `ldexp', but using the target machine's floating point
789: representation. Both X and the value of the expression have type
790: `REAL_VALUE_TYPE'. The second argument, SCALE, is an integer.
791:
792: `REAL_VALUE_FIX (X)'
793: A macro whose definition is a C expression to convert the
794: target-machine floating point value X to a signed integer. X has
795: type `REAL_VALUE_TYPE'.
796:
797: `REAL_VALUE_UNSIGNED_FIX (X)'
798: A macro whose definition is a C expression to convert the
799: target-machine floating point value X to an unsigned integer. X
800: has type `REAL_VALUE_TYPE'.
801:
802: `REAL_VALUE_FIX_TRUNCATE (X)'
803: A macro whose definition is a C expression to convert the
804: target-machine floating point value X to a signed integer,
805: rounding toward 0. X has type `REAL_VALUE_TYPE'.
806:
807: `REAL_VALUE_UNSIGNED_FIX_TRUNCATE (X)'
808: A macro whose definition is a C expression to convert the
809: target-machine floating point value X to an unsigned integer,
810: rounding toward 0. X has type `REAL_VALUE_TYPE'.
811:
812: `REAL_VALUE_ATOF (STRING)'
813: A macro for a C expression which converts STRING, an expression
814: of type `char *', into a floating point number in the target
815: machine's representation. The value has type `REAL_VALUE_TYPE'.
816:
817: `REAL_INFINITY'
818: Define this macro if infinity is a possible floating point value,
819: and therefore division by 0 is legitimate.
820:
821: `REAL_VALUE_ISINF (X)'
822: A macro for a C expression which determines whether X, a floating
823: point value, is infinity. The value has type `int'. By default,
824: this is defined to call `isinf'.
825:
826: `REAL_VALUE_ISNAN (X)'
827: A macro for a C expression which determines whether X, a floating
828: point value, is a "nan" (not-a-number). The value has type
829: `int'. By default, this is defined to call `isnan'.
830:
831: Define the following additional macros if you want to make floating
832: point constant folding work while cross compiling. If you don't
833: define them, cross compilation is still possible, but constant folding
834: will not happen for floating point values.
835:
836: `REAL_ARITHMETIC (OUTPUT, CODE, X, Y)'
837: A macro for a C statement which calculates an arithmetic
838: operation of the two floating point values X and Y, both of type
839: `REAL_VALUE_TYPE' in the target machine's representation, to
840: produce a result of the same type and representation which is
841: stored in OUTPUT (which will be a variable).
842:
843: The operation to be performed is specified by CODE, a tree code
844: which will always be one of the following: `PLUS_EXPR',
845: `MINUS_EXPR', `MULT_EXPR', `RDIV_EXPR', `MAX_EXPR', `MIN_EXPR'.
846:
847: The expansion of this macro is responsible for checking for
848: overflow. If overflow happens, the macro expansion should
849: execute the statement `return 0;', which indicates the inability
850: to perform the arithmetic operation requested.
851:
852: `REAL_VALUE_NEGATE (X)'
853: A macro for a C expression which returns the negative of the
854: floating point value X. Both X and the value of the expression
855: have type `REAL_VALUE_TYPE' and are in the target machine's
856: floating point representation.
857:
858: There is no way for this macro to report overflow, since overflow
859: can't happen in the negation operation.
860:
861: `REAL_VALUE_TRUNCATE (X)'
862: A macro for a C expression which converts the double-precision
863: floating point value X to single-precision.
864:
865: Both X and the value of the expression have type
866: `REAL_VALUE_TYPE' and are in the target machine's floating point
867: representation. However, the value should have an appropriate bit
868: pattern to be output properly as a single-precision floating
869: constant.
870:
871: There is no way for this macro to report overflow.
872:
873: `REAL_VALUE_TO_INT (LOW, HIGH, X)'
874: A macro for a C expression which converts a floating point value
875: X into a double-precision integer which is then stored into LOW
876: and HIGH, two variables of type INT.
877:
878: `REAL_VALUE_FROM_INT (X, LOW, HIGH)'
879: A macro for a C expression which converts a double-precision
880: integer found in LOW and HIGH, two variables of type INT, into a
881: floating point value which is then stored into X.
882:
883:
884: File: gcc.info, Node: Misc, Prev: Cross-compilation, Up: Machine Macros
885:
886: Miscellaneous Parameters
887: ========================
888:
889: `PREDICATE_CODES'
890: Optionally define this if you have added predicates to
891: `MACHINE.c'. This macro is called within an initializer of an
892: array of structures. The first field in the structure is the
893: name of a predicate and the second field is an arrary of rtl
894: codes. For each predicate, list all rtl codes that can be in
895: expressions matched by the predicate. The list should have a
896: trailing comma. Here is an example of two entries in the list
897: for a typical RISC machine:
898:
899: #define PREDICATE_CODES \
900: {"gen_reg_rtx_operand", {SUBREG, REG}}, \
901: {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}},
902:
903: Defining this macro does not affect the generated code (however,
904: incorrect definitions that omit an rtl code that may be matched
905: by the predicate can cause the compiler to malfunction).
906: Instead, it allows the table built by `genrecog' to be more
907: compact and efficient, thus speeding up the compiler. The most
908: important predicates to include in the list specified by this
909: macro are thoses used in the most insn patterns.
910:
911: `CASE_VECTOR_MODE'
912: An alias for a machine mode name. This is the machine mode that
913: elements of a jump-table should have.
914:
915: `CASE_VECTOR_PC_RELATIVE'
916: Define this macro if jump-tables should contain relative
917: addresses.
918:
919: `CASE_DROPS_THROUGH'
920: Define this if control falls through a `case' insn when the index
921: value is out of range. This means the specified default-label is
922: actually ignored by the `case' insn proper.
923:
924: `BYTE_LOADS_ZERO_EXTEND'
925: Define this macro if an instruction to load a value narrower than
926: a word from memory into a register also zero-extends the value to
927: the whole register.
928:
929: `IMPLICIT_FIX_EXPR'
930: An alias for a tree code that should be used by default for
931: conversion of floating point values to fixed point. Normally,
932: `FIX_ROUND_EXPR' is used.
933:
934: `FIXUNS_TRUNC_LIKE_FIX_TRUNC'
935: Define this macro if the same instructions that convert a floating
936: point number to a signed fixed point number also convert validly
937: to an unsigned one.
938:
939: `EASY_DIV_EXPR'
940: An alias for a tree code that is the easiest kind of division to
941: compile code for in the general case. It may be
942: `TRUNC_DIV_EXPR', `FLOOR_DIV_EXPR', `CEIL_DIV_EXPR' or
943: `ROUND_DIV_EXPR'. These four division operators differ in how
944: they round the result to an integer. `EASY_DIV_EXPR' is used
945: when it is permissible to use any of those kinds of division and
946: the choice should be made on the basis of efficiency.
947:
948: `MOVE_MAX'
949: The maximum number of bytes that a single instruction can move
950: quickly from memory to memory.
951:
952: `SHIFT_COUNT_TRUNCATED'
953: Defining this macro causes the compiler to omit a sign-extend,
954: zero-extend, or bitwise `and' instruction that truncates the
955: count of a shift operation to a width equal to the number of bits
956: needed to represent the size of the object being shifted. On
957: machines that have instructions that act on bitfields at variable
958: positions, including `bit test' instructions, defining
959: `SHIFT_COUNT_TRUNCATED' also causes truncation not to be applied
960: to these instructions.
961:
962: If both types of instructions truncate the count (for shifts) and
963: position (for bitfield operations), or if no variable-position
964: bitfield instructions exist, you should define this macro.
965:
966: However, on some machines, such as the 80386, truncation only
967: applies to shift operations and not bitfield operations. Do not
968: define `SHIFT_COUNT_TRUNCATED' on such machines. Instead, add
969: patterns to the `md' file that include the implied truncation of
970: the shift instructions.
971:
972: `TRULY_NOOP_TRUNCATION (OUTPREC, INPREC)'
973: A C expression which is nonzero if on this machine it is safe to
974: "convert" an integer of INPREC bits to one of OUTPREC bits (where
975: OUTPREC is smaller than INPREC) by merely operating on it as if
976: it had only OUTPREC bits.
977:
978: On many machines, this expression can be 1.
979:
980: It is reported that suboptimal code can result when
981: `TRULY_NOOP_TRUNCATION' returns 1 for a pair of sizes for modes
982: for which `MODES_TIEABLE_P' is 0. If this is the case, making
983: `TRULY_NOOP_TRUNCATION' return 0 in such cases may improve things.
984:
985: `STORE_FLAG_VALUE'
986: A C expression describing the value returned by a comparison
987: operator and stored by a store-flag instruction (`sCOND') when the
988: condition is true. This description must apply to *all* the
989: `sCOND' patterns and all the comparison operators.
990:
991: A value of 1 or -1 means that the instruction implementing the
992: comparison operator returns exactly 1 or -1 when the comparison
993: is true and 0 when the comparison is false. Otherwise, the value
994: indicates which bits of the result are guaranteed to be 1 when
995: the comparison is true. This value is interpreted in the mode of
996: the comparison operation, which is given by the mode of the first
997: operand in the `sCOND' pattern. Either the low bit or the sign
998: bit of `STORE_FLAG_VALUE' be on. Presently, only those bits are
999: used by the compiler.
1000:
1001: If `STORE_FLAG_VALUE' is neither 1 or -1, the compiler will
1002: generate code that depends only on the specified bits. It can
1003: also replace comparison operators with equivalent operations if
1004: they cause the required bits to be set, even if the remaining
1005: bits are undefined. For example, on a machine whose comparison
1006: operators return an `SImode' value and where `STORE_FLAG_VALUE'
1007: is defined as `0x80000000', saying that just the sign bit is
1008: relevant, the expression
1009:
1010: (ne:SI (and:SI X (const_int POWER-OF-2)) (const_int 0))
1011:
1012: can be converted to
1013:
1014: (ashift:SI X (const_int N))
1015:
1016: where N is the appropriate shift count to move the bit being
1017: tested into the sign bit.
1018:
1019: There is no way to describe a machine that always sets the
1020: low-order bit for a true value, but does not guarantee the value
1021: of any other bits, but we do not know of any machine that has
1022: such an instruction. If you are trying to port GNU CC to such a
1023: machine, include an instruction to perform a logical-and of the
1024: result with 1 in the pattern for the comparison operators and let
1025: us know (*note Bug Reporting::.).
1026:
1027: Often, a machine will have multiple instructions that obtain a
1028: value from a comparison (or the condition codes). Here are rules
1029: to guide the choice of value for `STORE_FLAG_VALUE', and hence
1030: the instructions to be used:
1031:
1032: * Use the shortest sequence that yields a valid definition for
1033: `STORE_FLAG_VALUE'. It is more efficent for the compiler to
1034: "normalize" the value (convert it to, e.g., 1 or 0) than for
1035: the comparison operators to do so because there may be
1036: opportunities to combine the normalization with other
1037: operations.
1038:
1039: * For equal-length sequences, use a value of 1 or -1, with -1
1040: being slightly preferred on machines with expensive jumps
1041: and 1 preferred on other machines.
1042:
1043: * As a second choice, choose a value of `0x80000001' if
1044: instructions exist that set both the sign and low-order bits
1045: but do not define the others.
1046:
1047: * Otherwise, use a value of `0x80000000'.
1048:
1049: You need not define `STORE_FLAG_VALUE' if the machine has no
1050: store-flag instructions.
1051:
1052: `Pmode'
1053: An alias for the machine mode for pointers. Normally the
1054: definition can be
1055:
1056: #define Pmode SImode
1057:
1058: `FUNCTION_MODE'
1059: An alias for the machine mode used for memory references to
1060: functions being called, in `call' RTL expressions. On most
1061: machines this should be `QImode'.
1062:
1063: `INTEGRATE_THRESHOLD (DECL)'
1064: A C expression for the maximum number of instructions above which
1065: the function DECL should not be inlined. DECL is a
1066: `FUNCTION_DECL' node.
1067:
1068: The default definition of this macro is 64 plus 8 times the
1069: number of arguments that the function accepts. Some people think
1070: a larger threshold should be used on RISC machines.
1071:
1072: `SCCS_DIRECTIVE'
1073: Define this if the preprocessor should ignore `#sccs' directives
1074: and print no error message.
1075:
1076: `HANDLE_PRAGMA (STREAM)'
1077: Define this macro if you want to implement any pragmas. If
1078: defined, it should be a C statement to be executed when `#pragma'
1079: is seen. The argument STREAM is the stdio input stream from
1080: which the source text can be read.
1081:
1082: It is generally a bad idea to implement new uses of `#pragma'.
1083: The only reason to define this macro is for compatibility with
1084: other compilers that do support `#pragma' for the sake of any user
1085: programs which already use it.
1086:
1087: `HAVE_VPRINTF'
1088: Define this if the library function `vprintf' is available on your
1089: system.
1090:
1091: `DOLLARS_IN_IDENTIFIERS'
1092: Define this macro to control use of the character `$' in
1093: identifier names. The value should be 0, 1, or 2. 0 means `$'
1094: is not allowed by default; 1 means it is allowed by default if
1095: `-traditional' is used; 2 means it is allowed by default provided
1096: `-ansi' is not used. 1 is the default; there is no need to
1097: define this macro in that case.
1098:
1099: `DEFAULT_MAIN_RETURN'
1100: Define this macro if the target system expects every program's
1101: `main' function to return a standard "success" value by default
1102: (if no other value is explicitly returned).
1103:
1104: The definition should be a C statement (sans semicolon) to
1105: generate the appropriate rtl instructions. It is used only when
1106: compiling the end of `main'.
1107:
1108: `HAVE_ATEXIT'
1109: Define this if the target system supports the function `atexit'
1110: from the ANSI C standard. If this is not defined, and
1111: `INIT_SECTION_ASM_OP' is not defined, a default `exit' function
1112: will be provided to support C++.
1113:
1114: `EXIT_BODY'
1115: Define this if your `exit' function needs to do something besides
1116: calling an external function `_cleanup' before terminating with
1117: `_exit'. The `EXIT_BODY' macro is only needed if netiher
1118: `HAVE_ATEXIT' nor `INIT_SECTION_ASM_OP' are defined.
1119:
1120:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.