BSD 4 development
[unix-history] / usr / src / cmd / mip / mfile2
index 06fa74d..36fbc3c 100644 (file)
@@ -12,8 +12,8 @@
 # define deflab def2lab
 # define edebug e2debug
 # define eprint e2print
 # define deflab def2lab
 # define edebug e2debug
 # define eprint e2print
-# define filename ftitle
 # define getlab get2lab
 # define getlab get2lab
+# define filename ftitle
 # endif
 
 /*     cookies, used as arguments to codgen */
 # endif
 
 /*     cookies, used as arguments to codgen */
 # define SCON 0200
 # define SFLD 0400
 # define SOREG 01000
 # define SCON 0200
 # define SFLD 0400
 # define SOREG 01000
+/* indirection or wild card shapes */
+# ifndef WCARD1
 # define STARNM 02000
 # define STARNM 02000
+# endif
+# ifndef WCARD2
 # define STARREG 04000
 # define STARREG 04000
+# endif
 # define SWADD 040000
 # define SPECIAL 0100000
 # define SZERO SPECIAL
 # define SWADD 040000
 # define SPECIAL 0100000
 # define SZERO SPECIAL
 # define NTEMP 0400
 # define NTMASK 07400
 # define REWRITE 010000
 # define NTEMP 0400
 # define NTMASK 07400
 # define REWRITE 010000
+# define EITHER 040000 /* "either" modifier for needs */
 
 
 # define MUSTDO 010000   /* force register requirements */
 
 
 # define MUSTDO 010000   /* force register requirements */
@@ -131,7 +137,7 @@ extern struct respref { int cform; int mform; } respref[];
 
 # define isbreg(r) (rstatus[r]&SBREG)
 # define istreg(r) (rstatus[r]&(STBREG|STAREG))
 
 # define isbreg(r) (rstatus[r]&SBREG)
 # define istreg(r) (rstatus[r]&(STBREG|STAREG))
-# define istnode(p) (p->op==REG && istreg(p->rval))
+# define istnode(p) (p->in.op==REG && istreg(p->tn.rval))
 
 # define TBUSY 01000
 # define REGLOOP(i) for(i=0;i<REGSZ;++i)
 
 # define TBUSY 01000
 # define REGLOOP(i) for(i=0;i<REGSZ;++i)
@@ -155,35 +161,46 @@ union ndu {
                int rall;
                TWORD type;
                int su;
                int rall;
                TWORD type;
                int su;
+               int stalign;  /* alignment of structure objects */
+#ifndef FLEXNAMES
                char name[NCHNAM];
                char name[NCHNAM];
+#else
+               char *name;
+#endif
                NODE *left;
                NODE *right;
                NODE *left;
                NODE *right;
-               };
+               }in; /* interior node */
        
        struct {
                int op;
                int rall;
                TWORD type;
                int su;
        
        struct {
                int op;
                int rall;
                TWORD type;
                int su;
+               int stalign;  /* alignment of structure objects */
+#ifndef FLEXNAMES
                char name[NCHNAM];
                char name[NCHNAM];
+#else
+               char *name;
+#endif
                CONSZ lval;
                int rval;
                CONSZ lval;
                int rval;
-               };
+               }tn; /* terminal node */
        
        struct {
                int op, rall;
                TWORD type;
                int su;
        
        struct {
                int op, rall;
                TWORD type;
                int su;
+               int stalign;  /* alignment of structure objects */
                int label;  /* for use with branching */
                int label;  /* for use with branching */
-               };
+               }bn; /* branch node */
 
        struct {
                int op, rall;
                TWORD type;
                int su;
 
        struct {
                int op, rall;
                TWORD type;
                int su;
-               int stsize;  /* sizes of structure objects */
                int stalign;  /* alignment of structure objects */
                int stalign;  /* alignment of structure objects */
-               };
+               int stsize;  /* sizes of structure objects */
+               }stn; /* structure node */
 
        };
 #endif
 
        };
 #endif
@@ -211,6 +228,7 @@ extern OFFSZ baseoff;
 extern OFFSZ maxtemp;
 extern int maxtreg;
 extern int ftnno;
 extern OFFSZ maxtemp;
 extern int maxtreg;
 extern int ftnno;
+extern int rtyflg;
 
 extern int nrecur;  /* flag to keep track of recursions */
 
 
 extern int nrecur;  /* flag to keep track of recursions */
 
@@ -247,3 +265,25 @@ extern int lflag, xdebug, udebug, edebug, odebug, rdebug, radebug, tdebug, sdebu
 # define R2UPK2(x) ((x)&0177)
 # define R2UPK3(x) (x>>14)
 # define R2TEST(x) ((x)>=0200)
 # define R2UPK2(x) ((x)&0177)
 # define R2UPK3(x) (x>>14)
 # define R2TEST(x) ((x)>=0200)
+
+# ifdef MULTILEVEL
+
+union mltemplate{
+       struct ml_head{
+               int tag; /* identifies class of tree */
+               int subtag; /* subclass of tree */
+               union mltemplate * nexthead; /* linked by mlinit() */
+               } mlhead;
+       struct ml_node{
+               int op; /* either an operator or op description */
+               int nshape; /* shape of node */
+               /* both op and nshape must match the node.
+                * where the work is to be done entirely by
+                * op, nshape can be SANY, visa versa, op can
+                * be OPANY.
+                */
+               int ntype; /* type descriptor from mfile2 */
+               } mlnode;
+       };
+
+# endif