OpenCores
URL https://opencores.org/ocsvn/thor/thor/trunk

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [software/] [CC64/] [source/] [const.h] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 robfinch
#ifndef _CONST_H
2
#define _CONST_H
3
 
4
enum e_bt {
5
                bt_none,
6
                bt_byte, bt_ubyte,
7
        bt_char, bt_short, bt_long, bt_float, bt_double, bt_triple, bt_quad, bt_pointer,
8
                bt_uchar, bt_ushort, bt_ulong,
9
        bt_unsigned, bt_vector, bt_vector_mask,
10
        bt_struct, bt_union, bt_class, bt_enum, bt_void,
11
        bt_func, bt_ifunc, bt_label,
12
                bt_interrupt, bt_oscall, bt_pascal, bt_kernel, bt_bitfield, bt_ubitfield,
13
                bt_exception, bt_ellipsis,
14
        bt_last};
15
 
16
enum e_node {
17
        en_void,        /* used for parameter lists */
18
                en_list, en_aggregate,
19
                en_cbu, en_ccu, en_chu,
20
                en_cubu, en_cucu, en_cuhu,
21
                en_cbw, en_ccw, en_chw,
22
                en_cubw, en_cucw, en_cuhw,
23
                en_cucwp, en_ccwp,
24
 
25
        en_cbc, en_cbh,
26
                en_cch,
27
                en_cwl, en_cld, en_cfd,
28
                en_sxb, en_sxc, en_sxh,
29
                en_zxb, en_zxc, en_zxh,
30
        en_icon, en_fcon, en_fqcon, en_dcon, en_tcon, en_labcon, en_nacon, en_autocon, en_autofcon, en_classcon,
31
                en_clabcon, en_cnacon,
32
                en_dlabcon, en_dnacon, // 30<-
33
 
34
                en_c_ref, en_uc_ref, en_h_ref, en_uh_ref,
35
        en_b_ref, en_w_ref, en_ub_ref, en_uw_ref,
36
                en_ref32, en_ref32u,
37
                en_hp_ref, en_wp_ref,
38
        en_fcall, en_ifcall,
39
         en_tempref, en_regvar, en_fpregvar, en_tempfpref,
40
                en_add, en_sub, en_mul, en_mod,
41
                en_ftadd, en_ftsub, en_ftmul, en_ftdiv,
42
                en_fdadd, en_fdsub, en_fdmul, en_fddiv,
43
                en_fsadd, en_fssub, en_fsmul, en_fsdiv,
44
                en_fadd, en_fsub, en_fmul, en_fdiv,
45
                en_d2t, en_d2q, en_t2q,
46
                en_i2d, en_i2t, en_i2q, en_d2i, en_q2i, en_s2q, en_t2i, // 63<-
47
        en_div, en_asl, en_shl, en_shlu, en_shr, en_shru, en_asr, en_rol, en_ror,
48
                en_cond, en_assign,
49
        en_asadd, en_assub, en_asmul, en_asdiv, en_asdivu, en_asmod, en_asmodu,
50
                en_asrsh, en_asrshu, en_asmulu, //81
51
        en_aslsh, en_asand, en_asor, en_asxor, en_uminus, en_not, en_compl,
52
        en_eq, en_ne, en_lt, en_le, en_gt, en_ge,
53
        en_feq, en_fne, en_flt, en_fle, en_fgt, en_fge,
54
        en_veq, en_vne, en_vlt, en_vle, en_vgt, en_vge,
55
                en_and, en_or, en_land, en_lor, //104
56
        en_xor, en_mulu, en_udiv, en_umod, en_ugt,
57
        en_uge, en_ule, en_ult,
58
                en_ref, en_ursh,
59
                en_uwfieldref,en_wfieldref,en_bfieldref,en_ubfieldref,
60
                en_uhfieldref,en_hfieldref,en_ucfieldref,en_cfieldref,
61
                en_dbl_ref, en_flt_ref, en_triple_ref, en_quad_ref,
62
                en_bchk, en_chk,
63
                en_abs, en_max, en_min,
64
                // Vector
65
                en_autovcon, en_autovmcon, en_vector_ref, en_vex, en_veins,
66
                en_vadd, en_vsub, en_vmul, en_vdiv,
67
                en_vadds, en_vsubs, en_vmuls, en_vdivs,
68
 
69
                en_object_list
70
                };
71
 
72
enum e_stmt {
73
                st_empty, st_funcbody,
74
        st_expr, st_compound, st_while,
75
                st_until, st_forever, st_firstcall, st_asm,
76
                st_dountil, st_doloop, st_dowhile, st_doonce,
77
                st_try, st_catch, st_throw, st_critical, st_spinlock, st_spinunlock,
78
                st_for,
79
                st_do, st_if, st_switch, st_default,
80
        st_case, st_goto, st_break, st_continue, st_label,
81
        st_return, st_vortex, st_intoff, st_inton, st_stop, st_check };
82
 
83
enum e_am {
84
                am_none = 0,
85
        am_reg = 1,
86
                am_fpreg = 2,
87
                am_vreg = 4,
88
                am_vmreg = 8,
89
                am_ind = 16,
90
                am_indx = 32,
91
                am_indx2 = 64,
92
        am_direct = 128,
93
                am_mem = 240,
94
                am_imm = 256,
95
                am_i5 = 512,
96
                am_ui6 = 1024,
97
                am_i8 = 2048,   // BEQI
98
                am_i26 = 4096,
99
                am_mask = 8192,
100
                am_ainc = 16384,
101
                am_adec = 32768,
102
                am_brind = 65536,
103
                am_breg = 131072,
104
                am_sreg = 262144
105
        };
106
 
107
enum e_sym {
108
        tk_nop,
109
        id, cconst, iconst, lconst, sconst, rconst, plus, minus,
110
        star, divide, lshift, rshift, lrot, rrot,
111
        modop, eq, neq, lt, leq, gt,
112
        geq, assign, asplus, asminus, astimes, asdivide, asmodop,
113
        aslshift, asrshift, aslrot, asrrot,
114
        asand, asor, asxor, autoinc, autodec, hook, cmpl,
115
        comma, colon, semicolon, double_colon, uparrow, openbr, closebr, begin, end,
116
        openpa, closepa, pointsto, dot, lor, land, nott, bitorr, bitandd,
117
        ellipsis,
118
        // functions
119
        kw_abs, kw_max, kw_min,
120
 
121
        kw_vector, kw_vector_mask,
122
        kw_int, kw_byte, kw_int8, kw_int16, kw_int32, kw_int40, kw_int64, kw_int80,
123
        kw_float128,
124
        kw_icache, kw_dcache, kw_thread,
125
        kw_void, kw_char, kw_float, kw_double, kw_triple,
126
        kw_struct, kw_union, kw_class,
127
        kw_long, kw_short, kw_unsigned, kw_auto, kw_extern,
128
        kw_register, kw_typedef, kw_static, kw_goto, kw_return,
129
        kw_sizeof, kw_break, kw_continue, kw_if, kw_else, kw_elsif,
130
        kw_for, kw_forever, kw_signed,
131
        kw_firstcall, kw_asm, kw_fallthru, kw_until, kw_loop,
132
        kw_try, kw_catch, kw_throw, kw_typenum, kw_const, kw_volatile,
133
        kw_do, kw_while, kw_switch, kw_case, kw_default, kw_enum,
134
        kw_interrupt, kw_vortex, kw_pascal, kw_oscall, kw_nocall, kw_naked,
135
        kw_intoff, kw_inton, kw_then,
136
        kw_private, kw_public, kw_stop, kw_critical, kw_spinlock, kw_spinunlock, kw_lockfail,
137
        kw_cdecl, kw_align, kw_prolog, kw_epilog, kw_check, kw_exception, kw_task,
138
        kw_unordered, kw_inline, kw_kernel, kw_inout, kw_leafs,
139
        kw_unique, kw_virtual, kw_this,
140
        kw_new, kw_delete, kw_using, kw_namespace, kw_not, kw_attribute,
141
        kw_no_temps, kw_no_parms, kw_floatmax,
142
        my_eof
143
};
144
 
145
enum e_sc {
146
        sc_static, sc_auto, sc_global, sc_thread, sc_external, sc_type, sc_const,
147
        sc_member, sc_label, sc_ulabel, sc_typedef, sc_register
148
};
149
 
150
enum e_sg { noseg, codeseg, dataseg, stackseg, bssseg, idataseg, tlsseg, rodataseg };
151
 
152
enum e_op {
153
        op_move, op_add, op_addu, op_addi, op_sub, op_subi, op_mov, op_mtspr, op_mfspr, op_ldi, op_ld,
154
        op_mul, op_muli, op_mulu, op_divi, op_modi, op_modui,
155
        op_div, op_divs, op_divsi, op_divu, op_and, op_andi, op_eor, op_eori,
156
        op_or, op_ori, op_xor, op_xori, op_redor,
157
        op_nand, op_nor, op_xnor,
158
        op_asr, op_asri, op_shl, op_shr, op_shru, op_ror, op_rol,
159
        op_shli, op_shri, op_shrui, op_shlu, op_shlui, op_rori, op_roli,
160
        op_bfext, op_bfextu, op_bfins,
161
        op_jmp, op_jsr, op_mului, op_mod, op_modu,
162
        op_bmi, op_subu, op_lwr, op_swc, op_loop, op_iret,
163
        op_sext32, op_sext16, op_sext8, op_sxb, op_sxc, op_sxh, op_zxb, op_zxc, op_zxh,
164
        op_dw, op_cache,
165
        op_subui, op_addui, op_sei,
166
        op_sw, op_sh, op_sc, op_sb, op_outb, op_inb, op_inbu,
167
        op_sfd, op_lfd,
168
        op_call, op_jal, op_beqi, op_bnei, op_tst,
169
 
170
        op_beq, op_bne, op_blt, op_ble, op_bgt, op_bge,
171
        op_bltu, op_bleu, op_bgtu, op_bgeu,
172
        op_bltui, op_bleui, op_blti, op_blei, op_bgti, op_bgtui, op_bgei, op_bgeui,
173
        op_bbs, op_bbc, op_bor,
174
 
175
        op_brz, op_brnz, op_br,
176
        op_lft, op_sft,
177
        op_lw, op_lh, op_lc, op_lb, op_ret, op_sm, op_lm, op_ldis, op_lws, op_sws,
178
        op_lvb, op_lvc, op_lvh, op_lvw,
179
        op_inc, op_dec,
180
        op_lbu, op_lcu, op_lhu, op_sti,
181
        op_lf, op_sf,
182
        op_rts, op_rtd,
183
        op_push, op_pop, op_movs,
184
        op_seq, op_sne, op_slt, op_sle, op_sgt, op_sge, op_sltu, op_sleu, op_sgtu, op_sgeu,
185
        op_bra, op_bf, op_eq, op_ne, op_lt, op_le, op_gt, op_ge,
186
        op_feq, op_fne, op_flt, op_fle, op_fgt, op_fge,
187
        op_gtu, op_geu, op_ltu, op_leu, op_nr,
188
        op_bhi, op_bhs, op_blo, op_bls, op_ext, op_lea, op_swap,
189
        op_neg, op_not, op_com, op_cmp, op_clr, op_link, op_unlk, op_label,
190
        op_pea, op_cmpi, op_dc, op_asm, op_stop, op_fnname,
191
        // FISA64
192
        op_lc0i, op_lc1i, op_lc2i, op_lc3i, op_chk, op_chki,
193
        op_cmpu, op_bsr, op_bun,
194
        op_sll, op_slli, op_srl, op_srli, op_sra, op_srai, op_asl, op_lsr, op_asli, op_lsri, op_rem,
195
        // floating point
196
        op_fbeq, op_fbne, op_fbor, op_fbun, op_fblt, op_fble, op_fbgt, op_fbge,
197
        op_fcvtsq, op_fcvtdq, op_fcvttq,
198
        op_fadd, op_fsub, op_fmul, op_fdiv, op_fcmp, op_fneg,
199
        op_ftmul, op_ftsub, op_ftdiv, op_ftadd, op_ftneg, op_ftcmp,
200
        op_fdmul, op_fdsub, op_fddiv, op_fdadd, op_fdneg, op_fdcmp,
201
        op_fsmul, op_fssub, op_fsdiv, op_fsadd, op_fsneg, op_fscmp,
202
        op_fs2d, op_i2d, op_i2t, op_ftoi, op_itof, op_qtoi,
203
        op_fmov,
204
        op_fdmov, op_fix2flt, op_mtfp, op_mffp, op_flt2fix, op_mv2flt, op_mv2fix,
205
        // Vector
206
        op_lv, op_sv,
207
        op_vadd, op_vsub, op_vmul, op_vdiv,
208
        op_vadds, op_vsubs, op_vmuls, op_vdivs,
209
        op_vseq, op_vsne,
210
        op_vslt, op_vsge, op_vsle, op_vsgt,
211
        op_vex, op_veins,
212
        // DSD9
213
        op_ldd, op_ldb, op_ldp, op_ldw, op_ldbu, op_ldwu, op_ldpu, op_ldt, op_ldtu,
214
        op_std, op_stb, op_stp, op_stw, op_stt, op_calltgt,
215
        op_csrrw, op_nop,
216
        op_hint, op_hint2, op_rem2,
217
        // FT64
218
        op_fslt, op_fsle, op_fsgt, op_fsge, op_fseq, op_fsne, op_fsun,
219
        op_divmod,
220
        op_pushf, op_popf, op_mov2, op_sort, op_demux,
221
        op_lvbu, op_lvcu, op_lvhu,
222
        op_cmovenz,
223
        op_sptr, op_isptr, op_setwb, op_spt,
224
        op_bchk, op_ibne, op_dbnz,
225
        op_brk, op_rti, op_rte, op_bex,
226
        op_addq1, op_addq2, op_addq3,
227
        op_andq1, op_andq2, op_andq3,
228
        op_orq1, op_orq2, op_orq3,
229
        op_swp,
230
        // Built in functions
231
        op_abs,
232
        op_phi,
233
    op_empty
234
};
235
 
236
#define F_REG   1       /* register direct mode allowed */
237
#define F_BREG  2               /* branch register */
238
#define F_MEM   4       /* memory alterable modes allowed */
239
#define F_IMMED 8       /* immediate mode allowed */
240
#define F_ALT   7       /* alterable modes */
241
#define F_DALT  5       /* data alterable modes */
242
#define F_VOL   16      /* need volitile operand */
243
#define F_IMMED18       64      // 18-bit immediate constant
244
#define F_IMM0  128             /* immediate value 0 */
245
#define F_IMM8  256
246
#define F_IMMED13  512
247
#define F_FPREG 1024
248
#define F_IMM6  2048
249
#define BF_ASSIGN       4096
250
#define F_VREG  8192
251
#define F_VMREG 16384
252
#define F_ALL   (15|1024|F_VREG|F_VMREG)      /* all modes allowed */
253
#define F_NOVALUE 32768         /* dont need result value */
254
 
255
enum e_seg {
256
        op_ns = 0,
257
        op_ds = 1 << 8,
258
        op_ts = 2 << 8,
259
        op_bs = 3 << 8,
260
        op_rs = 4 << 8,
261
        op_es = 5 << 8,
262
        op_seg6 = 6 << 8,
263
        op_seg7 = 7 << 8,
264
        op_seg8 = 8 << 8,
265
        op_seg9 = 9 << 8,
266
        op_seg10 = 10 << 8,
267
        op_seg11 = 11 << 8,
268
        op_seg12 = 12 << 8,
269
        op_seg13 = 13 << 8,
270
        op_ss = 14 << 8,
271
        op_cs = 15 << 8
272
};
273
 
274
#define LR              1
275
#define CLR             11
276
 
277
#define BP              26
278
#define SP              27
279
 
280
#define DS              0x21
281
#define BSS             0x23
282
#define LS              0x29
283
#define XLS             0x2A
284
#define SS              0x2E
285
#define CS              0x2F
286
 
287
#define MAX_STRLEN      120
288
#define MAX_STLP1       121
289
#define ERR_SYNTAX      0
290
#define ERR_ILLCHAR     1
291
#define ERR_FPCON       2
292
#define ERR_ILLTYPE     3
293
#define ERR_UNDEFINED   4
294
#define ERR_DUPSYM      5
295
#define ERR_PUNCT       6
296
#define ERR_IDEXPECT    7
297
#define ERR_NOINIT      8
298
#define ERR_INCOMPLETE  9
299
#define ERR_ILLINIT     10
300
#define ERR_INITSIZE    11
301
#define ERR_ILLCLASS    12
302
#define ERR_BLOCK       13
303
#define ERR_NOPOINTER   14
304
#define ERR_NOFUNC      15
305
#define ERR_NOMEMBER    16
306
#define ERR_LVALUE      17
307
#define ERR_DEREF       18
308
#define ERR_MISMATCH    19
309
#define ERR_EXPREXPECT  20
310
#define ERR_WHILEXPECT  21
311
#define ERR_NOCASE      22
312
#define ERR_DUPCASE     23
313
#define ERR_LABEL       24
314
#define ERR_PREPROC     25
315
#define ERR_INCLFILE    26
316
#define ERR_CANTOPEN    27
317
#define ERR_DEFINE      28
318
#define ERR_CATCHEXPECT 29
319
#define ERR_BITFIELD_WIDTH      30
320
#define ERR_EXPRTOOCOMPLEX      31
321
#define ERR_ASMTOOLONG  32
322
#define ERR_TOOMANYCASECONSTANTS        33
323
#define ERR_CATCHSTRUCT         34
324
#define ERR_SEMA_INCR   35
325
#define ERR_SEMA_ADDR   36
326
#define ERR_UNDEF_OP    37
327
#define ERR_INT_CONST   38
328
#define ERR_BAD_SWITCH_EXPR     39
329
#define ERR_NOT_IN_LOOP 40
330
#define ERR_CHECK       41
331
#define ERR_BADARRAYNDX 42
332
#define ERR_TOOMANYDIMEN        43
333
#define ERR_OUTOFPREDS  44 
334
#define ERR_PARMLIST_MISMATCH   45
335
#define ERR_PRIVATE             46
336
#define ERR_CALLSIG2    47
337
#define ERR_METHOD_NOTFOUND     48
338
#define ERR_OUT_OF_MEMORY   49
339
#define ERR_TOOMANY_SYMBOLS 50
340
#define ERR_TOOMANY_PARAMS  51
341
#define ERR_THIS            52
342
#define ERR_BADARG                      53
343
#define ERR_CSETABLE            54
344
#define ERR_UBLTZ                       55
345
#define ERR_UBGEQ                       56
346
#define ERR_INFINITELOOP        57
347
#define ERR_TOOMANYELEMENTS     58
348
#define ERR_CONST                       59
349
#define ERR_INIT_UNION      60
350
#define ERR_LOST_PREC           61
351
#define ERR_TOOMANY_TREES       62
352
#define ERR_STACKFULL           63
353
#define ERR_STACKEMPTY          64
354
#define ERR_IGNODES                     65
355
#define ERR_NULLPOINTER         1000
356
#define ERR_CIRCULAR_LIST 1001
357
 
358
/*      alignment sizes         */
359
 
360
#define AL_BYTE                 1
361
#define AL_CHAR         2
362
#define AL_SHORT        4
363
#define AL_LONG         8
364
#define AL_POINTER      8
365
#define AL_FLOAT        8
366
#define AL_DOUBLE       8
367
#define AL_QUAD                 16
368
#define AL_STRUCT       2
369
#define AL_TRIPLE       12
370
 
371
#define TRUE    1
372
#define FALSE   0
373
//#define NULL  ((void *)0)
374
 
375
// Register classes for instructions
376
#define RC_GP   1
377
#define RC_FP   2
378
#define RC_VEC  4
379
#define RC_ALL  7
380
 
381
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.