annotate mc-code.h @ 881:ab501cdbbefd

fix wrong src/dst type in pdecl_data_field
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 03 Apr 2014 17:49:05 +0900
parents 5313ed059cee
children 485f13206916
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
607
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
5 /************************************************************************
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
6 ** Copyright (C) 2006 Shinji Kono
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
7 ** 連絡先: 琉球大学情報工学科 河野 真治
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
8 ** (E-Mail Address: kono@ie.u-ryukyu.ac.jp)
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
9 **
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
10 ** このソースのいかなる複写,改変,修正も許諾します。ただし、
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
11 ** その際には、誰が貢献したを示すこの部分を残すこと。
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
12 ** 再配布や雑誌の付録などの問い合わせも必要ありません。
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
13 ** 営利利用も上記に反しない範囲で許可します。
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
14 ** バイナリの配布の際にはversion messageを保存することを条件とします。
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
15 ** このプログラムについては特に何の保証もしない、悪しからず。
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
16 **
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
17 ** Everyone is permitted to do anything on this program
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
18 ** including copying, modifying, improving,
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
19 ** as long as you don't try to pretend that you wrote it.
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
20 ** i.e., the above copyright notice has to appear in all copies.
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
21 ** Binary distribution requires original version messages.
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
22 ** You don't have to ask before copying, redistribution or publishing.
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
23 ** THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE.
e055df7c1082 *** empty log message ***
kono
parents: 599
diff changeset
24 ***********************************************************************/
173
3b33c7daae95 *** empty log message ***
kono
parents: 168
diff changeset
25
452
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
26 #define MAX_MAX 50 /* architecture independent max registers */
599
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
27
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
28 /*
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
29 flag value for regs[]
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
30 */
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
31
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
32 #define USING_REG 1 /* unreusable register usage */
452
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
33 #define INPUT_REG 2 /* input register ( can be reused ) */
599
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
34 #define REG_VAR 3 /* used as register variable */
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
35 #define PTRC_REG 4 /* used as global variable pointer cache */
144
56211702f298 creg/freg continue
kono
parents: 139
diff changeset
36
452
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
37 extern char *l_include_path[]; /* library including path */
173
3b33c7daae95 *** empty log message ***
kono
parents: 168
diff changeset
38
452
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
39 extern int disp_offset; /* displacement offset in code and function */
599
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
40
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
41 /*
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
42 function arugment evaluation order
880
5313ed059cee no tabs in source
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 794
diff changeset
43 define compatiblity in inline function generation
599
df04bc5fd5fe *** empty log message ***
kono
parents: 594
diff changeset
44 */
555
ac181d7f9c82 IA32 eval order
kono
parents: 518
diff changeset
45 #define NORMAL 0
ac181d7f9c82 IA32 eval order
kono
parents: 518
diff changeset
46 #define REVERSE 1
ac181d7f9c82 IA32 eval order
kono
parents: 518
diff changeset
47 extern int eval_order;
254
5aaca4f9d96b *** empty log message ***
kono
parents: 239
diff changeset
48
83
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
49 extern int MAX_REGISTER;
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
50 extern int MAX_REGISTGER_VAR;
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
51 extern int MAX_FREGISTER;
103
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
52
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
53 extern int MAX_INPUT_REGISTER_VAR;
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
54 extern int MAX_CODE_INPUT_REGISTER_VAR;
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
55 extern int MAX_INPUT_DREGISTER_VAR;
138
e6e77af048a1 float/dobule configuration
kono
parents: 137
diff changeset
56 extern int MAX_CODE_INPUT_FREGISTER_VAR;
103
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
57 extern int MAX_CODE_INPUT_DREGISTER_VAR;
99
53899975154c *** empty log message ***
kono
parents: 97
diff changeset
58
94
1ad7045741a7 float dbinop fix
kono
parents: 93
diff changeset
59 #define REG_LVAR_OFFSET 2
83
f3f75911d62c *** empty log message ***
kono
parents: 82
diff changeset
60
340
0150de6a3244 emit_data moved.
kono
parents: 331
diff changeset
61 extern int data_alignment;
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
62
452
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
63 extern int code_lassop_p; /* architecture has code_lassop */
238
d64e9a6a66bd ia32 long long code written.
kono
parents: 229
diff changeset
64
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
65 /* used by mc-codegen */
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
66
516
bfa4c834a3b8 data/text/rodata segment fix (incomplete)
kono
parents: 456
diff changeset
67 extern void data_mode(char *name);
bfa4c834a3b8 data/text/rodata segment fix (incomplete)
kono
parents: 456
diff changeset
68 extern void text_mode(int align);
bfa4c834a3b8 data/text/rodata segment fix (incomplete)
kono
parents: 456
diff changeset
69 extern void cstring_mode();
bfa4c834a3b8 data/text/rodata segment fix (incomplete)
kono
parents: 456
diff changeset
70
452
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
71 extern void gexpr_init(void); /* code generator initialize for each statement */
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
72 extern void emit_init(void); /* called before delcalartion */
452
8e3284b0a8c9 minor update
kono
parents: 450
diff changeset
73 extern void gen_gdecl(char *n, int gpc); /* global definition */
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
74
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
75 extern void code_init(); /* called only once */
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
76 extern void emit_reinit(); /* called for each file */
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
77
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
78 extern void gexpr_code_init(void);
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
79
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
80 extern void code_enter(char *name);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
81 extern void code_enter1(int args);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
82 extern void code_leave(char *name);
450
eaf9e2746c83 parallel assign for simple expr. (too complex solution)
kono
parents: 449
diff changeset
83 extern void code_label_call(int i);
eaf9e2746c83 parallel assign for simple expr. (too complex solution)
kono
parents: 449
diff changeset
84 extern void code_ret();
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
85 extern void enter(char *name);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
86 extern void enter1();
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
87 extern void leave(int control, char *name);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
88 extern void jmp(int l);
449
c55363eff5e5 parallel assignment (modify not completed)
kono
parents: 438
diff changeset
89 extern int not_simple_p(int l);
450
eaf9e2746c83 parallel assign for simple expr. (too complex solution)
kono
parents: 449
diff changeset
90 extern void code_save_stacks();
782
003067098032 code argument offset in caller and callee
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 778
diff changeset
91 extern int code_arg_alignment(int disp0,NMTBL *n,int type0,int sz, int is_code);
715
83e18db76c96 architecture depenedent argument alignment
kono
parents: 705
diff changeset
92 extern int code_lvar_alignment(int disp0,NMTBL *n,int type0,int sz);
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
93
105
7e3d59e56a53 save register ( incomplete )
kono
parents: 104
diff changeset
94 extern int get_register_var(NMTBL *n);
138
e6e77af048a1 float/dobule configuration
kono
parents: 137
diff changeset
95 extern int get_dregister_var(NMTBL *n,int d);
195
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
96 extern int get_lregister_var(NMTBL *n);
126
1d1612fe705a *** empty log message ***
kono
parents: 119
diff changeset
97 extern int get_input_register_var(int,NMTBL *,int);
138
e6e77af048a1 float/dobule configuration
kono
parents: 137
diff changeset
98 extern int get_input_dregister_var(int,NMTBL *,int,int);
195
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
99 extern int get_input_lregister_var(int,NMTBL *,int);
341
ca34f02b2056 ptr cache speed up
kono
parents: 340
diff changeset
100 extern void code_ptr_cache_def(int r,NMTBL *nptr);
ca34f02b2056 ptr cache speed up
kono
parents: 340
diff changeset
101 extern void use_ptr_cache(int r);
345
2b3946ee4fc9 *** empty log message ***
kono
parents: 341
diff changeset
102 extern int code_register_overlap(int s,int t);
341
ca34f02b2056 ptr cache speed up
kono
parents: 340
diff changeset
103
426
fb136af3bf09 Bitfield reorganization.
kono
parents: 382
diff changeset
104 extern int emit_push();
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
105 extern int emit_pop(int type);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
106 extern void gexpr_code_init();
95
185d2cc6a3a9 *** empty log message ***
kono
parents: 94
diff changeset
107 extern int code_csvalue();
147
cb7aa0089681 creg/ireg done for powerpc.
kono
parents: 144
diff changeset
108 extern void code_gexpr(int e);
287
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
109 extern void code_cmpdimm(int e, int csreg,int label,int cond);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
110 extern void code_gvar(int e1,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
111 extern void code_rgvar(int e1,int reg);
165
kono
parents: 162
diff changeset
112 extern void code_crgvar(int e1,int reg,int sign,int sz);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
113 extern void code_lvar(int e2,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
114 extern void code_register(int e2,int reg);
94
1ad7045741a7 float dbinop fix
kono
parents: 93
diff changeset
115 extern void code_rlvar(int e2,int reg);
165
kono
parents: 162
diff changeset
116 extern void code_crlvar(int e2,int reg,int sign,int sz);
109
e09f9de6f5d3 *** empty log message ***
kono
parents: 108
diff changeset
117 extern void code_fname(NMTBL *n,int reg);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
118 extern void code_const(int e2,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
119 extern void code_neg(int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
120 extern void code_not(int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
121 extern void code_lnot(int reg);
168
b1297c82e926 cpostinc removal
kono
parents: 167
diff changeset
122 extern void code_preinc(int e1,int e2,int dir,int sign,int sz,int reg);
b1297c82e926 cpostinc removal
kono
parents: 167
diff changeset
123 extern void code_postinc(int e1,int e2,int dir,int sign,int sz,int reg);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
124 extern void code_return(int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
125 extern void code_environment(int reg);
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
126 extern void code_bool(int e1,int reg);
287
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
127 extern void code_cmp_crgvar(int e1,int reg,int sz,int label,int cond);
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
128 extern void code_cmp_crlvar(int e1,int reg,int sz,int label,int cond);
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
129 extern void code_cmp_rgvar(int e1,int reg,int label,int cond);
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
130 extern void code_cmp_rlvar(int e1,int reg,int label,int cond);
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
131 extern void code_cmp_register(int e2,int label,int cond);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
132 extern void code_string(int e1,int reg);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
133 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
134 extern int function(int e1);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
135 extern void code_frame_pointer(int e3);
577
7e0076617c76 env switch continue..
kono
parents: 555
diff changeset
136 extern int code_frame_pointer_register();
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
137 extern void code_fix_frame_pointer(int disp_offset);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
138 extern void code_jmp(char *s);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
139 extern void code_indirect_jmp(int e2);
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
140
355
6188f66c0c0b cond op, and arg scope.
kono
parents: 353
diff changeset
141 extern void code_rindirect(int e1, int reg,int offset, int us,int sz);
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
142 #if FLOAT_CODE
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
143 extern int code_drindirect(int e1, int reg,int offset, int d);
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
144 #endif
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
145 #if LONGLONG_CODE
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
146 extern int code_lrindirect(int e1, int reg,int offset, int us);
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
147 #endif
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
148
103
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
149 extern void code_assign_gvar(int e2,int reg,int byte);
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
150 extern void code_assign_lvar(int e2,int reg,int byte);
111
7aa449aff3e6 floating point
kono
parents: 109
diff changeset
151 extern void code_assign_register(int e2,int byte,int reg);
118
07b91b625f84 assignment optimization
kono
parents: 116
diff changeset
152 extern void code_assign(int e2,int byte,int reg);
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
153 extern void code_register_assop(int e2,int reg,int op,int byte);
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
154 extern void code_assop(int op,int reg,int byte,int sign);
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
155 extern void tosop(int op,int reg,int oreg);
594
f49c825920c4 tosop optimize buf fix
kono
parents: 577
diff changeset
156 extern int tosop_operand_safe_p(int);
66
0b068058dd67 *** empty log message ***
kono
parents: 61
diff changeset
157 extern void code_opening(char *filename);
0b068058dd67 *** empty log message ***
kono
parents: 61
diff changeset
158 extern void code_closing();
438
626d705471d5 Unexecuted code in conditional. Lazy jmp code generation.
kono
parents: 430
diff changeset
159 extern int rexpr(int e1, int l1, int cond,int t);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
160 extern void jmp(int l);
187
dffcccf8b1cb nested COND
kono
parents: 173
diff changeset
161 extern int code_get_fixed_creg(int reg,int type);
dffcccf8b1cb nested COND
kono
parents: 173
diff changeset
162 extern void code_set_fixed_creg(int reg,int mode,int type);
705
0554b7f985ee parse mode done.
kono
parents: 616
diff changeset
163 extern int code_set_return_register(int mode);
66
0b068058dd67 *** empty log message ***
kono
parents: 61
diff changeset
164 extern void global_table(void);
92
e7f8515ba882 *** empty log message ***
kono
parents: 89
diff changeset
165 extern void code_label(int labelno);
363
f3f2b7906d50 label extension
kono
parents: 355
diff changeset
166 extern void code_label_value(int labelno,int reg);
92
e7f8515ba882 *** empty log message ***
kono
parents: 89
diff changeset
167
189
f53d70110377 immediate instructions.
kono
parents: 187
diff changeset
168 extern int code_const_op_p(int op,int v);
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
169 extern void oprtc(int op,int reg,int v);
189
f53d70110377 immediate instructions.
kono
parents: 187
diff changeset
170
716
21f770a3b298 *** empty log message ***
kono
parents: 715
diff changeset
171 extern void code_align(int t);
516
bfa4c834a3b8 data/text/rodata segment fix (incomplete)
kono
parents: 456
diff changeset
172 extern void emit_global(NMTBL *n,int t,int e);
340
0150de6a3244 emit_data moved.
kono
parents: 331
diff changeset
173 extern void emit_space(int sp);
0150de6a3244 emit_data moved.
kono
parents: 331
diff changeset
174 extern void emit_char(int d);
0150de6a3244 emit_data moved.
kono
parents: 331
diff changeset
175 extern void emit_short(int d);
0150de6a3244 emit_data moved.
kono
parents: 331
diff changeset
176 extern void emit_int(int d);
0150de6a3244 emit_data moved.
kono
parents: 331
diff changeset
177 extern void emit_longlong(int e);
0150de6a3244 emit_data moved.
kono
parents: 331
diff changeset
178 extern void emit_double(int e);
0150de6a3244 emit_data moved.
kono
parents: 331
diff changeset
179 extern void emit_float(int e);
367
4efbb07f556b global variable offset
kono
parents: 365
diff changeset
180 extern void emit_address(char *s,int offset);
340
0150de6a3244 emit_data moved.
kono
parents: 331
diff changeset
181 extern void emit_label(int labelno);
0150de6a3244 emit_data moved.
kono
parents: 331
diff changeset
182 extern int emit_string_label();
518
9f2d6aea201f cstring fix.... finally
kono
parents: 516
diff changeset
183 extern void emit_string(char *,int type);
778
a177c65f3e37 large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 716
diff changeset
184 void emit_strings(NMTBL *n);
a177c65f3e37 large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 716
diff changeset
185 void code_strings(int e2,int reg);
340
0150de6a3244 emit_data moved.
kono
parents: 331
diff changeset
186
353
41ed77cb9c67 name table reogranization, extendable cheap done.
kono
parents: 345
diff changeset
187 extern void code_i2c(int reg);
41ed77cb9c67 name table reogranization, extendable cheap done.
kono
parents: 345
diff changeset
188 extern void code_i2s(int reg);
41ed77cb9c67 name table reogranization, extendable cheap done.
kono
parents: 345
diff changeset
189 extern void code_u2uc(int reg);
41ed77cb9c67 name table reogranization, extendable cheap done.
kono
parents: 345
diff changeset
190 extern void code_u2us(int reg);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents:
diff changeset
191
195
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
192 #if FLOAT_CODE
81
f94ca1168520 float first try...
kono
parents: 66
diff changeset
193 /* floating point part */
f94ca1168520 float first try...
kono
parents: 66
diff changeset
194
438
626d705471d5 Unexecuted code in conditional. Lazy jmp code generation.
kono
parents: 430
diff changeset
195 extern int drexpr(int e1, int e2,int l1, int op,int cond);
81
f94ca1168520 float first try...
kono
parents: 66
diff changeset
196 extern int dpop_register();
f94ca1168520 float first try...
kono
parents: 66
diff changeset
197 extern int emit_dpop(int);
138
e6e77af048a1 float/dobule configuration
kono
parents: 137
diff changeset
198 extern void code_dregister(int e2,int reg,int d);
287
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
199 extern void code_cmp_dregister(int,int,int,int);
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
200 extern void code_cmp_drgvar(int,int,int,int,int);
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
201 extern void code_cmp_drlvar(int,int,int,int,int);
103
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
202 extern void code_dassign(int,int,int);
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
203 extern void code_dassign_gvar(int,int,int);
f849af4b5ea9 *** empty log message ***
kono
parents: 102
diff changeset
204 extern void code_dassign_lvar(int,int,int);
138
e6e77af048a1 float/dobule configuration
kono
parents: 137
diff changeset
205 extern void code_dassign_dregister(int e2,int d,int reg);
e6e77af048a1 float/dobule configuration
kono
parents: 137
diff changeset
206 extern void code_dconst(int,int,int);
e6e77af048a1 float/dobule configuration
kono
parents: 137
diff changeset
207 extern void code_dneg(int,int);
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
208 extern void code_drgvar(int,int,int);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
209 extern void code_drlvar(int,int,int);
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
210 extern void dtosop(int,int,int);
138
e6e77af048a1 float/dobule configuration
kono
parents: 137
diff changeset
211 extern void emit_dpop_free(int,int);
133
7d436c08e949 separate float / double flow
kono
parents: 126
diff changeset
212 extern void emit_dpush(int);
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
213 extern void code_i2d();
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
214 extern void code_d2i();
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
215 extern void code_u2d();
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
216 extern void code_d2u();
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
217 extern void code_d2f();
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
218 extern void code_f2d();
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
219 extern void code_f2i();
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
220 extern void code_f2u();
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
221 extern void code_i2f();
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
222 extern void code_u2f();
133
7d436c08e949 separate float / double flow
kono
parents: 126
diff changeset
223
81
f94ca1168520 float first try...
kono
parents: 66
diff changeset
224
107
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
225 extern void code_dpreinc(int e1,int e2,int d,int reg);
06f72222d6b5 prevent destorying function argument (incomeplete)
kono
parents: 105
diff changeset
226 extern void code_dpostinc(int e1,int e2,int d,int reg);
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
227 extern void code_dassop(int op,int reg,int d);
219
6190d24e178c long long code generation level 4
kono
parents: 218
diff changeset
228 extern void code_register_dassop(int reg,int op,int d);
89
917947ffeb7c power pc version
kono
parents: 85
diff changeset
229
195
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
230 #endif
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
231
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
232 #if LONGLONG_CODE
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
233 /* 64bit int part */
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
234
438
626d705471d5 Unexecuted code in conditional. Lazy jmp code generation.
kono
parents: 430
diff changeset
235 extern int lrexpr(int e1, int e2,int l1, int op,int cond);
195
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
236 extern int lpop_register();
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
237 extern int emit_lpop();
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
238 extern void code_lregister(int e2,int reg);
287
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
239 extern void code_cmp_lregister(int,int,int);
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
240 extern void code_cmp_lrgvar(int,int,int,int);
a0779a414855 *** empty log message ***
kono
parents: 280
diff changeset
241 extern void code_cmp_lrlvar(int,int,int,int);
195
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
242 extern void code_lassign(int,int);
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
243 extern void code_lassign_gvar(int,int);
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
244 extern void code_lassign_lvar(int,int);
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
245 extern void code_lassign_lregister(int e2,int reg);
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
246 extern void code_lconst(int,int);
212
32f54ab63b35 *** empty log message ***
kono
parents: 205
diff changeset
247 extern void code_lneg(int);
195
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
248 extern void code_lrgvar(int,int);
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
249 extern void code_lrlvar(int,int);
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
250 extern void ltosop(int,int,int);
195
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
251 extern void emit_lpop_free(int);
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
252 extern void emit_lpush();
213
kono
parents: 212
diff changeset
253 extern int code_lconst_op_p(int op,int e);
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
254 extern void loprtc(int op,int reg, int e);
239
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
255 extern void code_i2ll(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
256 extern void code_i2ull(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
257 extern void code_u2ll(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
258 extern void code_u2ull(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
259 extern void code_ll2i(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
260 extern void code_ll2u(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
261 extern void code_ull2i(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
262 extern void code_ull2u(int reg);
195
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
263 #if FLOAT_CODE
239
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
264 extern void code_d2ll(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
265 extern void code_d2ull(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
266 extern void code_f2ll(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
267 extern void code_f2ull(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
268 extern void code_ll2d(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
269 extern void code_ll2f(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
270 extern void code_ull2d(int reg);
1849e0079f08 ia32 long long continue
kono
parents: 238
diff changeset
271 extern void code_ull2f(int reg);
195
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
272 #endif
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
273
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
274
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
275
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
276
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
277 extern void code_lpreinc(int e1,int e2,int reg);
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
278 extern void code_lpostinc(int e1,int e2,int reg);
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
279 extern void code_lassop(int op,int reg);
219
6190d24e178c long long code generation level 4
kono
parents: 218
diff changeset
280 extern void code_register_lassop(int reg,int op);
195
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
281
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
282 #endif
c193120ee2a6 *** empty log message ***
kono
parents: 189
diff changeset
283
313
f73b93de216a alloca done for ia32, powerpc, mips
kono
parents: 308
diff changeset
284 extern void code_alloca(int e,int reg);
616
2ba903c8e749 builtin_fabs
kono
parents: 607
diff changeset
285 extern void code_builtin_fabsf(int e);
2ba903c8e749 builtin_fabs
kono
parents: 607
diff changeset
286 extern void code_builtin_fabs(int e);
2ba903c8e749 builtin_fabs
kono
parents: 607
diff changeset
287 extern void code_builtin_inff();
2ba903c8e749 builtin_fabs
kono
parents: 607
diff changeset
288 extern void code_builtin_inf();
794
032dc03be02e i64 arg_register in inline mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 782
diff changeset
289 extern void code_arg_register(NMTBL *fnptr, int in);
89
917947ffeb7c power pc version
kono
parents: 85
diff changeset
290
430
ba5faa547607 ARM bitfield done.
kono
parents: 426
diff changeset
291 extern int get_register();
ba5faa547607 ARM bitfield done.
kono
parents: 426
diff changeset
292 extern int get_dregister();
ba5faa547607 ARM bitfield done.
kono
parents: 426
diff changeset
293 extern int get_lregister();
89
917947ffeb7c power pc version
kono
parents: 85
diff changeset
294 extern void free_register(int i) ;
917947ffeb7c power pc version
kono
parents: 85
diff changeset
295 extern int pop_register(void);
917947ffeb7c power pc version
kono
parents: 85
diff changeset
296 extern void emit_pop_free(int xreg);
308
e1d17d6adfcc struct field init (first try, no compile error)
kono
parents: 304
diff changeset
297 extern void emit_data_closing(NMTBL *n);
e1d17d6adfcc struct field init (first try, no compile error)
kono
parents: 304
diff changeset
298
89
917947ffeb7c power pc version
kono
parents: 85
diff changeset
299
221
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
300 // extern int use_int(int);
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
301 // extern int use_float(int);
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
302 // extern int use_double(int);
ceae585186d9 *** empty log message ***
kono
parents: 219
diff changeset
303 // extern int use_longlong(int);
138
e6e77af048a1 float/dobule configuration
kono
parents: 137
diff changeset
304
300
86255dd7f148 table done. (?)
kono
parents: 287
diff changeset
305 #if CASE_CODE
382
832e1f6bba82 ARM wrote all code. Check compile error.
kono
parents: 367
diff changeset
306 extern int code_table_jump_p(int delta);
302
bea7ab2fb218 switch table jump finished.
kono
parents: 300
diff changeset
307 extern void code_table_jump(int table,int csvalue,int delta,int max,int min,int dlabel);
300
86255dd7f148 table done. (?)
kono
parents: 287
diff changeset
308 extern void code_table_open(int table);
86255dd7f148 table done. (?)
kono
parents: 287
diff changeset
309 extern void code_table_value(int label,int table);
86255dd7f148 table done. (?)
kono
parents: 287
diff changeset
310 extern void code_table_close();
86255dd7f148 table done. (?)
kono
parents: 287
diff changeset
311 #endif
86255dd7f148 table done. (?)
kono
parents: 287
diff changeset
312
316
22d92986c7f7 asm, valued statement, local decls continue...
kono
parents: 313
diff changeset
313 #if ASM_CODE
320
183726ccd83d asm minor fix. ia32 table jmp fix.
kono
parents: 316
diff changeset
314
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
315 extern void code_asm(char *asm_str,int repl);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
316 extern int code_asm_operand(char *p,int e1,int mode,int repl,int n,int repl0);
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
317 extern void code_free_asm_operand(int repl);
320
183726ccd83d asm minor fix. ia32 table jmp fix.
kono
parents: 316
diff changeset
318
316
22d92986c7f7 asm, valued statement, local decls continue...
kono
parents: 313
diff changeset
319 #endif
22d92986c7f7 asm, valued statement, local decls continue...
kono
parents: 313
diff changeset
320
456
b8f95294eb77 inline continue... if test passed.
kono
parents: 452
diff changeset
321 extern void code_comment(char *s);
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
322
329
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
323 #if BIT_FIELD_CODE
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
324
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
325 /* bit field alignment calcuration */
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
326
331
f25aa4f03198 bit-field continue...
kono
parents: 329
diff changeset
327 extern int code_bit_field_disp(int type,int *offset,int *bfd,int *sz);
329
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
328
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
329 /* bit field value */
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
330
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
331 /* reg contains address of bit_field, result should goto reg */
426
fb136af3bf09 Bitfield reorganization.
kono
parents: 382
diff changeset
332 extern void code_bit_field(int type,int adr,int reg);
329
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
333
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
334 /* bit field replacement */
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
335
426
fb136af3bf09 Bitfield reorganization.
kono
parents: 382
diff changeset
336 extern void code_bit_replace(int value,int lvalue,int type);
329
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
337 /* register, register */
426
fb136af3bf09 Bitfield reorganization.
kono
parents: 382
diff changeset
338 extern void code_bit_replace_const(int value,int lvalue,int type);
365
5ac17fa9d7e0 bit-field constant assignment
kono
parents: 363
diff changeset
339 /* exp, register */
329
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
340
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
341 #endif
4c8f8ef8c0cf bit field continue...
kono
parents: 327
diff changeset
342
327
da2e3f2d127d macro/codegen reorganization
kono
parents: 320
diff changeset
343 /* end */