regs.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* Define per-register tables for data flow info and register allocation.
  2. Copyright (C) 1987 Free Software Foundation, Inc.
  3. This file is part of GNU CC.
  4. GNU CC is distributed in the hope that it will be useful,
  5. but WITHOUT ANY WARRANTY. No author or distributor
  6. accepts responsibility to anyone for the consequences of using it
  7. or for whether it serves any particular purpose or works at all,
  8. unless he says so in writing. Refer to the GNU CC General Public
  9. License for full details.
  10. Everyone is granted permission to copy, modify and redistribute
  11. GNU CC, but only under the conditions described in the
  12. GNU CC General Public License. A copy of this license is
  13. supposed to have been given to you along with GNU CC so you
  14. can know your rights and responsibilities. It should be in a
  15. file named COPYING. Among other things, the copyright notice
  16. and this notice must be preserved on all copies. */
  17. #define REG_BYTES(R) mode_size[(int) GET_MODE (R)]
  18. /* Get the number of consecutive hard regs required to hold the REG rtx R.
  19. When something may be an explicit hard reg, REG_SIZE is the only
  20. valid way to get this value. You cannot get it from the regno. */
  21. #define REG_SIZE(R) \
  22. ((mode_size[(int) GET_MODE (R)] + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
  23. /* Maximum register number used in this function, plus one. */
  24. extern int max_regno;
  25. /* Indexed by n, gives number of times (REG n) is used or set.
  26. References within loops may be counted more times. */
  27. extern short *reg_n_refs;
  28. /* Indexed by n, gives number of times (REG n) is set. */
  29. extern short *reg_n_sets;
  30. /* Indexed by N, gives number of insns in which register N dies.
  31. Note that if register N is live around loops, it can die
  32. in transitions between basic blocks, and that is not counted here.
  33. So this is only a reliable indicator of how many regions of life there are
  34. for registers that are contained in one basic block. */
  35. extern short *reg_n_deaths;
  36. /* Get the number of consecutive words required to hold pseudo-reg N. */
  37. #define PSEUDO_REGNO_SIZE(N) \
  38. ((GET_MODE_SIZE (PSEUDO_REGNO_MODE (N)) + UNITS_PER_WORD - 1) \
  39. / UNITS_PER_WORD)
  40. /* Get the number of bytes required to hold pseudo-reg N. */
  41. #define PSEUDO_REGNO_BYTES(N) \
  42. GET_MODE_SIZE (PSEUDO_REGNO_MODE (N))
  43. /* Get the machine mode of pseudo-reg N. */
  44. #define PSEUDO_REGNO_MODE(N) GET_MODE (regno_reg_rtx[N])
  45. /* Indexed by N, gives 1 if (REG n) is live across a CALL_INSN. */
  46. extern char *reg_crosses_call;
  47. /* Total number of instructions at which (REG n) is live.
  48. The larger this is, the less priority (REG n) gets for
  49. allocation in a real register. */
  50. extern int *reg_live_length;
  51. /* Vector of substitutions of register numbers,
  52. used to map pseudo regs into hardware regs. */
  53. extern short *reg_renumber;
  54. /* Vector indexed by hardware reg
  55. saying whether that reg is ever used. */
  56. extern char regs_ever_live[FIRST_PSEUDO_REGISTER];
  57. /* Vector indexed by regno; gives uid of first insn using that reg.
  58. This is computed by reg_scan and not adjusted for subsequent changes. */
  59. extern short *regno_first_uid;
  60. /* Vector indexed by regno; gives uid of last insn using that reg.
  61. This is computed by reg_scan and not adjusted for subsequent changes. */
  62. extern short *regno_last_uid;
  63. /* Vector indexed by regno; contains 1 for a register is considered a pointer.
  64. Reloading, etc. will use a pointer register rather than a non-pointer
  65. as the base register in an address, when there is a choice of two regs. */
  66. extern char *regno_pointer_flag;
  67. #define REGNO_POINTER_FLAG(REGNO) regno_pointer_flag[REGNO]
  68. /* Vector mapping pseudo regno into the REG rtx for that register.
  69. This is computed by reg_scan. */
  70. extern rtx *regno_reg_rtx;