annotate mc-code.h @ 116:b14ff9671c90 self-compile-passed

register offset fix
author kono
date Fri, 21 Mar 2003 04:41:02 +0900
parents 7aa449aff3e6
children 07b91b625f84
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
1 /* function required by mc-codegen.c
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
2 mc-code-*.c have to provied these
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
3 */
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
4
83
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
5 extern int size_of_int;
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
6 extern int size_of_float;
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
7 extern int size_of_double;
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
8 extern int size_of_longlong;
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
9 extern int endian;
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
10 extern int MAX_REGISTER;
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
11 extern int MAX_REGISTGER_VAR;
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
12 extern int MAX_FREGISTER;
103
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
13
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
14 extern int MAX_INPUT_REGISTER_VAR;
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
15 extern int MAX_CODE_INPUT_REGISTER_VAR;
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
16 extern int MAX_INPUT_DREGISTER_VAR;
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
17 extern int MAX_CODE_INPUT_DREGISTER_VAR;
99
53899975154c *** empty log message ***
kono
parents: 97
diff changeset
18
94
1ad7045741a7 float dbinop fix
kono
parents: 93
diff changeset
19 #define REG_LVAR_OFFSET 2
83
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
20
102
3cf2f8c120b9 *** empty log message ***
kono
parents: 99
diff changeset
21 extern void code_init();
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
22 extern char *register_name(int i,int byte);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
23 extern void gexpr_code_init(void);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
24 extern int register_var(int r);
105
7e3d59e56a53 save register ( incomplete )
kono
parents: 104
diff changeset
25 extern int get_register_var(NMTBL *n);
7e3d59e56a53 save register ( incomplete )
kono
parents: 104
diff changeset
26 extern int get_fregister_var(NMTBL *n);
7e3d59e56a53 save register ( incomplete )
kono
parents: 104
diff changeset
27 extern int get_input_register_var(int,NMTBL *);
7e3d59e56a53 save register ( incomplete )
kono
parents: 104
diff changeset
28 extern int get_input_fregister_var(int,NMTBL *);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
29 extern void emit_push();
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
30 extern int emit_pop(int type);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
31 extern void gexpr_code_init();
95
185d2cc6a3a9 *** empty log message ***
kono
parents: 94
diff changeset
32 extern int code_csvalue();
185d2cc6a3a9 *** empty log message ***
kono
parents: 94
diff changeset
33 extern void code_cmpdimm(int e, int csreg);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
34 extern void code_gvar(int e1,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
35 extern void code_rgvar(int e1,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
36 extern void code_crgvar(int e1,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
37 extern void code_lvar(int e2,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
38 extern void code_register(int e2,int reg);
94
1ad7045741a7 float dbinop fix
kono
parents: 93
diff changeset
39 extern void code_rlvar(int e2,int reg);
1ad7045741a7 float dbinop fix
kono
parents: 93
diff changeset
40 extern void code_crlvar(int e2,int reg);
109
e09f9de6f5d3 *** empty log message ***
kono
parents: 108
diff changeset
41 extern void code_fname(NMTBL *n,int reg);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
42 extern void code_const(int e2,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
43 extern void code_neg(int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
44 extern void code_not(int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
45 extern void code_lnot(int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
46 extern void code_preinc(int e1,int e2,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
47 extern void code_postinc(int e1,int e2,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
48 extern void code_cpostinc(int e1,int e2,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
49 extern void code_cpreinc(int e1,int e2,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
50 extern void code_cpostdec(int e1,int e2,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
51 extern void code_cpredec(int e1,int e2,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
52 extern void code_return(int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
53 extern void code_environment(int reg);
116
b14ff9671c90 register offset fix
kono
parents: 111
diff changeset
54 extern void code_bool(int e1);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
55 extern char *code_gt(int cond);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
56 extern char *code_ugt(int cond);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
57 extern char *code_ge(int cond);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
58 extern char *code_uge(int cond);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
59 extern char *code_eq(int cond);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
60 extern void code_cmp_crgvar(int e1);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
61 extern void code_cmp_crlvar(int e1);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
62 extern void code_cmp_rgvar(int e1);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
63 extern void code_cmp_rlvar(int e1);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
64 extern void code_cmp_register(int e2);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
65 extern void code_string(int e1,int reg);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
66 extern void emit_copy(int from,int to,int length,int offset,int value,int det);
94
1ad7045741a7 float dbinop fix
kono
parents: 93
diff changeset
67 extern int function(int e1);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
68 extern void code_frame_pointer(int e3);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
69 extern void code_fix_frame_pointer(int disp_offset);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
70 extern void code_jmp(char *s);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
71 extern void code_indirect_jmp(int e2);
94
1ad7045741a7 float dbinop fix
kono
parents: 93
diff changeset
72 extern int rindirect(int e1);
103
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
73 extern void code_assign_gvar(int e2,int reg,int byte);
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
74 extern void code_assign_lvar(int e2,int reg,int byte);
111
7aa449aff3e6 floating point
kono
parents: 109
diff changeset
75 extern void code_assign_register(int e2,int byte,int reg);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
76 extern void code_assign(int e2,int byte);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
77 extern void code_register_assop(int e2,int op,int byte);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
78 extern void code_assop(int op,int byte);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
79 extern void tosop(int op,int oreg);
66
0b068058dd67 *** empty log message ***
kono
parents: 61
diff changeset
80 extern void code_opening(char *filename);
0b068058dd67 *** empty log message ***
kono
parents: 61
diff changeset
81 extern void code_closing();
89
917947ffeb7c power pc version
kono
parents: 85
diff changeset
82 extern void rexpr(int e1, int l1, char *s,int t);
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
83 extern void drexpr(int e1, int e2,int l1, int op);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
84 extern void jcond(int l, char cond);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
85 extern void jmp(int l);
108
69e2e763cce5 object assemble first try.
kono
parents: 107
diff changeset
86 extern void code_set_fixed_creg(int mode,int type);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
87 extern void code_set_return_register(int mode);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
88 extern void text_mode(void);
66
0b068058dd67 *** empty log message ***
kono
parents: 61
diff changeset
89 extern void global_table(void);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
90 extern int lvar(int l);
92
e7f8515ba882 *** empty log message ***
kono
parents: 89
diff changeset
91 extern void code_label(int labelno);
e7f8515ba882 *** empty log message ***
kono
parents: 89
diff changeset
92
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
93
81
f94ca1168520 float first try...
kono
parents: 66
diff changeset
94 /* floating point part */
f94ca1168520 float first try...
kono
parents: 66
diff changeset
95
f94ca1168520 float first try...
kono
parents: 66
diff changeset
96 extern int dpop_register();
f94ca1168520 float first try...
kono
parents: 66
diff changeset
97 extern int emit_dpop(int);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
98 extern void code_fregister(int e2,int reg);
97
6d42fcac07af *** empty log message ***
kono
parents: 95
diff changeset
99 extern void code_cmp_fregister(int);
81
f94ca1168520 float first try...
kono
parents: 66
diff changeset
100 extern void code_cmp_drgvar(int);
f94ca1168520 float first try...
kono
parents: 66
diff changeset
101 extern void code_cmp_drlvar(int);
103
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
102 extern void code_dassign(int,int,int);
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
103 extern void code_dassign_gvar(int,int,int);
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
104 extern void code_dassign_lvar(int,int,int);
111
7aa449aff3e6 floating point
kono
parents: 109
diff changeset
105 extern void code_dassign_fregister(int e2,int d,int reg);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
106 extern void code_dconst(int,int);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
107 extern void code_dneg(int);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
108 extern void code_drgvar(int,int,int);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
109 extern void code_drlvar(int,int,int);
81
f94ca1168520 float first try...
kono
parents: 66
diff changeset
110 extern void dtosop(int,int);
f94ca1168520 float first try...
kono
parents: 66
diff changeset
111 extern void emit_dpop_free(int);
f94ca1168520 float first try...
kono
parents: 66
diff changeset
112 extern void emit_dpush();
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
113 extern void code_i2d(int,int);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
114 extern void code_d2i(int,int);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
115 extern void code_u2d(int,int);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
116 extern void code_d2u(int,int);
81
f94ca1168520 float first try...
kono
parents: 66
diff changeset
117
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
118 extern void code_dpreinc(int e1,int e2,int d,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
119 extern void code_dpostinc(int e1,int e2,int d,int reg);
83
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
120 extern void code_dassop(int op,int d);
89
917947ffeb7c power pc version
kono
parents: 85
diff changeset
121
109
e09f9de6f5d3 *** empty log message ***
kono
parents: 108
diff changeset
122 extern void code_arg_register();
89
917947ffeb7c power pc version
kono
parents: 85
diff changeset
123
917947ffeb7c power pc version
kono
parents: 85
diff changeset
124 extern int get_register(void);
99
53899975154c *** empty log message ***
kono
parents: 97
diff changeset
125 extern int get_fregister(void);
89
917947ffeb7c power pc version
kono
parents: 85
diff changeset
126 extern void free_register(int i) ;
99
53899975154c *** empty log message ***
kono
parents: 97
diff changeset
127 extern void free_fregister(int i) ;
89
917947ffeb7c power pc version
kono
parents: 85
diff changeset
128 extern int pop_register(void);
917947ffeb7c power pc version
kono
parents: 85
diff changeset
129 extern void emit_pop_free(int xreg);
917947ffeb7c power pc version
kono
parents: 85
diff changeset
130
917947ffeb7c power pc version
kono
parents: 85
diff changeset
131 /* */