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

Subversion Repositories raptor64

[/] [raptor64/] [trunk/] [software/] [c64/] [source/] [Gen.h] - Blame information for rev 43

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 37 robfinch
/*
2
 *      code generation structures and constants
3
 */
4
 
5
#define F_REG   1       /* register direct mode allowed */
6
#define F_MEM   4       /* memory alterable modes allowed */
7
#define F_IMMED 8       /* immediate mode allowed */
8
#define F_ALT   7       /* alterable modes */
9
#define F_DALT  5       /* data alterable modes */
10
#define F_ALL   15      /* all modes allowed */
11
#define F_VOL   16      /* need volitile operand */
12
#define F_NOVALUE 32    /* dont need result value */
13
#define F_IMMED18       64              // 18-bit immediate constant
14
 
15
/*      addressing mode structure       */
16
 
17
typedef struct amode {
18
        unsigned int mode : 4;
19
        unsigned int preg : 6;
20
        unsigned int sreg : 6;
21
        unsigned int tempflag : 1;
22
        int deep;           /* stack depth on allocation */
23
        struct enode *offset;
24
} AMODE;
25
 
26
/*      output code structure   */
27
 
28
struct ocode {
29
        struct ocode *fwd, *back;
30
        short opcode;
31
        short length;
32
        AMODE *oper1, *oper2, *oper3;
33
};
34
 
35
enum e_op {
36
        op_move, op_add, op_addu, op_addi, op_sub, op_subi, op_mov,
37
        op_muls, op_mulsi, op_mulu, op_divs, op_divsi, op_divu, op_and, op_andi,
38
        op_or, op_ori, op_xor, op_xori, op_asr, op_shl, op_shr, op_shru,
39
                op_shli, op_shri, op_shrui,
40
                op_jmp, op_mului, op_mod, op_modu,
41
                op_tas, op_bmi, op_subu, op_lwr, op_swc, op_loop, op_iret,
42
                op_sext32,op_sext16,op_sext8, op_dw, op_cache,
43
                op_subui, op_addui, op_sei,
44
                op_sw, op_sh, op_sc, op_sb,
45
                op_call, op_jal, op_beqi, op_bnei,
46
                op_lw, op_lh, op_lc, op_lb, op_ret, op_sm, op_lm,
47
        op_rts, op_bra, op_bf, op_beq, op_bne, op_blt, op_ble, op_bgt, op_bge,
48
                op_bgtu, op_bgeu, op_bltu, op_bleu, op_bnr,
49
        op_bhi, op_bhs, op_blo, op_bls, op_tst, op_ext, op_lea, op_swap,
50
        op_neg, op_not, op_cmp, op_clr, op_link, op_unlk, op_label, op_ilabel,
51
        op_pea, op_cmpi, op_dc, op_asm, op_stop, op_empty };
52
 
53
enum e_am {
54
        am_reg, am_ind, am_ainc, am_adec, am_indx, am_indx2,
55
        am_direct, am_immed, am_mask, am_none, am_indx3
56
        };
57
 

powered by: WebSVN 2.1.0

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