home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / cc-61.0.1 / cc / rtl.h < prev    next >
C/C++ Source or Header  |  1991-08-01  |  28KB  |  716 lines

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