Annotation of researchv9/cmd/sun/c2/c2.h, revision 1.1

1.1     ! root        1: /*     @(#)c2.h 1.1 86/02/03 SMI       */
        !             2: 
        !             3: /*
        !             4:  * Copyright (c) 1985 by Sun Microsystems, Inc.
        !             5:  */
        !             6: 
        !             7: 
        !             8: /*
        !             9:  * Header for object code improver
        !            10:  */
        !            11: 
        !            12: 
        !            13: 
        !            14: /*
        !            15:  * a regmask is how we talk about registers being used or set by the
        !            16:  * current instruction, and also how we keep track of "dead" registers.
        !            17:  * Each d-register is represented by three bits: for byte, word, and
        !            18:  * longword access (pipe dreaming here). Each a-register is represented
        !            19:  * by only one bit, as they are always used and set as longwords. Each
        !            20:  * f-register is also represented by one bit, as are each of the condition 
        !            21:  * code registers.
        !            22:  * It looks like this:
        !            23:  * +--+--+--+--+--+--+--+--+-----+-----+-----+-----+-----+-----+-----+-----+
        !            24:  * |a7|a6|a5|a4|a3|a2|a1|a0| d7  | d6  | d5  | d4  | d3  | d2  | d1  | d0  |
        !            25:  * +--+--+--+--+--+--+--+--+-----+-----+-----+-----+-----+-----+-----+-----+
        !            26:  *                                           +--+--+--+--+--+--+--+--+--+--+
        !            27:  *                                           |fc|cc|f7|f6|f5|f4|f3|f2|f1|f0|
        !            28:  *                                           +--+--+--+--+--+--+--+--+--+--+
        !            29:  * where each of the d-register fields is subdivided as:
        !            30:  *                     +-----------+
        !            31:  *                     | L | W | B |
        !            32:  *                     +-----------+
        !            33:  *
        !            34:  * We can only deal with reading OR writing at one time here, even though the
        !            35:  * touch field in the instruction description talks about both at once.
        !            36:  */
        !            37: 
        !            38: typedef struct rm_type{ 
        !            39:        unsigned da; 
        !            40:        unsigned short f; 
        !            41: }  regmask;
        !            42: 
        !            43: regmask exitmask, regmask0, regmask_nontemp, regmask_all;
        !            44: regmask makemask(), movemmask(), compute_normal(), addmask();
        !            45: regmask submask(), andmask(), notmask();
        !            46: 
        !            47: void init_csects(), freeoperand(), rectify(), freetree();
        !            48: void dumpprogram(), xref(), quicken();
        !            49: void newreference(), unreference(), cannibalize();
        !            50: struct node * addnode();
        !            51: 
        !            52: typedef
        !            53: struct node {
        !            54:        opcode_t    op:8;
        !            55:        subop_t     subop:8;    /* to quickly recognize certain nodes */
        !            56:        struct  node    *forw;
        !            57:        struct  node    *back;
        !            58:        union {
        !            59:            struct      ins_bkt *i; /* for Instruct and PseudoOp nodes */
        !            60:            struct      sym_bkt *n; /* if we're a label */
        !            61:        } p;
        !            62: # define instr p.i
        !            63: # define name  p.n
        !            64:        int     nref; /* number operands or number references here */
        !            65:        struct  oper    *ref[OPERANDS_MAX]; /* our operands */
        !            66:        struct  node    *luse; /* operand, use chain for jumps*/
        !            67:        struct  node    *lnext;
        !            68:        regmask ruse,
        !            69:                rset,
        !            70:                rlive;
        !            71:        short   lineno;
        !            72: } NODE;
        !            73: 
        !            74: # define RMASK 3
        !            75: # define WMASK 014
        !            76: # define TOUCHWIDTH 5
        !            77: # define TOUCHMASK  037
        !            78: # define BR  1
        !            79: # define WR  2
        !            80: # define LR  3
        !            81: # define BW  4
        !            82: # define WW  8
        !            83: # define LW  12
        !            84: # define SPEC(n) (16+n)
        !            85: # define MAKERMASK( regno, rtouch ) RegMasks[regno][(rtouch)&RMASK]
        !            86: # define MAKEWMASK( regno, wtouch ) RegMasks[regno][((wtouch)&WMASK)>>2]
        !            87: extern regmask RegMasks[PCREG+1][LR+1];
        !            88: 
        !            89: struct node    first;
        !            90: struct node    *freenodes;
        !            91: struct node    *new();
        !            92: struct  node    *deletenode();
        !            93: char   *curlp;
        !            94: struct meter{
        !            95:     int        ndrop;
        !            96:     int        nbrbr;
        !            97:     int        nsaddr;
        !            98:     int        redunm;
        !            99:     int        iaftbr;
        !           100:     int        nredext;
        !           101:     int        nredadd;
        !           102:     int        nredsub;
        !           103:     int        nredmul;
        !           104:     int        ndbra;
        !           105:     int ndbrarev;
        !           106:     int        nredor;
        !           107:     int        nredshf;
        !           108:     int        nmtoc;
        !           109:     int        nmtos;
        !           110:     int        nctot;
        !           111:     int        nmmtmo;
        !           112:     int        nrmtfr;
        !           113:     int        namwl;
        !           114:     int        njp1;
        !           115:     int        nrlab;
        !           116:     int        nxjump;
        !           117:     int        ncmot;
        !           118:     int        nrevbr;
        !           119:     int        loopiv;
        !           120:     int        nredunj;
        !           121:     int        nskip;
        !           122:     int        ncomj;
        !           123:     int        nttomo;
        !           124:     int        nrtst;
        !           125:     int        nwmov;
        !           126:     int        nchange;
        !           127:     int nwop;
        !           128:     int nskyreg;
        !           129:     int ndpsky;
        !           130:     int nplusminus;
        !           131:     int nusecr;
        !           132: }                      meter;
        !           133: 
        !           134: int    debug;
        !           135: extern int     fortranprog; /* set if a5, a4 point at "regular" memory */
        !           136: 
        !           137: extern int verbose; /* flag set by -v option */
        !           138: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.