2 /* Register Transfer Language (RTL) definitions for GNU C-Compiler
3 Copyright (C) 1987, 1991 Free Software Foundation, Inc.
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
24 #undef FFS /* Some systems predefine this symbol; don't let it interfere. */
25 #undef FLOAT /* Likewise. */
27 /* Register Transfer Language EXPRESSIONS CODES */
29 #define RTX_CODE enum rtx_code
32 #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) ENUM ,
33 #include "rtl.def" /* rtl expressions are documented here */
36 LAST_AND_UNUSED_RTX_CODE
}; /* A convenient way to get a value for
38 Assumes default enum value assignment. */
40 #define NUM_RTX_CODE ((int)LAST_AND_UNUSED_RTX_CODE)
41 /* The cast here, saves many elsewhere. */
43 extern int rtx_length
[];
44 #define GET_RTX_LENGTH(CODE) (rtx_length[(int)(CODE)])
46 extern char *rtx_name
[];
47 #define GET_RTX_NAME(CODE) (rtx_name[(int)(CODE)])
49 extern char *rtx_format
[];
50 #define GET_RTX_FORMAT(CODE) (rtx_format[(int)(CODE)])
52 extern char rtx_class
[];
53 #define GET_RTX_CLASS(CODE) (rtx_class[(int)(CODE)])
55 /* Common union for an element of an rtx. */
57 typedef union rtunion_def
63 struct rtvec_def
*rtvec
;
64 enum machine_mode rttype
;
67 /* RTL expression ("rtx"). */
69 typedef struct rtx_def
71 #ifdef ONLY_INT_FIELDS
74 /* The kind of expression this is. */
75 enum rtx_code code
: 16;
77 /* The kind of value the expression has. */
78 #ifdef ONLY_INT_FIELDS
81 enum machine_mode mode
: 8;
83 /* 1 in an INSN if it can alter flow of control
84 within this function. Not yet used! */
85 unsigned int jump
: 1;
86 /* 1 in an INSN if it can call another function. Not yet used! */
87 unsigned int call
: 1;
88 /* 1 in a MEM or REG if value of this expression will never change
89 during the current function, even though it is not
91 1 in a SYMBOL_REF if it addresses something in the per-function
93 1 in a CALL_INSN if it is a const call.
94 1 in a JUMP_INSN if it is a branch that should be annulled. Valid from
95 reorg until end of compilation; cleared before used. */
96 unsigned int unchanging
: 1;
97 /* 1 in a MEM expression if contents of memory are volatile.
98 1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL or BARRIER
100 1 in a REG expression if corresponds to a variable declared by the user.
101 0 for an internally generated temporary.
102 In a SYMBOL_REF, this flag is used for machine-specific purposes. */
103 unsigned int volatil
: 1;
104 /* 1 in a MEM referring to a field of a structure (not a union!).
105 0 if the MEM was a variable or the result of a * operator in C;
106 1 if it was the result of a . or -> operator (on a struct) in C.
107 1 in a REG if the register is used only in exit code a loop.
108 1 in a CODE_LABEL if the label is used for nonlocal gotos
109 and must not be deleted even if its count is zero.
110 1 in a LABEL_REF if this is a reference to a label outside the
112 1 in an INSN, JUMP_INSN, or CALL_INSN if this insn must be scheduled
113 together with the preceding insn. Valid only within sched.
114 1 in an INSN, JUMP_INSN, or CALL_INSN if insn is in a delay slot and
115 from the target of a branch. Valid from reorg until end of compilation;
116 cleared before used. */
117 unsigned int in_struct
: 1;
118 /* 1 if this rtx is used. This is used for copying shared structure.
119 See `unshare_all_rtl'.
120 In a REG, this is not needed for that purpose, and used instead
121 in `leaf_renumber_regs_insn'.
122 In a SYMBOL_REF, means that emit_library_call
123 has used it as the function. */
124 unsigned int used
: 1;
125 /* Nonzero if this rtx came from procedure integration.
126 In a REG, nonzero means this reg refers to the return value
127 of the current function. */
128 unsigned integrated
: 1;
129 /* The first element of the operands of this rtx.
130 The number of operands and their types are controlled
131 by the `code' field, according to rtl.def. */
135 #define NULL_RTX (rtx) 0
137 /* Define a generic NULL if one hasn't already been defined. */
144 #define NULL_PTR (char *) NULL
147 /* Define macros to access the `code' field of the rtx. */
149 #ifdef SHORT_ENUM_BUG
150 #define GET_CODE(RTX) ((enum rtx_code) ((RTX)->code))
151 #define PUT_CODE(RTX, CODE) ((RTX)->code = ((short) (CODE)))
153 #define GET_CODE(RTX) ((RTX)->code)
154 #define PUT_CODE(RTX, CODE) ((RTX)->code = (CODE))
157 #define GET_MODE(RTX) ((RTX)->mode)
158 #define PUT_MODE(RTX, MODE) ((RTX)->mode = (MODE))
160 #define RTX_INTEGRATED_P(RTX) ((RTX)->integrated)
161 #define RTX_UNCHANGING_P(RTX) ((RTX)->unchanging)
163 /* RTL vector. These appear inside RTX's when there is a need
164 for a variable number of things. The principle use is inside
165 PARALLEL expressions. */
167 typedef struct rtvec_def
{
168 unsigned num_elem
; /* number of elements */
172 #define NULL_RTVEC (rtvec) 0
174 #define GET_NUM_ELEM(RTVEC) ((RTVEC)->num_elem)
175 #define PUT_NUM_ELEM(RTVEC, NUM) ((RTVEC)->num_elem = (unsigned) NUM)
177 #define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[(I)].rtx)
179 /* 1 if X is a REG. */
181 #define REG_P(X) (GET_CODE (X) == REG)
183 /* 1 if X is a constant value that is an integer. */
185 #define CONSTANT_P(X) \
186 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
187 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE \
188 || GET_CODE (X) == CONST || GET_CODE (X) == HIGH)
190 /* General accessor macros for accessing the fields of an rtx. */
192 #define XEXP(RTX, N) ((RTX)->fld[N].rtx)
193 #define XINT(RTX, N) ((RTX)->fld[N].rtint)
194 #define XWINT(RTX, N) ((RTX)->fld[N].rtwint)
195 #define XSTR(RTX, N) ((RTX)->fld[N].rtstr)
196 #define XVEC(RTX, N) ((RTX)->fld[N].rtvec)
197 #define XVECLEN(RTX, N) ((RTX)->fld[N].rtvec->num_elem)
198 #define XVECEXP(RTX,N,M)((RTX)->fld[N].rtvec->elem[M].rtx)
200 /* ACCESS MACROS for particular fields of insns. */
202 /* Holds a unique number for each insn.
203 These are not necessarily sequentially increasing. */
204 #define INSN_UID(INSN) ((INSN)->fld[0].rtint)
206 /* Chain insns together in sequence. */
207 #define PREV_INSN(INSN) ((INSN)->fld[1].rtx)
208 #define NEXT_INSN(INSN) ((INSN)->fld[2].rtx)
210 /* The body of an insn. */
211 #define PATTERN(INSN) ((INSN)->fld[3].rtx)
213 /* Code number of instruction, from when it was recognized.
214 -1 means this instruction has not been recognized yet. */
215 #define INSN_CODE(INSN) ((INSN)->fld[4].rtint)
217 /* Set up in flow.c; empty before then.
218 Holds a chain of INSN_LIST rtx's whose first operands point at
219 previous insns with direct data-flow connections to this one.
220 That means that those insns set variables whose next use is in this insn.
221 They are always in the same basic block as this insn. */
222 #define LOG_LINKS(INSN) ((INSN)->fld[5].rtx)
224 /* 1 if insn has been deleted. */
225 #define INSN_DELETED_P(INSN) ((INSN)->volatil)
227 /* 1 if insn is a call to a const function. */
228 #define CONST_CALL_P(INSN) ((INSN)->unchanging)
230 /* 1 if insn is a branch that should not unconditionally execute its
231 delay slots, i.e., it is an annulled branch. */
232 #define INSN_ANNULLED_BRANCH_P(INSN) ((INSN)->unchanging)
234 /* 1 if insn is in a delay slot and is from the target of the branch. If
235 the branch insn has INSN_ANNULLED_BRANCH_P set, this insn should only be
236 executed if the branch is taken. For annulled branches with this bit
237 clear, the insn should be executed only if the branch is not taken. */
238 #define INSN_FROM_TARGET_P(INSN) ((INSN)->in_struct)
240 /* Holds a list of notes on what this insn does to various REGs.
241 It is a chain of EXPR_LIST rtx's, where the second operand
242 is the chain pointer and the first operand is the REG being described.
243 The mode field of the EXPR_LIST contains not a real machine mode
244 but a value that says what this note says about the REG:
245 REG_DEAD means that the value in REG dies in this insn (i.e., it is
246 not needed past this insn). If REG is set in this insn, the REG_DEAD
247 note may, but need not, be omitted.
248 REG_INC means that the REG is autoincremented or autodecremented.
249 REG_EQUIV describes the insn as a whole; it says that the
250 insn sets a register to a constant value or to be equivalent to
251 a memory address. If the
252 register is spilled to the stack then the constant value
253 should be substituted for it. The contents of the REG_EQUIV
254 is the constant value or memory address, which may be different
255 from the source of the SET although it has the same value.
256 REG_EQUAL is like REG_EQUIV except that the destination
257 is only momentarily equal to the specified rtx. Therefore, it
258 cannot be used for substitution; but it can be used for cse.
259 REG_RETVAL means that this insn copies the return-value of
260 a library call out of the hard reg for return values. This note
261 is actually an INSN_LIST and it points to the first insn involved
262 in setting up arguments for the call. flow.c uses this to delete
263 the entire library call when its result is dead.
264 REG_LIBCALL is the inverse of REG_RETVAL: it goes on the first insn
265 of the library call and points at the one that has the REG_RETVAL.
266 REG_WAS_0 says that the register set in this insn held 0 before the insn.
267 The contents of the note is the insn that stored the 0.
268 If that insn is deleted or patched to a NOTE, the REG_WAS_0 is inoperative.
269 The REG_WAS_0 note is actually an INSN_LIST, not an EXPR_LIST.
270 REG_NONNEG means that the register is always nonnegative during
271 the containing loop. This is used in branches so that decrement and
272 branch instructions terminating on zero can be matched. There must be
273 an insn pattern in the md file named `decrement_and_branch_until_zero'
274 or else this will never be added to any instructions.
275 REG_NO_CONFLICT means there is no conflict *after this insn*
276 between the register in the note and the destination of this insn.
277 REG_UNUSED identifies a register set in this insn and never used.
278 REG_CC_SETTER and REG_CC_USER link a pair of insns that set and use
279 CC0, respectively. Normally, these are required to be consecutive insns,
280 but we permit putting a cc0-setting insn in the delay slot of a branch
281 as long as only one copy of the insn exists. In that case, these notes
282 point from one to the other to allow code generation to determine what
283 any require information and to properly update CC_STATUS.
284 REG_LABEL points to a CODE_LABEL. Used by non-JUMP_INSNs to
285 say that the CODE_LABEL contained in the REG_LABEL note is used
287 REG_DEP_ANTI is used in LOG_LINKS which represent anti (write after read)
288 dependencies. REG_DEP_OUTPUT is used in LOG_LINKS which represent output
289 (write after write) dependencies. Data dependencies, which are the only
290 type of LOG_LINK created by flow, are represented by a 0 reg note kind. */
292 #define REG_NOTES(INSN) ((INSN)->fld[6].rtx)
294 /* Don't forget to change reg_note_name in rtl.c. */
295 enum reg_note
{ REG_DEAD
= 1, REG_INC
= 2, REG_EQUIV
= 3, REG_WAS_0
= 4,
296 REG_EQUAL
= 5, REG_RETVAL
= 6, REG_LIBCALL
= 7,
297 REG_NONNEG
= 8, REG_NO_CONFLICT
= 9, REG_UNUSED
= 10,
298 REG_CC_SETTER
= 11, REG_CC_USER
= 12, REG_LABEL
= 13,
299 REG_DEP_ANTI
= 14, REG_DEP_OUTPUT
= 15 };
301 /* Define macros to extract and insert the reg-note kind in an EXPR_LIST. */
302 #define REG_NOTE_KIND(LINK) ((enum reg_note) GET_MODE (LINK))
303 #define PUT_REG_NOTE_KIND(LINK,KIND) PUT_MODE(LINK, (enum machine_mode) (KIND))
305 /* Names for REG_NOTE's in EXPR_LIST insn's. */
307 extern char *reg_note_name
[];
308 #define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int)(MODE)])
310 /* The label-number of a code-label. The assembler label
311 is made from `L' and the label-number printed in decimal.
312 Label numbers are unique in a compilation. */
313 #define CODE_LABEL_NUMBER(INSN) ((INSN)->fld[3].rtint)
315 #define LINE_NUMBER NOTE
317 /* In a NOTE that is a line number, this is a string for the file name
318 that the line is in. */
320 #define NOTE_SOURCE_FILE(INSN) ((INSN)->fld[3].rtstr)
322 /* In a NOTE that is a line number, this is the line number.
323 Other kinds of NOTEs are identified by negative numbers here. */
324 #define NOTE_LINE_NUMBER(INSN) ((INSN)->fld[4].rtint)
326 /* Codes that appear in the NOTE_LINE_NUMBER field
327 for kinds of notes that are not line numbers. */
329 /* This note indicates the end of the real body of the function,
330 after moving the parms into their homes, etc. */
331 #define NOTE_INSN_FUNCTION_BEG 0
333 /* This note is used to get rid of an insn
334 when it isn't safe to patch the insn out of the chain. */
335 #define NOTE_INSN_DELETED -1
336 #define NOTE_INSN_BLOCK_BEG -2
337 #define NOTE_INSN_BLOCK_END -3
338 #define NOTE_INSN_LOOP_BEG -4
339 #define NOTE_INSN_LOOP_END -5
340 /* This kind of note is generated at the end of the function body,
341 just before the return insn or return label.
342 In an optimizing compilation it is deleted by the first jump optimization,
343 after enabling that optimizer to determine whether control can fall
344 off the end of the function body without a return statement. */
345 #define NOTE_INSN_FUNCTION_END -6
346 /* This kind of note is generated just after each call to `setjmp', et al. */
347 #define NOTE_INSN_SETJMP -7
348 /* Generated at the place in a loop that `continue' jumps to. */
349 #define NOTE_INSN_LOOP_CONT -8
350 /* Generated at the start of a duplicated exit test. */
351 #define NOTE_INSN_LOOP_VTOP -9
352 /* This marks the point immediately after the last prologue insn. */
353 #define NOTE_INSN_PROLOGUE_END -10
354 /* This marks the point immediately prior to the first epilogue insn. */
355 #define NOTE_INSN_EPILOGUE_BEG -11
356 /* Generated in place of user-declared labels when they are deleted. */
357 #define NOTE_INSN_DELETED_LABEL -12
358 /* Don't forget to change note_insn_name in rtl.c. */
360 /* These macros are for recording block numbers temporarily
361 in NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes. */
362 #define NOTE_BLOCK_NUMBER(INSN) ((int) NOTE_SOURCE_FILE (INSN))
363 #define SET_NOTE_BLOCK_NUMBER(INSN, NUMBER) \
364 (NOTE_SOURCE_FILE (INSN) = (char *) (NUMBER))
366 #if 0 /* These are not used, and I don't know what they were for. --rms. */
367 #define NOTE_DECL_NAME(INSN) ((INSN)->fld[3].rtstr)
368 #define NOTE_DECL_CODE(INSN) ((INSN)->fld[4].rtint)
369 #define NOTE_DECL_RTL(INSN) ((INSN)->fld[5].rtx)
370 #define NOTE_DECL_IDENTIFIER(INSN) ((INSN)->fld[6].rtint)
371 #define NOTE_DECL_TYPE(INSN) ((INSN)->fld[7].rtint)
374 /* Names for NOTE insn's other than line numbers. */
376 extern char *note_insn_name
[];
377 #define GET_NOTE_INSN_NAME(NOTE_CODE) (note_insn_name[-(NOTE_CODE)])
379 /* The name of a label, in case it corresponds to an explicit label
380 in the input source code. */
381 #define LABEL_NAME(LABEL) ((LABEL)->fld[4].rtstr)
383 /* In jump.c, each label contains a count of the number
384 of LABEL_REFs that point at it, so unused labels can be deleted. */
385 #define LABEL_NUSES(LABEL) ((LABEL)->fld[5].rtint)
387 /* In jump.c, each JUMP_INSN can point to a label that it can jump to,
388 so that if the JUMP_INSN is deleted, the label's LABEL_NUSES can
389 be decremented and possibly the label can be deleted. */
390 #define JUMP_LABEL(INSN) ((INSN)->fld[7].rtx)
392 /* Once basic blocks are found in flow.c,
393 each CODE_LABEL starts a chain that goes through
394 all the LABEL_REFs that jump to that label.
395 The chain eventually winds up at the CODE_LABEL; it is circular. */
396 #define LABEL_REFS(LABEL) ((LABEL)->fld[5].rtx)
398 /* This is the field in the LABEL_REF through which the circular chain
399 of references to a particular label is linked.
400 This chain is set up in flow.c. */
402 #define LABEL_NEXTREF(REF) ((REF)->fld[1].rtx)
404 /* Once basic blocks are found in flow.c,
405 Each LABEL_REF points to its containing instruction with this field. */
407 #define CONTAINING_INSN(RTX) ((RTX)->fld[2].rtx)
409 /* For a REG rtx, REGNO extracts the register number. */
411 #define REGNO(RTX) ((RTX)->fld[0].rtint)
413 /* For a REG rtx, REG_FUNCTION_VALUE_P is nonzero if the reg
414 is the current function's return value. */
416 #define REG_FUNCTION_VALUE_P(RTX) ((RTX)->integrated)
418 /* 1 in a REG rtx if it corresponds to a variable declared by the user. */
419 #define REG_USERVAR_P(RTX) ((RTX)->volatil)
421 /* For a CONST_INT rtx, INTVAL extracts the integer. */
423 #define INTVAL(RTX) ((RTX)->fld[0].rtwint)
425 /* For a SUBREG rtx, SUBREG_REG extracts the value we want a subreg of.
426 SUBREG_WORD extracts the word-number. */
428 #define SUBREG_REG(RTX) ((RTX)->fld[0].rtx)
429 #define SUBREG_WORD(RTX) ((RTX)->fld[1].rtint)
431 /* Access various components of an ASM_OPERANDS rtx. */
433 #define ASM_OPERANDS_TEMPLATE(RTX) XSTR ((RTX), 0)
434 #define ASM_OPERANDS_OUTPUT_CONSTRAINT(RTX) XSTR ((RTX), 1)
435 #define ASM_OPERANDS_OUTPUT_IDX(RTX) XINT ((RTX), 2)
436 #define ASM_OPERANDS_INPUT_VEC(RTX) XVEC ((RTX), 3)
437 #define ASM_OPERANDS_INPUT_CONSTRAINT_VEC(RTX) XVEC ((RTX), 4)
438 #define ASM_OPERANDS_INPUT(RTX, N) XVECEXP ((RTX), 3, (N))
439 #define ASM_OPERANDS_INPUT_LENGTH(RTX) XVECLEN ((RTX), 3)
440 #define ASM_OPERANDS_INPUT_CONSTRAINT(RTX, N) XSTR (XVECEXP ((RTX), 4, (N)), 0)
441 #define ASM_OPERANDS_INPUT_MODE(RTX, N) GET_MODE (XVECEXP ((RTX), 4, (N)))
442 #define ASM_OPERANDS_SOURCE_FILE(RTX) XSTR ((RTX), 5)
443 #define ASM_OPERANDS_SOURCE_LINE(RTX) XINT ((RTX), 6)
445 /* For a MEM rtx, 1 if it's a volatile reference.
446 Also in an ASM_OPERANDS rtx. */
447 #define MEM_VOLATILE_P(RTX) ((RTX)->volatil)
449 /* For a MEM rtx, 1 if it refers to a structure or union component. */
450 #define MEM_IN_STRUCT_P(RTX) ((RTX)->in_struct)
452 /* For a LABEL_REF, 1 means that this reference is to a label outside the
453 loop containing the reference. */
454 #define LABEL_OUTSIDE_LOOP_P(RTX) ((RTX)->in_struct)
456 /* For a LABEL_REF, 1 means it is for a nonlocal label. */
457 #define LABEL_REF_NONLOCAL_P(RTX) ((RTX)->volatil)
459 /* For a CODE_LABEL, 1 means always consider this label to be needed. */
460 #define LABEL_PRESERVE_P(RTX) ((RTX)->in_struct)
462 /* For a REG, 1 means the register is used only in an exit test of a loop. */
463 #define REG_LOOP_TEST_P(RTX) ((RTX)->in_struct)
465 /* During sched, for an insn, 1 means that the insn must be scheduled together
466 with the preceding insn. */
467 #define SCHED_GROUP_P(INSN) ((INSN)->in_struct)
469 /* For a SET rtx, SET_DEST is the place that is set
470 and SET_SRC is the value it is set to. */
471 #define SET_DEST(RTX) ((RTX)->fld[0].rtx)
472 #define SET_SRC(RTX) ((RTX)->fld[1].rtx)
474 /* For a TRAP_IF rtx, TRAP_CONDITION is an expression. */
475 #define TRAP_CONDITION(RTX) ((RTX)->fld[0].rtx)
477 /* 1 in a SYMBOL_REF if it addresses this function's constants pool. */
478 #define CONSTANT_POOL_ADDRESS_P(RTX) ((RTX)->unchanging)
480 /* Flag in a SYMBOL_REF for machine-specific purposes. */
481 #define SYMBOL_REF_FLAG(RTX) ((RTX)->volatil)
483 /* 1 means a SYMBOL_REF has been the library function in emit_library_call. */
484 #define SYMBOL_REF_USED(RTX) ((RTX)->used)
486 /* For an INLINE_HEADER rtx, FIRST_FUNCTION_INSN is the first insn
487 of the function that is not involved in copying parameters to
488 pseudo-registers. FIRST_PARM_INSN is the very first insn of
489 the function, including the parameter copying.
490 We keep this around in case we must splice
491 this function into the assembly code at the end of the file.
492 FIRST_LABELNO is the first label number used by the function (inclusive).
493 LAST_LABELNO is the last label used by the function (exclusive).
494 MAX_REGNUM is the largest pseudo-register used by that function.
495 FUNCTION_ARGS_SIZE is the size of the argument block in the stack.
496 POPS_ARGS is the number of bytes of input arguments popped by the function
497 STACK_SLOT_LIST is the list of stack slots.
498 FUNCTION_FLAGS are where single-bit flags are saved.
499 OUTGOING_ARGS_SIZE is the size of the largest outgoing stack parameter list.
500 ORIGINAL_ARG_VECTOR is a vector of the original DECL_RTX values
501 for the function arguments.
502 ORIGINAL_DECL_INITIAL is a pointer to the original DECL_INITIAL for the
505 We want this to lay down like an INSN. The PREV_INSN field
506 is always NULL. The NEXT_INSN field always points to the
507 first function insn of the function being squirreled away. */
509 #define FIRST_FUNCTION_INSN(RTX) ((RTX)->fld[2].rtx)
510 #define FIRST_PARM_INSN(RTX) ((RTX)->fld[3].rtx)
511 #define FIRST_LABELNO(RTX) ((RTX)->fld[4].rtint)
512 #define LAST_LABELNO(RTX) ((RTX)->fld[5].rtint)
513 #define MAX_PARMREG(RTX) ((RTX)->fld[6].rtint)
514 #define MAX_REGNUM(RTX) ((RTX)->fld[7].rtint)
515 #define FUNCTION_ARGS_SIZE(RTX) ((RTX)->fld[8].rtint)
516 #define POPS_ARGS(RTX) ((RTX)->fld[9].rtint)
517 #define STACK_SLOT_LIST(RTX) ((RTX)->fld[10].rtx)
518 #define FUNCTION_FLAGS(RTX) ((RTX)->fld[11].rtint)
519 #define OUTGOING_ARGS_SIZE(RTX) ((RTX)->fld[12].rtint)
520 #define ORIGINAL_ARG_VECTOR(RTX) ((RTX)->fld[13].rtvec)
521 #define ORIGINAL_DECL_INITIAL(RTX) ((RTX)->fld[14].rtx)
523 /* In FUNCTION_FLAGS we save some variables computed when emitting the code
524 for the function and which must be `or'ed into the current flag values when
525 insns from that function are being inlined. */
527 /* These ought to be an enum, but non-ANSI compilers don't like that. */
528 #define FUNCTION_FLAGS_CALLS_ALLOCA 01
529 #define FUNCTION_FLAGS_CALLS_SETJMP 02
530 #define FUNCTION_FLAGS_RETURNS_STRUCT 04
531 #define FUNCTION_FLAGS_RETURNS_PCC_STRUCT 010
532 #define FUNCTION_FLAGS_NEEDS_CONTEXT 020
533 #define FUNCTION_FLAGS_HAS_NONLOCAL_LABEL 040
534 #define FUNCTION_FLAGS_RETURNS_POINTER 0100
535 #define FUNCTION_FLAGS_USES_CONST_POOL 0200
536 #define FUNCTION_FLAGS_CALLS_LONGJMP 0400
537 #define FUNCTION_FLAGS_USES_PIC_OFFSET_TABLE 01000
539 /* Define a macro to look for REG_INC notes,
540 but save time on machines where they never exist. */
542 /* Don't continue this line--convex cc version 4.1 would lose. */
543 #if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT))
544 #define FIND_REG_INC_NOTE(insn, reg) (find_reg_note ((insn), REG_INC, (reg)))
546 #define FIND_REG_INC_NOTE(insn, reg) 0
549 /* Indicate whether the machine has any sort of auto increment addressing.
550 If not, we can avoid checking for REG_INC notes. */
552 /* Don't continue this line--convex cc version 4.1 would lose. */
553 #if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT))
557 /* Generally useful functions. */
559 /* The following functions accept a wide integer argument. Rather than
560 having to cast on every function call, we use a macro instead, that is
561 defined here and in tree.h. */
564 #define exact_log2(N) exact_log2_wide ((HOST_WIDE_INT) (N))
565 #define floor_log2(N) floor_log2_wide ((HOST_WIDE_INT) (N))
568 #define plus_constant(X,C) plus_constant_wide (X, (HOST_WIDE_INT) (C))
570 #define plus_constant_for_output(X,C) \
571 plus_constant_for_output_wide (X, (HOST_WIDE_INT) (C))
573 extern rtx
plus_constant_wide (), plus_constant_for_output_wide ();
575 #define GEN_INT(N) gen_rtx (CONST_INT, VOIDmode, (N))
577 extern rtx
gen_rtx ();
579 extern char *xmalloc ();
581 extern rtx
rtx_alloc ();
582 extern rtvec
rtvec_alloc ();
583 extern rtx
find_reg_note ();
584 extern rtx
find_regno_note ();
585 extern HOST_WIDE_INT
get_integer_term ();
586 extern rtx
get_related_value ();
587 extern rtx
single_set ();
588 extern rtx
find_last_value ();
589 extern rtx
copy_rtx ();
590 extern rtx
copy_rtx_if_shared ();
591 extern rtx
copy_most_rtx ();
592 extern rtx
replace_rtx ();
593 extern rtvec
gen_rtvec ();
594 extern rtvec
gen_rtvec_v ();
595 extern rtx
read_rtx ();
596 extern rtx
gen_reg_rtx ();
597 extern rtx
gen_label_rtx ();
598 extern rtx
gen_inline_header_rtx ();
599 extern rtx
gen_lowpart_common ();
600 extern rtx
gen_lowpart ();
601 extern rtx
gen_lowpart_if_possible ();
602 extern rtx
operand_subword ();
603 extern rtx
operand_subword_force ();
604 extern int subreg_lowpart_p ();
605 extern rtx
make_safe_from ();
606 extern rtx
memory_address ();
607 extern rtx
get_insns ();
608 extern rtx
get_last_insn ();
609 extern rtx
get_last_insn_anywhere ();
610 extern void start_sequence ();
611 extern void push_to_sequence ();
612 extern void end_sequence ();
613 extern rtx
gen_sequence ();
614 extern rtx
expand_expr ();
615 extern rtx
output_constant_def ();
616 extern rtx
immed_real_const ();
617 extern rtx
immed_real_const_1 ();
618 extern rtx
immed_double_const ();
619 extern rtx
force_const_mem ();
620 extern rtx
get_pool_constant ();
621 extern enum machine_mode
get_pool_mode ();
622 extern int get_pool_offset ();
623 extern rtx
get_parm_real_loc ();
624 extern rtx
assign_stack_local ();
625 extern rtx
assign_stack_temp ();
626 extern rtx
protect_from_queue ();
627 extern void emit_queue ();
628 extern rtx
emit_move_insn ();
629 extern rtx
emit_insn_before ();
630 extern rtx
emit_jump_insn_before ();
631 extern rtx
emit_call_insn_before ();
632 extern rtx
emit_barrier_before ();
633 extern rtx
emit_note_before ();
634 extern rtx
emit_insn_after ();
635 extern rtx
emit_jump_insn_after ();
636 extern rtx
emit_barrier_after ();
637 extern rtx
emit_label_after ();
638 extern rtx
emit_note_after ();
639 extern rtx
emit_line_note_after ();
640 extern rtx
emit_insn ();
641 extern rtx
emit_insns ();
642 extern rtx
emit_insns_before ();
643 extern rtx
emit_jump_insn ();
644 extern rtx
emit_call_insn ();
645 extern rtx
emit_label ();
646 extern rtx
emit_barrier ();
647 extern rtx
emit_line_note ();
648 extern rtx
emit_note ();
649 extern rtx
emit_line_note_force ();
650 extern rtx
make_insn_raw ();
651 extern rtx
previous_insn ();
652 extern rtx
next_insn ();
653 extern rtx
prev_nonnote_insn ();
654 extern rtx
next_nonnote_insn ();
655 extern rtx
prev_real_insn ();
656 extern rtx
next_real_insn ();
657 extern rtx
prev_active_insn ();
658 extern rtx
next_active_insn ();
659 extern rtx
prev_label ();
660 extern rtx
next_label ();
661 extern rtx
next_cc0_user ();
662 extern rtx
prev_cc0_setter ();
663 extern rtx
reg_set_last ();
664 extern rtx
next_nondeleted_insn ();
665 extern enum rtx_code
reverse_condition ();
666 extern enum rtx_code
swap_condition ();
667 extern enum rtx_code
unsigned_condition ();
668 extern enum rtx_code
signed_condition ();
669 extern rtx
find_equiv_reg ();
670 extern rtx
squeeze_notes ();
671 extern rtx
delete_insn ();
672 extern void delete_jump ();
673 extern rtx
get_label_before ();
674 extern rtx
get_label_after ();
675 extern rtx
follow_jumps ();
676 extern rtx
adj_offsettable_operand ();
677 extern rtx
try_split ();
678 extern rtx
split_insns ();
679 extern rtx
simplify_unary_operation (), simplify_binary_operation ();
680 extern rtx
simplify_ternary_operation (), simplify_relational_operation ();
681 extern rtx
nonlocal_label_rtx_list ();
683 /* Maximum number of parallel sets and clobbers in any insn in this fn.
684 Always at least 3, since the combiner could put that many togetherm
685 and we want this to remain correct for all the remaining passes. */
687 extern int max_parallel
;
689 extern int asm_noperands ();
690 extern char *decode_asm_operands ();
693 /* Conditional is to detect when config.h has been included. */
694 extern enum reg_class
reg_preferred_class ();
695 extern enum reg_class
reg_alternate_class ();
698 extern rtx
get_first_nonparm_insn ();
700 /* Standard pieces of rtx, to be substituted directly into things. */
703 extern rtx const0_rtx
;
704 extern rtx const1_rtx
;
705 extern rtx const2_rtx
;
706 extern rtx constm1_rtx
;
707 extern rtx const_true_rtx
;
709 extern rtx const_tiny_rtx
[3][(int) MAX_MACHINE_MODE
];
711 /* Returns a constant 0 rtx in mode MODE. Integer modes are treated the
714 #define CONST0_RTX(MODE) (const_tiny_rtx[0][(int) (MODE)])
716 /* Likewise, for the constants 1 and 2. */
718 #define CONST1_RTX(MODE) (const_tiny_rtx[1][(int) (MODE)])
719 #define CONST2_RTX(MODE) (const_tiny_rtx[2][(int) (MODE)])
721 /* All references to certain hard regs, except those created
722 by allocating pseudo regs into them (when that's possible),
723 go through these unique rtx objects. */
724 extern rtx stack_pointer_rtx
;
725 extern rtx frame_pointer_rtx
;
726 extern rtx arg_pointer_rtx
;
727 extern rtx pic_offset_table_rtx
;
728 extern rtx struct_value_rtx
;
729 extern rtx struct_value_incoming_rtx
;
730 extern rtx static_chain_rtx
;
731 extern rtx static_chain_incoming_rtx
;
733 /* Virtual registers are used during RTL generation to refer to locations into
734 the stack frame when the actual location isn't known until RTL generation
735 is complete. The routine instantiate_virtual_regs replaces these with
736 the proper value, which is normally {frame,arg,stack}_pointer_rtx plus
739 #define FIRST_VIRTUAL_REGISTER (FIRST_PSEUDO_REGISTER)
741 /* This points to the first word of the incoming arguments passed on the stack,
742 either by the caller or by the callee when pretending it was passed by the
745 extern rtx virtual_incoming_args_rtx
;
747 #define VIRTUAL_INCOMING_ARGS_REGNUM (FIRST_VIRTUAL_REGISTER)
749 /* If FRAME_GROWS_DOWNWARDS, this points to immediately above the first
750 variable on the stack. Otherwise, it points to the first variable on
753 extern rtx virtual_stack_vars_rtx
;
755 #define VIRTUAL_STACK_VARS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 1)
757 /* This points to the location of dynamically-allocated memory on the stack
758 immediately after the stack pointer has been adjusted by the amount
761 extern rtx virtual_stack_dynamic_rtx
;
763 #define VIRTUAL_STACK_DYNAMIC_REGNUM ((FIRST_VIRTUAL_REGISTER) + 2)
765 /* This points to the location in the stack at which outgoing arguments should
766 be written when the stack is pre-pushed (arguments pushed using push
767 insns always use sp). */
769 extern rtx virtual_outgoing_args_rtx
;
771 #define VIRTUAL_OUTGOING_ARGS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 3)
773 #define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 3)
775 extern rtx
find_next_ref ();
776 extern rtx
*find_single_use ();
778 /* Define a default value for STORE_FLAG_VALUE. */
780 #ifndef STORE_FLAG_VALUE
781 #define STORE_FLAG_VALUE 1
784 /* Nonzero after end of reload pass.
785 Set to 1 or 0 by toplev.c. */
787 extern int reload_completed
;
789 /* Set to 1 while reload_as_needed is operating.
790 Required by some machines to handle any generated moves differently. */
792 extern int reload_in_progress
;
794 /* If this is nonzero, we do not bother generating VOLATILE
795 around volatile memory references, and we are willing to
796 output indirect addresses. If cse is to follow, we reject
797 indirect addresses so a useful potential cse is generated;
798 if it is used only once, instruction combination will produce
799 the same indirect address eventually. */
800 extern int cse_not_expected
;
802 /* Indexed by pseudo register number, gives the rtx for that pseudo.
803 Allocated in parallel with regno_pointer_flag. */
804 extern rtx
*regno_reg_rtx
;