home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / gccsrc2 / regs.h < prev    next >
C/C++ Source or Header  |  1993-07-23  |  5KB  |  141 lines

  1. /* Define per-register tables for data flow info and register allocation.
  2.    Copyright (C) 1987 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 1, 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.  
  22. #define REG_BYTES(R) mode_size[(int) GET_MODE (R)]
  23.  
  24. /* Get the number of consecutive hard regs required to hold the REG rtx R.
  25.    When something may be an explicit hard reg, REG_SIZE is the only
  26.    valid way to get this value.  You cannot get it from the regno.  */
  27.  
  28. #define REG_SIZE(R) \
  29.   ((mode_size[(int) GET_MODE (R)] + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
  30.  
  31. /* Maximum register number used in this function, plus one.  */
  32.  
  33. extern int max_regno;
  34.  
  35. /* Indexed by n, gives number of times (REG n) is used or set.
  36.    References within loops may be counted more times.  */
  37.  
  38. extern short *reg_n_refs;
  39.  
  40. /* Indexed by n, gives number of times (REG n) is set.  */
  41.  
  42. extern short *reg_n_sets;
  43.  
  44. /* Indexed by N, gives number of insns in which register N dies.
  45.    Note that if register N is live around loops, it can die
  46.    in transitions between basic blocks, and that is not counted here.
  47.    So this is only a reliable indicator of how many regions of life there are
  48.    for registers that are contained in one basic block.  */
  49.  
  50. extern short *reg_n_deaths;
  51.  
  52. /* Get the number of consecutive words required to hold pseudo-reg N.  */
  53.  
  54. #define PSEUDO_REGNO_SIZE(N) \
  55.   ((GET_MODE_SIZE (PSEUDO_REGNO_MODE (N)) + UNITS_PER_WORD - 1)        \
  56.    / UNITS_PER_WORD)
  57.  
  58. /* Get the number of bytes required to hold pseudo-reg N.  */
  59.  
  60. #define PSEUDO_REGNO_BYTES(N) \
  61.   GET_MODE_SIZE (PSEUDO_REGNO_MODE (N))
  62.  
  63. /* Get the machine mode of pseudo-reg N.  */
  64.  
  65. #define PSEUDO_REGNO_MODE(N) GET_MODE (regno_reg_rtx[N])
  66.  
  67. /* Indexed by N, gives number of CALL_INSNS across which (REG n) is live.  */
  68.  
  69. extern int *reg_n_calls_crossed;
  70.  
  71. /* Total number of instructions at which (REG n) is live.
  72.    The larger this is, the less priority (REG n) gets for
  73.    allocation in a hard register (in global-alloc).
  74.    This is set in flow.c and remains valid for the rest of the compilation
  75.    of the function; it is used to control register allocation.
  76.  
  77.    local-alloc.c may alter this number to change the priority.
  78.  
  79.    Negative values are special.
  80.    -1 is used to mark a pseudo reg which has a constant or memory equivalent
  81.    and is used infrequently enough that it should not get a hard register.
  82.    -2 is used to mark a pseudo reg for a parameter, when a frame pointer
  83.    is not required.  global-alloc.c makes an allocno for this but does
  84.    not try to assign a hard register to it.  */
  85.  
  86. extern int *reg_live_length;
  87.  
  88. /* Vector of substitutions of register numbers,
  89.    used to map pseudo regs into hardware regs.  */
  90.  
  91. extern short *reg_renumber;
  92.  
  93. /* Vector indexed by hardware reg
  94.    saying whether that reg is ever used.  */
  95.  
  96. extern char regs_ever_live[FIRST_PSEUDO_REGISTER];
  97.  
  98. /* Vector indexed by hardware reg giving its name.  */
  99.  
  100. extern char *reg_names[FIRST_PSEUDO_REGISTER];
  101.  
  102. /* Vector indexed by regno; gives uid of first insn using that reg.
  103.    This is computed by reg_scan for use by cse and loop.
  104.    It is sometimes adjusted for subsequent changes during loop,
  105.    but not adjusted by cse even if cse invalidates it.  */
  106.  
  107. extern short *regno_first_uid;
  108.  
  109. /* Vector indexed by regno; gives uid of last insn using that reg.
  110.    This is computed by reg_scan for use by cse and loop.
  111.    It is sometimes adjusted for subsequent changes during loop,
  112.    but not adjusted by cse even if cse invalidates it.
  113.    This is harmless since cse won't scan through a loop end.  */
  114.  
  115. extern short *regno_last_uid;
  116.  
  117. /* Vector indexed by regno; contains 1 for a register is considered a pointer.
  118.    Reloading, etc. will use a pointer register rather than a non-pointer
  119.    as the base register in an address, when there is a choice of two regs.  */
  120.  
  121. extern char *regno_pointer_flag;
  122. #define REGNO_POINTER_FLAG(REGNO) regno_pointer_flag[REGNO]
  123.  
  124. /* Vector mapping pseudo regno into the REG rtx for that register.
  125.    This is computed by reg_scan.  */
  126.  
  127. extern rtx *regno_reg_rtx;
  128.  
  129. /* Flag set by local-alloc or global-alloc if they decide to allocate
  130.    something in a call-clobbered register.  */
  131.  
  132. extern int caller_save_needed;
  133.  
  134. /* Predicate to decide whether to give a hard reg to a pseudo which
  135.    is referenced REFS times and would need to be saved and restored
  136.    around a call CALLS times.  */
  137.  
  138. #ifndef CALLER_SAVE_PROFITABLE
  139. #define CALLER_SAVE_PROFITABLE(REFS, CALLS)  (4 * (CALLS) < (REFS))
  140. #endif
  141.