home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / ae / AE / ae.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-02-28  |  3.3 KB  |  123 lines

  1. /* AE program profiling system.
  2.    Definitions for AE measurement code incorporated into gcc.
  3.    Copyright (C) 1989, 1990 by James R. Larus (larus@cs.wisc.edu)
  4.  
  5.    AE and AEC are free software; you can redistribute it and/or modify it
  6.    under the terms of the GNU General Public License as published by the
  7.    Free Software Foundation; either version 1, or (at your option) any
  8.    later version.
  9.  
  10.    AE and AEC are distributed in the hope that it will be useful, but
  11.    WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.    General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU General Public License
  16.    along with GNU CC; see the file COPYING.  If not, write to James R.
  17.    Larus, Computer Sciences Department, University of Wisconsin--Madison,
  18.    1210 West Dayton Street, Madison, WI 53706, USA or to the Free
  19.    Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  20.  
  21.  
  22. /* $Header: /var/home/larus/AE/AE/RCS/ae.h,v 2.0 90/02/09 17:20:32 larus Exp Locker: larus $ */
  23.  
  24.  
  25. /* List datatype. */
  26.  
  27. typedef
  28. struct list_cell
  29.   {int car;
  30.    struct list_cell *cdr;}
  31. list_cell, *list;
  32.  
  33. #define CAR(x) x->car
  34.  
  35. #define CDR(x) x->cdr
  36.  
  37. list cons ();
  38.  
  39.  
  40. #define DOLIST(v, t, lst, body) \
  41. { \
  42.   list _l_; \
  43.   list cdr_n_free (); \
  44.   for (_l_ = lst; _l_ != NULL; _l_ = cdr_n_free (_l_))\
  45.    { \
  46.      register t v = (t) CAR (_l_); \
  47.      body; \
  48.    } \
  49. }
  50.  
  51. #ifndef NULL
  52. #define NULL (0)
  53. #endif
  54.  
  55.  
  56.  
  57. /* Iterate over the subexpressions in a INSN, CALL_INSN, or JUMP_INSN. */
  58.  
  59. #define APPLY_TO_EXP_IN_INSN(insn, val, e_body)            \
  60. {                                \
  61.   register char *format_ptr = GET_RTX_FORMAT (GET_CODE (insn));    \
  62.   register int i, j;                        \
  63.   register rtx val;                        \
  64.   for (i = 0; i < GET_RTX_LENGTH (GET_CODE (insn)); i++)    \
  65.     switch (*format_ptr++)                    \
  66.       {                                \
  67.       case 'e':                            \
  68.     val = XEXP (insn, i);                    \
  69.     if (val) {e_body;}                    \
  70.     break;                            \
  71.       case 'E':                            \
  72.     for (j = 0; j < XVECLEN (insn, i); j++)            \
  73.       {val = XVECEXP (insn, i, j); if (val) {e_body;}}    \
  74.     break;                            \
  75.       }                                \
  76. }
  77.  
  78. #define REAL_INSN_P(insn) ((GET_CODE (insn) == INSN        \
  79.                 && GET_CODE (PATTERN (insn)) != USE    \
  80.                 && GET_CODE (PATTERN (insn)) != CLOBBER)\
  81.                || GET_CODE (insn) == CALL_INSN    \
  82.                || GET_CODE (insn)== JUMP_INSN)
  83.  
  84.  
  85.  
  86. /* Auxilary information on an instruction. */
  87.  
  88. typedef struct
  89. {
  90.   short mark;            /* Used to mark instructions in loop */
  91.   short in_block;        /* Number of block containing insn
  92.                    (Only set for 1st insn in block) */
  93.   int flags;            /* Information gleaned about insn */
  94.   list entry_edge;        /* List of (B . L) for edges from insn
  95.                    to block B that enter loop L. */
  96.   list back_edge;        /* Similar list of loop back edges */
  97.   list exit_edge;        /* Similar list of loop exit edges  */
  98. } aux_insn_info;
  99.  
  100.  
  101. /* Flags for marking interesting instructions. */
  102.  
  103. #define FUNCTION_START_FLAG 0x1
  104. #define FUNCTION_END_FLAG 0x2
  105.  
  106. #define BLOCK_START_FLAG 0x4
  107. #define BLOCK_END_FLAG 0x8
  108.  
  109. #define CJUMP_TARGET_FLAG 0x10
  110. #define JUMP_TARGET_FLAG 0x20
  111.  
  112. /* These must increase in value: */
  113. #define EASY_INSN_FLAG 0x40
  114. #define HARD_INSN_FLAG 0x80
  115. #define IMPOSSIBLE_INSN_FLAG 0x100
  116.  
  117. #define LOOP_HEAD_FLAG 0x200
  118.  
  119.  
  120. /* Larger than expected maximum bytes of event produced in a basic block. */
  121.  
  122. #define CHUNK_SIZE 100
  123.