# 2.11BSD#431 - /usr/src/lib/mip/pass2.h

##### Macros

    EITHER            X
    FORARG            X
    FORCC             X
    FOREFF            X
    FORREW            X
    INAREG            X
    INBREG            X
    INTAREG           X
    INTBREG           X
    INTEMP            X
    MDONE             X
    MNOPE             X
    MUSTDO            X
    NACOUNT           X
    NAMASK            X
    NAREG             X
    NASL              X
    NASR              X
    NBCOUNT           X
    NBMASK            X
    NBREG             X
    NBSL              X
    NBSR              X
    NOPREF            X
    NTEMP             X
    NTMASK            X
    OPANY             X
    OPCOMM            X
    OPDIV             X
    OPFLOAT           X
    OPLEAF            X
    OPLOG             X
    OPLTYPE           X
    OPMUL             X
    OPSHFT            X
    OPSIMP            X
    OPUNARY           X
    PUTCHAR           X
    R2PACK            X
    R2TEST            X
    R2UPK1            X
    R2UPK2            X
    REGLOOP           X
    RESC1             X
    RESC2             X
    RESC3             X
    RESCC             X
    REWRITE           X
    RLEFT             X
    RNOP              X
    RNULL             X
    RRIGHT            X
    SANY              X
    SAREG             X
    SBREG             X
    SCC               X
    SCCON             X
    SCON              X
    SETSTO            X
    SFLD              X
    SMONE             X
    SNAME             X
    SONE              X
    SOREG             X
    SPECIAL           X
    SSCON             X
    SSOREG            X
    STAREG            X
    STARNM            X
    STARREG           X
    STBREG            X
    SWADD             X
    SZERO             X
    TANY              X
    TBUSY             X
    TCHAR             X
    TDOUBLE           X
    TFLOAT            X
    TINT              X
    TLONG             X
    TPOINT            X
    TPTRTO            X
    TSHORT            X
    TSTRUCT           X
    TUCHAR            X
    TULONG            X
    TUNSIGNED         X
    TUSHORT           X
    _PASS2_           X
    callchk           X
    isbreg            X
    istnode           X
    istreg            X

##### struct's

    ml_head           X
    ml_node           X
    optab             X
    respref           X

##### unions's

    mltemplate        X

       1: /*	pass2.h	4.1	85/03/19	*/
       2:
       3: #ifndef _PASS2_
       4: #define _PASS2_
       5:
       6: #include "macdefs.h"
       7: #include "mac2defs.h"
       8: #include "manifest.h"
       9:
      10: /* cookies, used as arguments to codgen */
      11: #define FOREFF  01      /* compute for effects only */
      12: #define INAREG  02      /* compute into a register */
      13: #define INTAREG 04      /* compute into a scratch register */
      14: #define INBREG  010     /* compute into a lvalue register */
      15: #define INTBREG 020     /* compute into a scratch lvalue register */
      16: #define FORCC   040     /* compute for condition codes only */
      17: #define INTEMP  010000      /* compute into a temporary location */
      18: #define FORARG  020000      /* compute for an argument of a function */
      19: #define FORREW  040000      /* search the table for a rewrite rule */
      20:
      21: /*
      22:  * OP descriptors,
      23:  * the ASG operator may be used on some of these
      24:  */
      25: #define OPSIMP  010000      /* +, -, &, |, ^ */
      26: #define OPCOMM  010002      /* +, &, |, ^ */
      27: #define OPMUL   010004      /* *, / */
      28: #define OPDIV   010006      /* /, % */
      29: #define OPUNARY 010010      /* unary ops */
      30: #define OPLEAF  010012      /* leaves */
      31: #define OPANY   010014      /* any op... */
      32: #define OPLOG   010016      /* logical ops */
      33: #define OPFLOAT 010020      /* +, -, *, or / (for floats) */
      34: #define OPSHFT  010022      /* <<, >> */
      35: #define OPLTYPE 010024      /* leaf type nodes (e.g, NAME, ICON, etc.) */
      36:
      37: /* match returns */
      38: #define MNOPE   010000      /* no match generated */
      39: #define MDONE   010001      /* done evalution */
      40:
      41: /* shapes */
      42: #define SANY    01      /* same as FOREFF */
      43: #define SAREG   02      /* same as INAREG */
      44: #define STAREG  04      /* same as INTAREG */
      45: #define SBREG   010     /* same as INBREG */
      46: #define STBREG  020     /* same as INTBREG */
      47: #define SCC 040     /* same as FORCC */
      48: #define SNAME   0100        /* name */
      49: #define SCON    0200        /* constant */
      50: #define SFLD    0400        /* field */
      51: #define SOREG   01000       /* offset from register */
      52: /* indirection or wild card shapes */
      53: #ifndef WCARD1
      54: #define STARNM  02000       /* indirect through name */
      55: #endif
      56: #ifndef WCARD2
      57: #define STARREG 04000       /* indirect through register */
      58: #endif
      59: #define SWADD   040000      /* word address */
      60: #define SPECIAL 0100000     /* special stuff (follows) */
      61: #define SZERO   SPECIAL     /* constant zero */
      62: #define SONE    (SPECIAL|1) /* constant +1 */
      63: #define SMONE   (SPECIAL|2) /* constant -1 */
      64: #define SCCON   (SPECIAL|3) /* -256 <= constant < 256 */
      65: #define SSCON   (SPECIAL|4) /* -32768 <= constant < 32768 */
      66: #define SSOREG  (SPECIAL|5) /* non-indexed OREG */
      67: /* FORARG and INTEMP are carefully not conflicting with shapes */
      68:
      69: /* types */
      70: #define TCHAR       01  /* char */
      71: #define TSHORT      02  /* short */
      72: #define TINT        04  /* int */
      73: #define TLONG       010 /* long */
      74: #define TFLOAT      020 /* float */
      75: #define TDOUBLE     040 /* double */
      76: #define TPOINT      0100    /* pointer to something */
      77: #define TUCHAR      0200    /* unsigned char */
      78: #define TUSHORT     0400    /* unsigned short */
      79: #define TUNSIGNED   01000   /* unsigned int */
      80: #define TULONG      02000   /* unsigned long */
      81: #define TPTRTO      04000   /* pointer to one of the above */
      82: #define TANY        010000  /* matches anything within reason */
      83: #define TSTRUCT     020000  /* structure or union */
      84:
      85: /* reclamation cookies */
      86: #define RNULL       0   /* clobber result */
      87: #define RLEFT       01  /* reclaim left resource */
      88: #define RRIGHT      02  /* reclaim right resource */
      89: #define RESC1       04  /* reclaim resource allocated #1 */
      90: #define RESC2       010 /* reclaim resource allocated #2 */
      91: #define RESC3       020 /* reclaim resource allocated #3 */
      92: #define RESCC       04000   /* reclaim condition codes */
      93: #define RNOP        010000  /* DANGER: can cause loops.. */
      94:
      95: /* needs */
      96: #define NAREG       01  /* need an A register */
      97: #define NACOUNT     03  /* count mask of A registers */
      98: #define NAMASK      017 /* A register need field mask */
      99: #define NASL        04  /* need A register shared with left resource */
     100: #define NASR        010 /* need A register shared with right resource */
     101: #define NBREG       020 /* need a B register */
     102: #define NBCOUNT     060 /* count mask of B register */
     103: #define NBMASK      0360    /* B register need field mask */
     104: #define NBSL        0100    /* need B register shared with left resource */
     105: #define NBSR        0200    /* need B register shared with right resource */
     106: #define NTEMP       0400    /* need temporary storage location */
     107: #define NTMASK      07400   /* count mask of temporary storage locations */
     108: #define REWRITE     010000  /* need rewrite */
     109: #define EITHER      040000  /* allocate all resources or nothing */
     110:
     111: #define MUSTDO      010000  /* force register requirements */
     112: #ifndef NOPREF
     113: /* also defined in onepass.h */
     114: #define NOPREF      020000  /* no preference for register assignment */
     115: #endif
     116:
     117: /* register allocation */
     118: extern  int rstatus[];      /* register status info */
     119: extern  int busy[];     /* register use info */
     120: extern  struct respref {
     121:     int cform;
     122:     int mform;
     123: } respref[];            /* resource preference rules */
     124:
     125: #define isbreg(r)   (rstatus[r]&SBREG)
     126: #define istreg(r)   (rstatus[r]&(STBREG|STAREG))
     127: #define istnode(p)  (p->in.op==REG && istreg(p->tn.rval))
     128:
     129: #define TBUSY       01000   /* register temporarily busy (during alloc) */
     130: #define REGLOOP(i)  for (i = 0; i < REGSZ; ++i)
     131:
     132: extern  NODE *deltrees[DELAYS]; /* trees held for delayed evaluation */
     133: extern  int deli;       /* mmmmm */
     134:
     135: #define SETSTO(x,y) (stotree = (x), stocook = (y))
     136: extern  int stocook;
     137: extern  NODE *stotree;
     138: extern  int callflag;
     139:
     140: extern  int fregs;
     141:
     142: #ifndef ONEPASS
     143: #include "ndu.h"
     144: #endif
     145:
     146: extern  NODE node[];
     147:
     148: /* code tables */
     149: extern  struct optab {
     150:     int op;         /* operator to match */
     151:     int visit;          /* goal to match */
     152:     int lshape;         /* left shape to match */
     153:     int ltype;          /* left type to match */
     154:     int rshape;         /* right shape to match */
     155:     int rtype;          /* right type to match */
     156:     int needs;          /* resource required */
     157:     int rewrite;        /* how to rewrite afterwards */
     158:     char    *cstring;       /* code generation template */
     159: } table[];
     160:
     161: extern  NODE resc[];
     162:
     163: extern  OFFSZ tmpoff;
     164: extern  OFFSZ maxoff;
     165: extern  OFFSZ baseoff;
     166: extern  OFFSZ maxtemp;
     167: extern  int maxtreg;
     168: extern  int ftnno;
     169: extern  int rtyflg;
     170: extern  int nrecur;     /* flag to keep track of recursions */
     171:
     172: extern  NODE
     173:     *talloc(),
     174:     *eread(),
     175:     *tcopy(),
     176:     *getlr();
     177:
     178: extern  CONSZ rdin();
     179: extern  int eprint();
     180: extern  char *rnames[];
     181:
     182: extern  int lineno;
     183: extern  char filename[];
     184: extern  int fldshf, fldsz;
     185: extern  int lflag, xdebug, udebug, edebug, odebug;
     186: extern  int rdebug, radebug, tdebug, sdebug;
     187: #ifdef FORT
     188: extern  int Oflag;
     189: #endif
     190:
     191: #ifndef callchk
     192: #define callchk(x) allchk()
     193: #endif
     194:
     195: #ifndef PUTCHAR
     196: #define PUTCHAR(x) putchar(x)
     197: #endif
     198:
     199: /* macros for doing double indexing */
     200: #define R2PACK(x,y) (0200*((x)+1)+y)        /* pack 2 regs */
     201: #define R2UPK1(x)   ((((x)>>7)-1)&0177)     /* unpack reg 1 */
     202: #define R2UPK2(x)   ((x)&0177)          /* unpack reg 2 */
     203: #define R2TEST(x)   ((x)>=0200)         /* test if packed */
     204:
     205: #ifdef MULTILEVEL
     206: union   mltemplate {
     207:     struct ml_head {
     208:         int tag;            /* tree class */
     209:         int subtag;         /* subclass of tree */
     210:         union   mltemplate *nexthead;   /* linked by mlinit() */
     211:     } mlhead;
     212:     struct ml_node {
     213:         int op;         /* operator or op description */
     214:         int nshape;         /* node shape */
     215:         /*
     216: 		 * Both op and nshape must match the node.
     217: 		 * where the work is to be done entirely by
     218: 		 * op, nshape can be SANY, visa versa, op can
     219: 		 * be OPANY.
     220: 		 */
     221:         int ntype;          /* type descriptor */
     222:     } mlnode;
     223: };
     224: extern  union mltemplate mltree[];
     225: #endif
     226: #endif

#### Defined struct's

ml_head defined in line 207; never used
ml_node defined in line 212; never used
optab defined in line 149; used 10 times

- in /usr/src/lib/mip/allo.c line 36(2)
- in /usr/src/lib/mip/match.c line 212-218(6), 272(2)

respref defined in line 120; used 2 times

- in /usr/src/lib/mip/allo.c line 386(2)

#### Defined union's

mltemplate defined in line 206; used 16 times

- in line 210(2), 224(2)
- in /usr/src/lib/mip/match.c line 450(2), 466(2), 473-474(4), 541-542(4)

#### Defined macros

EITHER defined in line 109; used 1 times

- in /usr/src/lib/mip/allo.c line 42

FORARG defined in line 18; never used
FORCC defined in line 16; used 6 times

- in /usr/src/lib/mip/allo.c line 416
- in /usr/src/lib/mip/reader.c line 947-956(3), 963, 1024

FOREFF defined in line 11; used 11 times

- in /usr/src/lib/mip/allo.c line 409
- in /usr/src/lib/mip/match.c line 365
- in /usr/src/lib/mip/reader.c line 290-291(2), 491, 563, 657-659(2), 671, 739, 991

FORREW defined in line 19; used 2 times

- in /usr/src/lib/mip/match.c line 276
- in /usr/src/lib/mip/reader.c line 491

INAREG defined in line 12; used 2 times

- in /usr/src/lib/mip/reader.c line 619, 945

INBREG defined in line 14; used 2 times

- in /usr/src/lib/mip/reader.c line 619, 945

INTAREG defined in line 13; used 7 times

- in /usr/src/lib/mip/reader.c line 573, 586, 592, 609, 625, 704-705(2)

INTBREG defined in line 15; used 6 times

- in /usr/src/lib/mip/reader.c line 573, 586, 592, 625, 704-705(2)

INTEMP defined in line 17; used 5 times

- in /usr/src/lib/mip/match.c line 92
- in /usr/src/lib/mip/reader.c line 491, 792, 800, 895

MDONE defined in line 39; used 4 times

- in /usr/src/lib/mip/match.c line 313, 632
- in /usr/src/lib/mip/reader.c line 515, 748

MNOPE defined in line 38; used 2 times

- in /usr/src/lib/mip/match.c line 317
- in /usr/src/lib/mip/reader.c line 516

MUSTDO defined in line 111; used 6 times

- in /usr/src/lib/mip/allo.c line 167, 494-495(2)
- in /usr/src/lib/mip/reader.c line 588, 1080-1082(2)

NACOUNT defined in line 97; used 1 times

- in /usr/src/lib/mip/allo.c line 45

NAMASK defined in line 98; used 4 times

- in /usr/src/lib/mip/allo.c line 47, 171, 198, 210

NAREG defined in line 96; used 1 times

- in /usr/src/lib/mip/allo.c line 54

NASL defined in line 99; used 1 times

- in /usr/src/lib/mip/allo.c line 245

NASR defined in line 100; used 1 times

- in /usr/src/lib/mip/allo.c line 246

NBCOUNT defined in line 102; used 1 times

- in /usr/src/lib/mip/allo.c line 67

NBMASK defined in line 103; used 3 times

- in /usr/src/lib/mip/allo.c line 69, 178, 201

NBREG defined in line 101; used 1 times

- in /usr/src/lib/mip/allo.c line 76

NBSL defined in line 104; used 1 times

- in /usr/src/lib/mip/allo.c line 245

NBSR defined in line 105; used 1 times

- in /usr/src/lib/mip/allo.c line 246

NOPREF defined in line 114; used 1 times

- in line 112

NTEMP defined in line 106; used 1 times

- in /usr/src/lib/mip/allo.c line 95

NTMASK defined in line 107; used 2 times

- in /usr/src/lib/mip/allo.c line 88, 95

OPANY defined in line 31; never used
OPCOMM defined in line 26; never used
OPDIV defined in line 28; never used
OPFLOAT defined in line 33; never used
OPLEAF defined in line 30; never used
OPLOG defined in line 32; never used
OPLTYPE defined in line 35; never used
OPMUL defined in line 27; never used
OPSHFT defined in line 34; never used
OPSIMP defined in line 25; used 12 times

- in /usr/src/lib/mip/match.c line 249-254(2), 283-288(2), 490, 504-509(2), 572-577(2), 591, 606, 613

OPUNARY defined in line 29; never used
PUTCHAR defined in line 196; used 4 times

- in line 195
- in /usr/src/lib/mip/match.c line 336
- in /usr/src/lib/mip/reader.c line 153-155(2)

R2PACK defined in line 200; never used
R2TEST defined in line 203; used 6 times

- in /usr/src/lib/mip/allo.c line 256, 275, 286, 508, 557
- in /usr/src/lib/mip/match.c line 77

R2UPK1 defined in line 201; used 10 times

- in /usr/src/lib/mip/allo.c line 257, 276(2), 287(2), 512(3), 558(2)

R2UPK2 defined in line 202; used 6 times

- in /usr/src/lib/mip/allo.c line 257, 277, 288, 513(2), 559

REGLOOP defined in line 130; used 3 times

- in /usr/src/lib/mip/allo.c line 21, 110, 582

RESC1 defined in line 89; used 1 times

- in /usr/src/lib/mip/allo.c line 431

RESC2 defined in line 90; used 1 times

- in /usr/src/lib/mip/allo.c line 432

RESC3 defined in line 91; used 1 times

- in /usr/src/lib/mip/allo.c line 433

RESCC defined in line 92; used 1 times

- in /usr/src/lib/mip/allo.c line 416

REWRITE defined in line 108; used 2 times

- in /usr/src/lib/mip/match.c line 227, 305

RLEFT defined in line 87; used 1 times

- in /usr/src/lib/mip/allo.c line 429

RNOP defined in line 93; used 2 times

- in /usr/src/lib/mip/allo.c line 365, 400

RNULL defined in line 86; used 12 times

- in /usr/src/lib/mip/allo.c line 360, 400, 409
- in /usr/src/lib/mip/fort.c line 264
- in /usr/src/lib/mip/reader.c line 208, 243, 589, 678, 695, 740, 966, 1027

RRIGHT defined in line 88; used 1 times

- in /usr/src/lib/mip/allo.c line 430

SANY defined in line 42; used 1 times

- in /usr/src/lib/mip/match.c line 90

SAREG defined in line 43; used 2 times

- in /usr/src/lib/mip/match.c line 140-141(2)

SBREG defined in line 45; used 2 times

- in line 125
- in /usr/src/lib/mip/match.c line 140

SCC defined in line 47; used 1 times

- in /usr/src/lib/mip/match.c line 131

SCCON defined in line 64; used 2 times

- in /usr/src/lib/mip/match.c line 72
- in /usr/src/lib/mip/reader.c line 440

SCON defined in line 49; used 1 times

- in /usr/src/lib/mip/match.c line 112

SETSTO defined in line 135; used 3 times

- in /usr/src/lib/mip/reader.c line 792, 800, 895

SFLD defined in line 50; used 1 times

- in /usr/src/lib/mip/match.c line 116

SMONE defined in line 63; used 2 times

- in /usr/src/lib/mip/match.c line 71
- in /usr/src/lib/mip/reader.c line 439

SNAME defined in line 48; used 1 times

- in /usr/src/lib/mip/match.c line 110

SONE defined in line 62; used 2 times

- in /usr/src/lib/mip/match.c line 70
- in /usr/src/lib/mip/reader.c line 438

SOREG defined in line 51; used 1 times

- in /usr/src/lib/mip/match.c line 145

SPECIAL defined in line 60; used 9 times

- in line 61-66(6)
- in /usr/src/lib/mip/match.c line 59
- in /usr/src/lib/mip/reader.c line 436, 443

SSCON defined in line 65; used 2 times

- in /usr/src/lib/mip/match.c line 73
- in /usr/src/lib/mip/reader.c line 441

SSOREG defined in line 66; used 1 times

- in /usr/src/lib/mip/reader.c line 442

STAREG defined in line 44; used 4 times

- in line 126
- in /usr/src/lib/mip/allo.c line 23, 172
- in /usr/src/lib/mip/match.c line 141

STARNM defined in line 54; never used
STARREG defined in line 57; never used
STBREG defined in line 46; used 4 times

- in line 126
- in /usr/src/lib/mip/allo.c line 27, 179
- in /usr/src/lib/mip/match.c line 141

SWADD defined in line 59; used 1 times

- in /usr/src/lib/mip/match.c line 94

SZERO defined in line 61; used 2 times

- in /usr/src/lib/mip/match.c line 69
- in /usr/src/lib/mip/reader.c line 437

TANY defined in line 82; used 1 times

- in /usr/src/lib/mip/match.c line 163

TBUSY defined in line 129; used 4 times

- in /usr/src/lib/mip/allo.c line 111, 225-226(2), 232

TCHAR defined in line 70; used 1 times

- in /usr/src/lib/mip/match.c line 185

TDOUBLE defined in line 75; used 1 times

- in /usr/src/lib/mip/match.c line 206

TFLOAT defined in line 74; used 1 times

- in /usr/src/lib/mip/match.c line 204

TINT defined in line 72; used 1 times

- in /usr/src/lib/mip/match.c line 192

TLONG defined in line 73; used 1 times

- in /usr/src/lib/mip/match.c line 202

TPOINT defined in line 76; used 1 times

- in /usr/src/lib/mip/match.c line 179

TPTRTO defined in line 81; used 3 times

- in /usr/src/lib/mip/match.c line 171, 177-180(2)

TSHORT defined in line 71; used 1 times

- in /usr/src/lib/mip/match.c line 187

TSTRUCT defined in line 83; used 1 times

- in /usr/src/lib/mip/match.c line 190

TUCHAR defined in line 77; used 1 times

- in /usr/src/lib/mip/match.c line 198

TULONG defined in line 80; used 1 times

- in /usr/src/lib/mip/match.c line 200

TUNSIGNED defined in line 79; used 1 times

- in /usr/src/lib/mip/match.c line 194

TUSHORT defined in line 78; used 1 times

- in /usr/src/lib/mip/match.c line 196

_PASS2_ defined in line 4; used 1 times

- in line 3

callchk defined in line 192; used 2 times

- in line 191
- in /usr/src/lib/mip/allo.c line 406

isbreg defined in line 125; used 2 times

- in /usr/src/lib/mip/allo.c line 197
- in /usr/src/lib/mip/match.c line 140

istnode defined in line 127; never used
istreg defined in line 126; used 19 times

- in line 127
- in /usr/src/lib/mip/allo.c line 194, 220, 310-316(5), 335-341(6), 509-513(3), 583
- in /usr/src/lib/mip/match.c line 141

#### Usage of this include

pass2.h used 5 times

- in /usr/src/lib/mip/allo.c line 5
- in /usr/src/lib/mip/common.c line 9
- in /usr/src/lib/mip/fort.c line 10
- in /usr/src/lib/mip/match.c line 5
- in /usr/src/lib/mip/reader.c line 5

Last modified: 1991-07-20 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1736 |