|
|
1.1 root 1: /*
2: * h/ops.h
3: * This file defines everything which is shared between passes of the compiler.
4: * This includes limits, types, and
5: * the opcodes, both in the scratch files and in trees,
6: * that are used by all parts of the C compiler
7: * and any other compilers that use the C compiler back end
8: * (coder and optimizer).
9: */
10:
11: /*
12: * Limits.
13: */
14: #define NARGS 32 /* Max. args in a function */
15: #define NCSYMB 256 /* Max symbol */
16: #define NMNAME 64 /* Longest module name */
17:
18: /*
19: * Scratch file operators.
20: */
21: #define NOTUSED 0 /* Pads block in RSX */
22: #define FNAME 1 /* File name */
23: #define LLABEL 2 /* Local label */
24: #define FINISH 3 /* Soft end of file */
25: #define GLABEL 4 /* Global label */
26: #define SLABEL 5 /* Static label */
27: #define BLOCK 6 /* Block of bytes */
28: #define PROLOG 7 /* Function prolog */
29: #define EPILOG 8 /* Function epilog */
30: #define LLLINK 9 /* Switch table link */
31: #define AUTOS 10 /* Auto adjust */
32: #define JUMP 11 /* Jump */
33: #define CODE 12 /* Machine instruction */
34: #define LINE 13 /* Line # */
35: #define REXPR 14 /* Return expression */
36: #define EEXPR 15 /* Effect expression */
37: #define SEXPR 16 /* Switch expression */
38: #define SBODY 17 /* Switch body */
39: #define IEXPR 18 /* Init. expression */
40: #define IBLOCK 19 /* Init. absolute block */
41: #define ALIGN 20 /* Alignment */
42: #define TEXPR 21 /* True jump expression */
43: #define FEXPR 22 /* False jump expression */
44: #define ENTER 23 /* Enter an area */
45: #define MNAME 24 /* Module name */
46: #define COMM 25 /* Common in D space */
47: #define DLOCAT 26 /* Debug label location */
48: #define DLABEL 27 /* Debug label item */
49: /* Segment guess, withdrawn */
50: #define UREFER 29 /* Undefined reference for floating printf */
51:
52: /*
53: * Symbolic segments. The "SANY" code is
54: * never used in an "ENTER"; it only appears as a
55: * segment residence flag in an identifier ("LID" or
56: * "GID") node.
57: */
58: #define SCODE 0 /* Code */
59: #define SLINK 1 /* Links et al; can be code */
60: #define SPURE 2 /* Pure data */
61: #define SSTRN 3 /* Strings */
62: #define SDATA 4 /* General data */
63: #define SBSS 5 /* Uninitialized data */
64: #define SANY 6 /* Any segment */
65: #define SSTACK 7 /* Stack segment */
66: #define SALIEN 8 /* Some other language */
67: #define SDBG 9 /* Debugging information */
68: #define SSYM 10 /* Symbol declarations */
69:
70: #define NSEG 11 /* Number of segments */
71:
72: /*
73: * Tree operators.
74: * Operators are divided into
75: * little subranges.
76: * 0<=x<=9 Machine independent leaf.
77: * 10<=x<=19 Machine specific leaf.
78: * 20<=x<=79 Machine independent operator.
79: * 80<=x<=99 Machine specific operator.
80: * 100 up. Keywords, etc. for a parser.
81: * No tree passed to the code generator
82: * can contain a machine specific
83: * operator.
84: */
85: #define MILBASE 0 /* Machine independent leaf base */
86: #define MDLBASE 15 /* Machine dependent leaf base */
87: #define MIOBASE 20 /* Machine independent operator base */
88: #define MDOBASE 80 /* Machine dependent operator base */
89: #define ETCBASE 100 /* Misc. base */
90:
91: #define NIL 0 /* End of tree */
92: #define ICON 1 /* Integer constant */
93: #define LCON 2 /* Long constant */
94: #define DCON 3 /* Double constant */
95: #define LID 5 /* Local id */
96: #define GID 6 /* Global id */
97: #define REG 7 /* Register */
98: #define AID 8 /* Automatic id */
99: #define PID 9 /* Parameter id */
100: #define ZCON 10 /* Sizeof constant */
101:
102: #define ADD 20 /* + */
103: #define SUB 21 /* - */
104: #define MUL 22 /* * */
105: #define DIV 23 /* / */
106: #define REM 24 /* % */
107: #define AND 25 /* & */
108: #define OR 26 /* | */
109: #define XOR 27 /* ^ */
110: #define SHL 28 /* << */
111: #define SHR 29 /* >> */
112:
113: #define AADD 30 /* += */
114: #define ASUB 31 /* -= */
115: #define AMUL 32 /* *= */
116: #define ADIV 33 /* /= */
117: #define AREM 34 /* %= */
118: #define AAND 35 /* &= */
119: #define AOR 36 /* |= */
120: #define AXOR 37 /* ^= */
121: #define ASHL 38 /* <<= */
122: #define ASHR 39 /* >>= */
123:
124: #define EQ 40 /* == */
125: #define NE 41 /* != */
126: #define GT 42 /* > */
127: #define GE 43 /* >= */
128: #define LE 44 /* <= */
129: #define LT 45 /* < */
130: #define UGT 46 /* > if unsigned */
131: #define UGE 47 /* >= if unsigned */
132: #define ULE 48 /* <= if unsigned */
133: #define ULT 49 /* < if unsigned */
134:
135: #define STAR 50 /* Indirection */
136: #define ADDR 51 /* Address of */
137: #define NEG 52 /* - */
138: #define COM 53 /* ~ */
139: #define NOT 54 /* ! */
140: #define QUEST 55 /* ? */
141: #define COLON 56 /* : */
142: #define INCBEF 57 /* ++ prefix */
143: #define DECBEF 58 /* -- prefix */
144: #define INCAFT 59 /* ++ postfix */
145: #define DECAFT 60 /* -- postfix */
146: #define COMMA 61 /* , */
147: #define CALL 62 /* Call of function */
148: #define ANDAND 63 /* && */
149: #define OROR 64 /* || */
150: #define CAST 65 /* Type cast */
151: #define CONVERT 66 /* Conversion */
152: #define FIELD 67 /* Field op */
153: #define SIZEOF 68 /* sizeof */
154: #define ASSIGN 69 /* = */
155: #define NOP 70 /* Drain */
156: #define INIT 71 /* Init. type */
157: #define ARGLST 72 /* Link for arglist */
158: #define LEAF 73 /* Leaf node */
159: #define FIXUP 74 /* Table fix up */
160: #define BLKMOVE 75 /* Block move operation */
161: #define POS 76 /* Unary plus */
162:
163: /*
164: * Special names for Types, Dims, and Storage classes
165: * for use in passing debugger type information between passes.
166: */
167: #define DT_NONE 0 /* No type (yet) */
168: #define DT_CHAR 1 /* Char */
169: #define DT_UCHAR 2 /* Unsigned char */
170: #define DT_SHORT 3 /* Short */
171: #define DT_USHORT 4 /* Unsigned short */
172: #define DT_INT 5 /* Int */
173: #define DT_UINT 6 /* Unsigned int */
174: #define DT_LONG 7 /* Long */
175: #define DT_ULONG 8 /* Unsigned long */
176: #define DT_FLOAT 9 /* Float */
177: #define DT_DOUBLE 10 /* Double */
178: #define DT_VOID 11 /* void */
179: #define DT_STRUCT 12 /* Struct */
180: #define DT_UNION 13 /* Union */
181: #define DT_ENUM 14 /* Enumeration */
182:
183: #define DD_PTR 15 /* Pointer */
184: #define DD_FUNC 16 /* Function returning */
185: #define DD_ARRAY 17 /* Array */
186:
187: #define DX_MEMBS 18 /* Member list */
188: #define DX_NAME 19 /* Named type */
189:
190: /*
191: * Subranges denote associated information:
192: * SEX-LAB only name string.
193: * AUTO-CALL name and (int) value.
194: * MOS-MOU name, width, offset, value.
195: */
196: #define DC_SEX 21 /* Static external */
197: #define DC_GDEF 22 /* Global def. */
198: #define DC_GREF 23 /* Global ref. */
199: #define DC_TYPE 24 /* Typedef name */
200: #define DC_STAG 25 /* Structure tag */
201: #define DC_UTAG 26 /* Union tag */
202: #define DC_ETAG 27 /* Enumeration tag */
203: #define DC_FILE 28 /* Source file name */
204: #define DC_LINE 29 /* Line number */
205: #define DC_LAB 30 /* Label */
206:
207: #define DC_AUTO 31 /* Auto */
208: #define DC_PAUTO 32 /* Parametric auto */
209: #define DC_REG 33 /* Register */
210: #define DC_PREG 34 /* Parametric register */
211: #define DC_SIN 35 /* Static internal */
212: #define DC_MOE 36 /* Member of enumeration */
213: #define DC_CALL 37 /* Function call */
214:
215: #define DC_MOS 38 /* Member of structure */
216: #define DC_MOU 39 /* Member of union */
217:
218: /* end of h/ops.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.