Pristine Ack-5.5
[Ack-5.5.git] / mach / proto / ncg / data.h
1 /*
2  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3  * See the copyright notice in the ACK home directory, in the file "Copyright".
4  */
5 /* $Id: data.h,v 0.4 1994/06/24 13:27:08 ceriel Exp $ */
6
7 typedef struct cost {
8         short ct_space;
9         short ct_time;
10 } cost_t,*cost_p;
11
12 typedef struct {
13         string ea_str;
14         word ea_off;
15 } addr_t;
16
17 typedef struct {
18         int     t_token;        /* kind of token, -1 for register */
19         union {
20                 word aw;        /* integer type */
21                 addr_t aa;      /* address type */
22                 int ar;         /* register type */
23         } t_att[TOKENSIZE];
24 } token_t,*token_p;
25
26 struct reginfo {
27         int     r_repr;                 /* index in string table */
28         int     r_size;                 /* size in bytes */
29 #if MAXMEMBERS!=0
30         int     r_members[MAXMEMBERS];  /* register contained within this reg */
31         short   r_clash[REGSETSIZE];    /* set of clashing registers */
32         int     r_iclash;               /* index in clashlist; other represen-
33                                            tation of r_clash
34                                         */
35 #endif
36         int     r_refcount;             /* Times in use */
37         token_t r_contents;             /* Current contents */
38         int     r_tcount;               /* Temporary count difference */
39 };
40
41 #if MAXMEMBERS!=0
42 #define clash(a,b) ((machregs[a].r_clash[(b)>>4]&(1<<((b)&017)))!=0)
43 #else
44 #define clash(a,b) ((a)==(b))
45 #endif
46
47 typedef struct {
48         int     t_size;                 /* size in bytes */
49         cost_t  t_cost;                 /* cost in bytes and time */ 
50         byte    t_type[TOKENSIZE];      /* types of attributes, TT_??? */
51         int     t_format;               /* index of formatstring */
52 } tkdef_t,*tkdef_p;
53
54 struct emline {
55         int     em_instr;
56         int     em_optyp;
57         string  em_soper;
58         union {
59                 word    em_ioper;
60                 long    em_loper;
61         } em_u;
62 };
63
64 #define OPNO 0
65 #define OPINT 1
66 #define OPSYMBOL 2
67
68 typedef struct {
69         int rl_n;       /* number in list */
70         int rl_list[NREGS];
71 } rl_t,*rl_p;