Annotation of coherent/d/bin/cc/c/h/i8086/cc1mch.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * This header file contains
                      3:  * machine specific macros, types and
                      4:  * definitions that are only used by the
                      5:  * code generator (cc1).
                      6:  * SMALL and LARGE model Intel iAPX-86.
                      7:  */
                      8: typedef        char    COST;           /* Cost of evaluation */
                      9: typedef        char    TYPE;           /* Machine type */
                     10: typedef        long    FLAG;           /* Flags */
                     11: typedef        char    REGNAME;        /* Register name */
                     12: typedef        int     TYPESET;        /* Set of TYPE */
                     13: typedef        char    PHYSREG;        /* Physical register name */
                     14: typedef        int     PREGSET;        /* Physical reg set */
                     15: typedef        unsigned long PATFLAG;  /* Pattern flags, at least 16 bits */
                     16: typedef        int     KIND;           /* Register kind */
                     17: typedef        int     MASK;           /* Field masks */
                     18: typedef        char    INDEX;          /* Index type */
                     19: 
                     20: #define        DOWN    1               /* Grow stack downwards */
                     21: #define        BITS    0               /* The n'th bit code is not needed */
                     22: #define LONGREL        1               /* The long relational code is needed */
                     23: #define        SWREG   AX              /* Switch register */
                     24: #define        FNUSED  (BAX|BBX|BCX|BDX|BFPAC|BDS|BES) /* Clobbers all */
                     25: #define NOFREE (BSP|BBP|BCS|BSS)       /* Always occupied registers */
                     26: #define        MBLARG  MFNARG          /* Block argument context */
                     27: #define        MBLREG  ANYR            /* Block argument register */
                     28: #define        ICALLS  1               /* Free level on call */
                     29: #define        DVALIS  0               /* Index into dval for DVAL sign */
                     30: #define        DVALMS  0200            /* Bit to flip for DVAL sign */
                     31: #define        NBPCH   8               /* # of bits in char (out.c) */
                     32: 
                     33: #define        upper(n)        ((ival_t)((unsigned long)(n) >> 16))
                     34: #define        lower(n)        ((ival_t)(n))
                     35: #define        isblkp(t)       ((t)==LPTB || (t)==SPTB)
                     36: #if DECVAX
                     37: #define poolseg(op)    ((op!=DCON) ? SLINK : SDATA)
                     38: #else
                     39: #define poolseg(op)    ((notvariant(VRAM)||(op!=DCON)) ? SLINK : SDATA)
                     40: #endif
                     41: 
                     42: #if !TINY
                     43: /*
                     44:  * Debug printout macros.
                     45:  * Explained in snap1.c
                     46:  */
                     47: #define isnap(x)       printf(" %d", (x))
                     48: #define lsnap(x)       printf(" %ld", (x))
                     49: #define csnap(x)       ((x)!=0?printf(" cost=%d", (x)):0)
                     50: #define fsnap(x)       ((x)!=0?printf(" flag=%lx", (x)):0)
                     51: #define mdlsnap(x)     snaptype((x), "Bad leaf")
                     52: #define mdosnap(x)     snaptype((x), "Bad op")
                     53: #endif
                     54: 
                     55: /*
                     56:  * Tree flags.
                     57:  * The 'FLAG' type must be big enough
                     58:  * to hold all of these bits. After the machine
                     59:  * specific flags are the machine independent ones,
                     60:  * and then a number of handy combinations of the
                     61:  * flags, which are used all over.
                     62:  */
                     63: #define        T_0     0x00000001L     /* 0 */
                     64: #define        T_1     0x00000002L     /* 1 */
                     65: #define        T_2     0x00000004L     /* 2 */
                     66: #define        T_BYTE  0x00000008L     /* [-128 ... 127] */
                     67: #define        T_ICN   0x00000010L     /* ICON */
                     68: #define        T_LCN   0x00000020L     /* LCON */
                     69: #define        T_UHS   0x00000040L     /* LCON, 0xFFFF.... */
                     70: #define T_LHS  0x00000080L     /* LCON, 0x....FFFF */
                     71: #define        T_UHC   0x00000100L     /* LCON, 0x0000.... */
                     72: #define        T_LHC   0x00000200L     /* LCON, 0x....0000 */
                     73: #define        T_DCN   0x00000400L     /* DCON */
                     74: #define        T_ACS   0x00000800L     /* ADDR, code segment */
                     75: #define        T_ADS   0x00001000L     /* ADDR, data segment */
                     76: #define        T_RREG  0x00002000L     /* REG, rvalue */
                     77: #define        T_LREG  0x00004000L     /* REG, lvalue */
                     78: #define        T_SREG  0x00008000L     /* REG, stack  */
                     79: #define        T_LEA   0x00010000L     /* Looks like a LEA */
                     80: #define        T_LSS   0x00020000L     /* Looks like a LEA, off SS */
                     81: #define        T_DIR   0x00040000L     /* Direct */
                     82: #define        T_OFS   0x00080000L     /* Offset */
                     83: 
                     84: #define        T_TREG  0x80000000L     /* Need a temporary register */
                     85: #define        T_LV    0x40000000L     /* Lvalue context */
                     86: #define        T_MMX   0x20000000L     /* Must match shape exactly */
                     87: #define        T_INDIR 0x10000000L     /* Fake indirect flag */
                     88: 
                     89: #define        T_NUM   (T_ICN|T_LCN)
                     90: #define        T_CON   (T_NUM|T_ACS|T_ADS)
                     91: #define        T_IMM   (T_CON|T_DCN)
                     92: #define T_REG  (T_RREG|T_LREG|T_SREG)
                     93: #define        T_ADR   (T_DIR|T_RREG|T_LREG|T_SREG)
                     94: #define        T_LEAF  (T_ADR|T_IMM|T_OFS|T_LEA|T_LSS)
                     95: #define        T_EASY  (T_DIR|T_IMM|T_OFS|T_LREG|T_RREG|T_SREG)
                     96: #define T_NLEAF        (T_IMM|T_ADR)
                     97: 
                     98: /*
                     99:  * These type testing macros use a
                    100:  * table that is hidden in file "table1.c". Although
                    101:  * you might think they should be in the "PERTYPE"
                    102:  * table (and you are right) they are not so that the
                    103:  * code that is generated does not have a multiply
                    104:  * in it.
                    105:  */
                    106: #define islong(t)      ((tinfo[t]&01)  != 0)
                    107: #define isword(t)      ((tinfo[t]&02)  != 0)
                    108: #define        isworl(t)       ((tinfo[t]&03)  != 0)
                    109: #define isuns(t)       ((tinfo[t]&04)  != 0)
                    110: #define        isflt(t)        ((tinfo[t]&010) != 0)
                    111: #define isint(t)       ((tinfo[t]&020) != 0)
                    112: #define isbyte(t)      ((tinfo[t]&040) != 0)
                    113: #define isworb(t)       ((tinfo[t]&042) != 0)
                    114: #define        issized(t)      ((tinfo[t]&0100)!= 0)
                    115: #define        ispoint(t)      ((tinfo[t]&0200)!= 0)
                    116: 
                    117: /*
                    118:  * Machine-dependent pattern flags.
                    119:  * These must not overlap with the pattern flags in cc1.h.
                    120:  */
                    121: #define        P80186          0x10000L        /* 80186 */
                    122: #define        P8087           0x20000L        /* 8087 */
                    123: #define        P80287          0x40000L        /* 80287 */
                    124: #define        MDPFLAGS        0x70000L        /* Machine-dependent pattern flags */
                    125: 
                    126: /*
                    127:  * Register kinds.
                    128:  * Used by the register allocator.
                    129:  */
                    130: #define        KB      01              /* Byte */
                    131: #define        KW      02              /* Word */
                    132: #define        KL      04              /* Long */
                    133: #define        KD      010             /* Double */
                    134: #define        KLP     020             /* Large pointer */
                    135: #define        KSP     040             /* Small pointer */
                    136: 
                    137: #define        KWB     (KW|KB)         /* Word or byte */
                    138: 
                    139: /*
                    140:  * Macros for machine dependent stuff.
                    141:  * out.c, pool.c.
                    142:  */
                    143: #define GIDFMT (A_GID|A_DIR)           /* Afield ival for GID output */
                    144: #define LIDFMT (A_LID|A_DIR)           /* Afield ival for LID output */
                    145: #define CONFMT (A_OFFS|A_IMM)          /* Afield ival for constant output */
                    146: #define mapssize(i)    (i)             /* Stack roundup */
                    147:                                        /* Escape to map mch opcodes */
                    148: #define mapcode(c, tp) (c==ZLDES ? mapzldes(tp) : c)
                    149: #define gentos(x,y)                    /* No top of stack required */
                    150: #define genstar(x,y,z,zz)              /* No star address required */
                    151: #define getstar(tp,nse,npfx,pfx)       /* No star address required */
                    152: #if ONLYSMALL                          /* Supply pointer type for IEXPR */
                    153: #define iptrtype()     SPTR
                    154: #else
                    155: #define iptrtype()     (isvariant(VSMALL) ? SPTR : LPTR)
                    156: #endif
                    157: 
                    158: /*
                    159:  * Externals.
                    160:  */
                    161: #if    !YATC
                    162: extern char    tinfo[];
                    163: extern PREGSET regbusy;
                    164: extern PREGSET maxbusy;
                    165: extern PREGSET curbusy;
                    166: extern PREGSET curxreg;
                    167: extern int     blkflab;
                    168: #endif

unix.superglobalmegacorp.com

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