*** empty log message ***
authorsater <none@none>
Mon, 17 Dec 1984 15:13:39 +0000 (15:13 +0000)
committersater <none@none>
Mon, 17 Dec 1984 15:13:39 +0000 (15:13 +0000)
15 files changed:
util/ncgg/assert.h [new file with mode: 0644]
util/ncgg/cost.h [new file with mode: 0644]
util/ncgg/expr.h [new file with mode: 0644]
util/ncgg/extern.h [new file with mode: 0644]
util/ncgg/instruct.h [new file with mode: 0644]
util/ncgg/iocc.h [new file with mode: 0644]
util/ncgg/lookup.h [new file with mode: 0644]
util/ncgg/param.h [new file with mode: 0644]
util/ncgg/property.h [new file with mode: 0644]
util/ncgg/pseudo.h [new file with mode: 0644]
util/ncgg/reg.h [new file with mode: 0644]
util/ncgg/regvar.h [new file with mode: 0644]
util/ncgg/set.h [new file with mode: 0644]
util/ncgg/token.h [new file with mode: 0644]
util/ncgg/varinfo.h [new file with mode: 0644]

diff --git a/util/ncgg/assert.h b/util/ncgg/assert.h
new file mode 100644 (file)
index 0000000..6e909f0
--- /dev/null
@@ -0,0 +1,7 @@
+/* $Header$ */
+
+#ifndef NDEBUG
+#define assert(x) if (!(x)) badassertion("x",__FILE__,__LINE__)
+#else
+#define assert(x)      /* nothing */
+#endif
diff --git a/util/ncgg/cost.h b/util/ncgg/cost.h
new file mode 100644 (file)
index 0000000..e5f3f52
--- /dev/null
@@ -0,0 +1,8 @@
+/* $Header$ */
+
+#define _COST_
+
+typedef struct cost {
+       int ct_space;
+       int ct_time;
+} cost_t,*cost_p;
diff --git a/util/ncgg/expr.h b/util/ncgg/expr.h
new file mode 100644 (file)
index 0000000..fb9c3e7
--- /dev/null
@@ -0,0 +1,16 @@
+/* $Header$ */
+
+typedef struct expr {
+       int     ex_typ;
+       short   ex_regset[SZOFSET(MAXREGS)];
+       int     ex_index;
+} expr_t,*expr_p;
+
+#define TYPINT  1
+#define TYPBOOL 2
+#define TYPADDR 3
+#define TYPREG  4
+
+/* When the type is register the regset contains the set of
+   possible registers for checking purposes only.
+*/
diff --git a/util/ncgg/extern.h b/util/ncgg/extern.h
new file mode 100644 (file)
index 0000000..418b526
--- /dev/null
@@ -0,0 +1,30 @@
+/* $Header$ */
+
+extern int wordsize;
+extern int pointersize;
+extern int nregs;
+extern int nprops;
+extern int ntokens;
+extern int nsets;
+extern int ninstr;
+extern int empatlen;
+extern int emmnem[];
+extern int empatexpr;
+extern int codeindex;
+extern int tokpatlen;
+extern int tokpatro[];
+extern int tokpatset[];
+extern int nallreg;
+extern int allreg[];
+extern int cursetno;
+extern int allsetno;
+extern int inproc;
+extern int callproc;
+extern int procarg[2];
+extern int fc1,fc2,fc3,fc4;
+extern int maxmembers;
+extern int regclass;
+extern int maxtokensize;
+
+extern char *mystrcpy();
+extern char *myalloc();
diff --git a/util/ncgg/instruct.h b/util/ncgg/instruct.h
new file mode 100644 (file)
index 0000000..7faf8d1
--- /dev/null
@@ -0,0 +1,37 @@
+/* $Header$ */
+
+#ifndef _COST_
+#include "cost.h"
+#endif
+
+#define AD_RO 01       /* Read only operand */
+#define AD_WO 02       /* Write only operand */        
+#define AD_RW 03       /* Read-write operand */
+#define AD_RWMASK 03   /* Mask to select these possiblities */
+
+#define AD_CC 04       /* Condition codes set to this one */
+
+typedef struct operand {
+       struct operand *o_next;
+       short           o_setno;
+       short           o_adorn;
+} operand;
+
+typedef struct instruction {
+       char            *i_name;
+       short            i_asname;
+       short            i_nops;
+       operand         *i_oplist;
+       struct varinfo  *i_erases;
+       cost_t           i_cost;
+} instr_t,*instr_p;
+
+extern instr_t l_instr[];
+
+/*
+ * The read only information on the operands is not used at the moment.
+ * Predicted future use:
+ * When using :ro data it is possible to use a register in its stead
+ * if it contains the same information and is allowed as an operand
+ * in this place. Too difficult for now.
+ */
diff --git a/util/ncgg/iocc.h b/util/ncgg/iocc.h
new file mode 100644 (file)
index 0000000..de93468
--- /dev/null
@@ -0,0 +1,6 @@
+/* $Header$ */
+
+typedef struct iocc {
+       short in_set[SETSIZE];
+       int   in_index;
+} iocc_t,*iocc_p;
diff --git a/util/ncgg/lookup.h b/util/ncgg/lookup.h
new file mode 100644 (file)
index 0000000..3967656
--- /dev/null
@@ -0,0 +1,29 @@
+/* $Header$ */
+
+typedef enum {
+       justlooking,mustexist,newsymbol,makeexist
+} lookupstyle;
+
+typedef enum {
+       symany,symkeyw,symconst,symsconst,symprop,symreg,symtok,symset,symproc
+} symtype;
+
+typedef struct symbol {
+       struct symbol *sy_next;         /* pointer to hashchain */
+       char          *sy_name;         /* symbol */
+       symtype        sy_type;         /* type */
+       union {
+           long       syv_cstval;
+           int        syv_stringno;
+           int        syv_keywno;
+           int        syv_propno;
+           int        syv_regno;
+           int        syv_tokno;
+           int        syv_setno;
+           int        syv_procoff;
+       } sy_value;
+} symbol;
+
+#define NSYMHASH 61
+extern symbol *symhash[NSYMHASH];      /* chained hashtable */
+extern symbol *lookup();
diff --git a/util/ncgg/param.h b/util/ncgg/param.h
new file mode 100644 (file)
index 0000000..1d82c1b
--- /dev/null
@@ -0,0 +1,38 @@
+/* $Header$ */
+
+/*
+ * Miscellaneous sizes, tunable 
+ */
+
+#define MAXREGS 40
+#define MAXPROPS 30
+#define MAXTOKENS 60
+#define MAXATT 3
+#define MAXSETS 100
+#define MAXINSTR 100
+#define MAXSTRINGS 250
+#define MAXNODES 300
+#define EMPATMAX 20
+#define MAXPATTERNS 20
+#define MAXALLREG 5
+#define MAXINSTANCES 300
+#define MAXMOVES 20
+#define MAXTESTS 10
+#define MAXSTACKS 30
+#define MAXCOERCS 25
+#define MAXSPLCOERC 20
+#define MAXSPLIT 2
+#define MAXPATBYTES 7000
+#define MAXREGVAR 8
+#define MAXSOURCELINES 4000
+
+/* end of tunable constants */
+
+#define TOKPATMAX 7
+
+#define SZOFSET(n) (((n)+15)/16)
+
+#define SETSIZE SZOFSET(MAXREGS+MAXTOKENS)
+
+#define NEXT(n,max,string) (n<max? n++ : tabovf(string))
+#define NEW(x,y) x=(y*)myalloc(sizeof(*(x)))
diff --git a/util/ncgg/property.h b/util/ncgg/property.h
new file mode 100644 (file)
index 0000000..9b8e680
--- /dev/null
@@ -0,0 +1,8 @@
+/* $Header$ */
+
+typedef struct propinfo {
+       int     pr_size;
+       short   pr_regset[SZOFSET(MAXREGS)];
+} propinfo;
+
+extern struct propinfo l_props[];
diff --git a/util/ncgg/pseudo.h b/util/ncgg/pseudo.h
new file mode 100644 (file)
index 0000000..fa31df5
--- /dev/null
@@ -0,0 +1,8 @@
+/* $Header$ */
+
+#define INSMOVE                (-1)
+#define INSTEST        (-2)
+#define INSPRETURN     (-3)
+#define INSTLAB                (-4)
+#define INSSETCC       (-5)
+#define INSERASE       (-6)
diff --git a/util/ncgg/reg.h b/util/ncgg/reg.h
new file mode 100644 (file)
index 0000000..0e0a221
--- /dev/null
@@ -0,0 +1,13 @@
+/* $Header$ */
+
+#define _REGINFO_
+typedef struct reginfo {
+       char *ri_name;
+       char *ri_repr;
+       int   ri_size;
+       int   ri_class;
+       int   ri_rregvar;
+       int   ri_memb[2];
+} reginfo;
+
+extern struct reginfo l_regs[];
diff --git a/util/ncgg/regvar.h b/util/ncgg/regvar.h
new file mode 100644 (file)
index 0000000..d4689e2
--- /dev/null
@@ -0,0 +1,10 @@
+/* $Header$ */
+
+#define ANY_REGVAR     0x1
+#define SL_REGVAR      0x2
+#define DL_REGVAR      0x4
+
+extern int rvused;
+extern int nregvar[4];
+extern int rvsize[4];
+extern int rvnumbers[4][MAXREGVAR];
diff --git a/util/ncgg/set.h b/util/ncgg/set.h
new file mode 100644 (file)
index 0000000..8fe393e
--- /dev/null
@@ -0,0 +1,5 @@
+/* $Header$ */
+
+#define BIS(sp,n) (sp)[(n)>>4] |= 1<<((n)&0xF)
+#define BIC(sp,n) (sp)[(n)>>4] &= ~(1<<((n)&0xF))
+#define BIT(sp,n) (((sp)[(n)>>4]&(1<<((n)&0xF)))!=0)
diff --git a/util/ncgg/token.h b/util/ncgg/token.h
new file mode 100644 (file)
index 0000000..2f48de5
--- /dev/null
@@ -0,0 +1,19 @@
+/* $Header$ */
+
+#ifndef _COST_
+#include "cost.h"
+#endif
+
+
+typedef struct token {
+       char    *tk_name;
+       int      tk_size;
+       cost_t   tk_cost;
+       struct {
+               int ta_type;    /* -1 is int, -2 is addr, >=0 is propno */
+               char *ta_name;
+       }        tk_att[MAXATT];
+       int      tk_format;
+} token_t,*token_p;
+
+extern token_p l_tokens[MAXTOKENS];
diff --git a/util/ncgg/varinfo.h b/util/ncgg/varinfo.h
new file mode 100644 (file)
index 0000000..3c23ff1
--- /dev/null
@@ -0,0 +1,13 @@
+/* $Header$ */
+
+#define VI_NSTR 1
+#define VI_NINT 3
+
+typedef struct varinfo {
+       struct varinfo *vi_next;
+       char *vi_str[VI_NSTR];
+       int vi_int[VI_NINT];
+       struct varinfo *vi_vi;
+} varinfo;
+
+#define VI_NULL (struct varinfo *) 0