9 typedef unsigned int _UNSIGNED_INT;
10 typedef unsigned long _UNSIGNED_LONG;
12 typedef double _DOUBLE;
16 typedef int32_t _LONG;
17 typedef uint16_t _UNSIGNED_INT;
18 typedef uint32_t _UNSIGNED_LONG;
19 typedef struct { uint32_t h; } _FLOAT;
20 typedef struct { uint32_t l; uint32_t h; } _DOUBLE;
28 * Structure of namelist
31 /* note: this must be compatible with struct node in respect of the */
32 /* nl_type, nl_subsp fields, because of length(), rlength() computations */
33 char nl_class; /* storage class */
34 char nl_flag; /* various flags */
36 /* note: these will be phased out in favour of nl_dtype: */
37 int nl_type; /* type */
38 int *nl_subsp; /* subscript list */
39 union str *nl_strp; /* structure description */
42 struct type *nl_dtype; /* detailed type */
43 int nl_offset; /* post-allocation location */
44 struct nmlist *nl_nextnm; /* next name in chain */
45 union str *nl_sparent; /* Structure of which this is member */
46 char nl_blklev; /* Block level of definition */
47 char *nl_name; /* ASCII name */
51 * format of a structure description
52 * Same gadget is also used for fields,
53 * which can't be structures also.
54 * Finally, it is used for parameter collection.
58 int ssize; /* structure size */
59 struct nmlist **memlist; /* member list */
62 int flen; /* field width in bits */
63 int bitoffs; /* shift count */
69 * Place used to keep dimensions
78 * tree nodes for detailed type descriptions, t_id can be:
83 * STRUCT 4 (means it's a struct stype)
84 * RSTRUCT 5 (not sure what this is; pass 1 only)
87 * UNION 8 (adjusted later to struct; pass 0 only)
91 * REF 11 (used with PTR, FUNC or ARRAY)
92 * BITFLD 12 (means it's a struct btype)
93 * PTR 020 (means it's a struct rtype)
94 * FUNC 040 (means it's a struct ftype)
95 * ARRAY 060 (means it's a struct atype)
102 #define st_id st_type.t_id
103 struct SS st_S; /* structure specification */
104 #define st_ssize st_S.ssize
105 #define st_memlist st_S.memlist
109 #define bt_id bt_type.t_id
110 struct FS bt_F; /* bitfield specification */
111 #define bt_flen bt_F.flen
112 #define bt_bitoffs bt_F.bitoffs
116 #define rt_id rt_type.t_id
117 struct type *rt_reftype; /* referenced type */
120 struct rtype ft_rtype;
121 #define ft_id ft_rtype.rt_id
122 #define ft_reftype ft_rtype.rt_reftype
123 struct nmlist **ft_arglist; /* argument list */
126 struct rtype at_rtype;
127 #define at_id at_rtype.rt_id
128 #define at_reftype at_rtype.rt_reftype
129 int at_nelt; /* number of elements */
133 * Tree node for unary and binary
137 /* note: these will be phased out in favour of n_dtype: */
139 int *n_subsp; /* subscript list for arrays; pass 0 only */
140 union str *n_strp; /* structure descr for structs; pass 0 only */
142 /*struct type *n_dtype;*/ /* detailed type */
147 #define tn_op tn_node.n_op
148 #define tn_type tn_node.n_type
149 #define tn_subsp tn_node.n_subsp
150 #define tn_strp tn_node.n_strp
151 /*#define tn_dtype tn_node.n_dtype*/
154 int tn_degree; /* pass 1 only */
162 #define nn_op nn_node.n_op
163 #define nn_type nn_node.n_type
164 #define nn_subsp nn_node.n_subsp
165 #define nn_strp nn_node.n_strp
166 /*#define nn_dtype nn_node.n_dtype*/
167 struct nmlist *nn_nmlist; /* pass 0 only */
168 char nn_class; /* pass 1 only */
169 char nn_regno; /* pass 1 only */
170 int nn_offset; /* pass 1 only */
174 * node names for locals
176 * locnn_class can be:
177 * SOFFS: %offset+L%nloc(r%regno)
178 * OFFS: %offset(r%regno) XXX this does not use nloc
179 * STATIC: %offset+L%nloc
183 struct nnode locnn_nnode;
184 #define locnn_op locnn_nnode.nn_op
185 #define locnn_type locnn_nnode.nn_type
186 #define locnn_subsp locnn_nnode.nn_subsp
187 #define locnn_strp locnn_nnode.nn_strp
188 /*#define locnn_dtype locnn_nnode.nn_dtype*/
189 #define locnn_nmlist locnn_nnode.nn_nmlist
190 #define locnn_class locnn_nnode.nn_class
191 #define locnn_regno locnn_nnode.nn_regno
192 #define locnn_offset locnn_nnode.nn_offset
193 int locnn_nloc; /* pass 1 only */
197 * node names for externals
199 * extnn_class can be:
200 * XOFFS: %offset+%name(r%regno)
201 * EXTERN: %offset+%name
204 struct nnode extnn_nnode;
205 #define extnn_op extnn_nnode.nn_op
206 #define extnn_type extnn_nnode.nn_type
207 #define extnn_subsp extnn_nnode.nn_subsp
208 #define extnn_strp extnn_nnode.nn_strp
209 /*#define extnn_dtype extnn_nnode.nn_dtype*/
210 #define extnn_nmlist extnn_nnode.nn_nmlist
211 #define extnn_class extnn_nnode.nn_class
212 #define extnn_regno extnn_nnode.nn_regno
213 #define extnn_offset extnn_nnode.nn_offset
214 char *extnn_name; /* pass 1 only */
222 #define cn_op cn_node.n_op
223 #define cn_type cn_node.n_type
224 #define cn_subsp cn_node.n_subsp
225 #define cn_strp cn_node.n_strp
226 /*#define cn_dtype cn_node.n_dtype*/
235 #define ln_op ln_node.n_op
236 #define ln_type ln_node.n_type
237 #define ln_subsp ln_node.n_subsp
238 #define ln_strp ln_node.n_strp
239 /*#define ln_dtype ln_node.n_dtype*/
247 struct cnode fn_cnode;
248 #define fn_op fn_cnode.cn_op
249 #define fn_type fn_cnode.cn_type
250 #define fn_subsp fn_cnode.cn_subsp
251 #define fn_strp fn_cnode.cn_strp
252 /*#define fn_dtype fn_cnode.cn_dtype*/
253 #define fn_value fn_cnode.cn_value
258 * Node used for field assignments
261 struct tnode fa_tnode;
262 #define fa_op fa_tnode.tn_op
263 #define fa_type fa_tnode.tn_type
264 #define fa_subsp fa_tnode.tn_subsp
265 #define fa_strp fa_tnode.tn_strp
266 /*#define fa_dtype fa_tnode.tn_dtype*/
267 #define fa_tr1 fa_tnode.tn_tr1
268 #define fa_tr2 fa_tnode.tn_tr2
269 #define fa_degree fa_tnode.tn_degree
270 _INT fa_mask; /* pass 1 only */
274 * Table for recording switches.
295 #define CAST 11 /* pass 0 only */
296 #define FSELR 11 /* pass 1 only */
297 #define ETYPE 12 /* pass 0 only */
298 #define FSELT 12 /* pass 1 only */
299 #define FSELA 16 /* pass 1 only */
300 #define ULSH 17 /* pass 1 only */
301 #define ASULSH 18 /* pass 1 only */
311 #define NULLOP0 0/*29*/ /* pass 0 only */
312 #define NULLOP 218 /* interface version */
314 #define AUTOI 27 /* pass 1 only */
315 #define AUTOD 28 /* pass 1 only */
335 #define ANDN 55 /* pass 1 only */
369 #define ASSAND 77 /* pass 0 only */
370 #define ASAND 77 /* pass 1 only */
374 #define TAND 81 /* pass 1 only */
375 #define LTIMES 82 /* pass 1 only */
376 #define LDIV 83 /* pass 1 only */
377 #define LMOD 84 /* pass 1 only */
378 #define ASANDN 85 /* pass 1 only */
379 #define LASTIMES 86 /* pass 1 only */
380 #define LASDIV 87 /* pass 1 only */
381 #define LASMOD 88 /* pass 1 only */
384 #define SIZEOF 91 /* pass 0 only */
385 #define LLSHIFT 91 /* pass 1 only */
386 #define ASLSHL 92 /* pass 1 only */
387 #define MAX 93 /* pass 0 only */
389 #define MIN 95 /* pass 0 only */
392 #define CALL1 98 /* pass 1 only */
393 #define CALL2 99 /* pass 1 only */
400 #define LOAD 106 /* pass 1 only */
401 #define PTOI1 107 /* pass 1 only */
406 * Intermediate code operators
413 #define STRSET 116 /* pass 1 only */
414 #define UDIV 117 /* pass 1 only */
415 #define UMOD 118 /* pass 1 only */
416 #define ASUDIV 119 /* pass 1 only */
417 #define ASUMOD 120 /* pass 1 only */
418 #define ULTIMES 121 /* present for symmetry; pass 1 only */
419 #define ULDIV 122 /* pass 1 only */
420 #define ULMOD 123 /* pass 1 only */
421 #define ULASTIMES 124 /* present for symmetry; pass 1 only */
422 #define ULASDIV 125 /* pass 1 only */
423 #define ULASMOD 126 /* pass 1 only */
424 #define ULTOF 127 /* pass 1 only */
425 #define ULLSHIFT 128 /* << for unsigned long; pass 1 only */
426 #define UASLSHL 129 /* <<= for unsigned long; pass 1 only */
428 #define SEOF 200 /* stack EOF marker in expr compilation; pass 0 only */
431 * Special operators in intermediate code
434 #define WDATA 201 /* pass 0 only */
452 #define GLOBAL 221 /* pass 1 only */
453 #define C3BRANCH 222 /* pass 1 only */
464 #define RSTRUCT 5 /* pass 1 only */
467 #define UNION 8 /* adjusted later to struct; pass 0 only */
474 #define ALIGN 01 /* pass 0 only */
476 #define BIGTYPE 060000 /* pass 0 only */
478 #define XTYPE (03<<4)
487 #define TYPEDEF 9 /* pass 0 only */
495 #define ARG1 17 /* pass 0 only */
496 #define AREG 18 /* pass 0 only */
497 #define DEFXTRN 20 /* pass 0 only */
498 #define MOU 21 /* pass 0 only */
499 #define ENUMTAG 22 /* pass 0 only */
500 #define ENUMCON 24 /* pass 0 only */
501 #define OFFS 20 /* pass 1 only */
502 #define XOFFS 21 /* pass 1 only */
503 #define SOFFS 22 /* pass 1 only */
518 #define PCVOK 040000 /* pass 0 only */
519 #define CNVRT 01000 /* pass 1 only */
522 extern FILE *temp_fp[2];
527 #define __P(args) args
534 int fp_tst __P((_DOUBLE val));
535 _DOUBLE fp_abs __P((_DOUBLE val));
536 _DOUBLE fp_neg __P((_DOUBLE val));
537 int fp_le __P((_DOUBLE val0, _DOUBLE val1));
538 int fp_ge __P((_DOUBLE val0, _DOUBLE val1));
539 int fp_gt __P((_DOUBLE val0, _DOUBLE val1));
540 int fp_lt __P((_DOUBLE val0, _DOUBLE val1));
541 _INT fp_double_to_int __P((_DOUBLE val));
542 _LONG fp_double_to_long __P((_DOUBLE val));
543 _FLOAT fp_double_to_float __P((_DOUBLE val));
544 _DOUBLE fp_int_to_double __P((_INT val));
545 _DOUBLE fp_long_to_double __P((_LONG val));
546 _DOUBLE fp_float_to_double __P((_FLOAT val));
547 _DOUBLE fp_add __P((_DOUBLE val0, _DOUBLE val1));
548 _DOUBLE fp_sub __P((_DOUBLE val0, _DOUBLE val1));
549 _DOUBLE fp_mul __P((_DOUBLE val0, _DOUBLE val1));
550 _DOUBLE fp_div __P((_DOUBLE val0, _DOUBLE val1));
551 _DOUBLE fp_ldexp __P((_DOUBLE val, _INT exp));
554 _DOUBLE fp_atof __P((register char *p));