Mercurial > hg > CbC > old > device
annotate mc-codegen.h @ 610:3ce0fd61eeae
*** empty log message ***
author | kono |
---|---|
date | Wed, 29 Mar 2006 00:02:23 +0900 |
parents | af6b9ae79583 |
children | 234bc5f79a11 |
rev | line source |
---|---|
144 | 1 /* for mc-codegen.c */ |
61 | 2 |
607 | 3 |
4 /************************************************************************ | |
5 ** Copyright (C) 2006 Shinji Kono | |
6 ** 連絡先: 琉球大学情報工学科 河野 真治 | |
7 ** (E-Mail Address: kono@ie.u-ryukyu.ac.jp) | |
8 ** | |
9 ** このソースのいかなる複写,改変,修正も許諾します。ただし、 | |
10 ** その際には、誰が貢献したを示すこの部分を残すこと。 | |
11 ** 再配布や雑誌の付録などの問い合わせも必要ありません。 | |
12 ** 営利利用も上記に反しない範囲で許可します。 | |
13 ** バイナリの配布の際にはversion messageを保存することを条件とします。 | |
14 ** このプログラムについては特に何の保証もしない、悪しからず。 | |
15 ** | |
16 ** Everyone is permitted to do anything on this program | |
17 ** including copying, modifying, improving, | |
18 ** as long as you don't try to pretend that you wrote it. | |
19 ** i.e., the above copyright notice has to appear in all copies. | |
20 ** Binary distribution requires original version messages. | |
21 ** You don't have to ask before copying, redistribution or publishing. | |
22 ** THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. | |
23 ***********************************************************************/ | |
452 | 24 extern int use; /* generated value will be used in gexpr */ |
25 extern char *init_src; /* internal defenition string for each file */ | |
26 | |
27 /* these architecture dependent values are defined in mc-code-*.c */ | |
28 | |
327 | 29 extern int size_of_int; |
30 extern int size_of_short; | |
31 extern int size_of_float; | |
32 extern int size_of_double; | |
33 extern int size_of_longlong; | |
34 extern int bit_of_byte; | |
35 extern int endian; | |
83 | 36 |
221 | 37 #define USE_CREG (-1) |
320 | 38 #define ASM_INPUT 1 |
39 #define ASM_OUTPUT 2 | |
40 #define ASM_USED 3 | |
41 #define MAX_ASM_REG 30 | |
61 | 42 |
327 | 43 /* used by mc-parse */ |
104 | 44 |
445 | 45 extern NMTBL * def(NMTBL *n,int ctmode); |
331 | 46 extern int arg_reorder(int arg,int new_arg); |
47 extern int assign_data(int e, int t, NMTBL *n,int offset); | |
48 extern int assign_expr(int e1,int e2,int t); | |
49 extern int assign_expr0(int e1,int e2,int t,int type0); | |
50 extern int assop(int e1,int e2,int op,int t,int no_float); | |
51 extern int backdef(void); | |
52 extern int binop(int op, int e1, int e2, int t1, int t2); | |
53 extern int cexpr(int e); | |
54 extern int cond(int t,int e1,int e2,int e3); | |
55 extern int correct_type(int e,int t); | |
56 extern int csvalue(); | |
57 extern int function_type(int e1,int *dots); | |
58 extern int gexpr(int e1,int use0); | |
59 extern int indop(int e); | |
60 extern int integral(int t); | |
61 extern int new_lvar(int size); | |
62 extern int new_lvar0(int sz); | |
327 | 63 extern int rvalue(int e); |
64 extern int rvalue_t(int e,int t); | |
331 | 65 extern int search_struct_type(int type,char *name,int *dsp); |
66 extern int strop(int e,int ind); | |
137 | 67 extern void arg_register(NMTBL *fnptr); |
438
626d705471d5
Unexecuted code in conditional. Lazy jmp code generation.
kono
parents:
397
diff
changeset
|
68 extern int bexpr(int e1, char cond, int l1); |
626d705471d5
Unexecuted code in conditional. Lazy jmp code generation.
kono
parents:
397
diff
changeset
|
69 extern int bexpr_u(int e1, char cond, int l1); |
552 | 70 extern void checkret(void); // check delayed jump, delayed last exp |
327 | 71 extern void closing(); |
72 extern void cmpdimm(int e, int csreg,int label,int cond); | |
331 | 73 extern void codegen_decl_init(); /* called before each declaration */ |
327 | 74 extern void codegen_init(); /* called only once */ |
75 extern void codegen_reinit(); /* called for each file */ | |
328 | 76 extern void data_closing(NMTBL *n); |
327 | 77 extern void def_label(int cslabel, int dlabel); |
78 extern void emit_init_vars(void); | |
331 | 79 extern void fcheck(NMTBL *n); |
327 | 80 extern void fdecl_struct(int fntype); |
81 extern void free_lvar(int disp); | |
456 | 82 extern void gen_comment(char *s); |
327 | 83 extern void gen_code_enter(char *name); |
84 extern void gen_code_enter1(int args); | |
85 extern void gen_code_leave(char *name); | |
86 extern void gen_enter(char *name); | |
87 extern void gen_enter1(); | |
331 | 88 extern void gen_jmp(int l); |
363 | 89 extern void gen_indirect_goto(int e1); |
327 | 90 extern void gen_leave(int control, char *name); |
331 | 91 extern void init_free_lvar_list(); |
92 extern void lcheck(int e); | |
93 extern void opening(char *filename); | |
94 extern void parallel_rassign(int assigns); | |
95 extern void replace_return_struct(int func,int left); | |
327 | 96 extern void ret(void); |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
97 extern void gen_ret(void); |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
98 extern void gen_label_call(int l); |
542 | 99 extern void flush_delayed_decl_data(NMTBL *n); |
327 | 100 |
552 | 101 /* used by mc-inline */ |
102 | |
103 extern void checkjmp(int l); // generate delayed jump, l = current label | |
557 | 104 extern int reference(int e1); // recover lvalue from rvalue of memory or register |
105 extern int type_of_bop(int op); | |
106 extern int type_of_conv(int op); | |
552 | 107 |
108 /* used by mc-code-* */ | |
327 | 109 |
110 extern int assign_expr0(int e1,int e2,int t,int type0) ; | |
438
626d705471d5
Unexecuted code in conditional. Lazy jmp code generation.
kono
parents:
397
diff
changeset
|
111 extern int b_expr(int e1, char cond, int l1,int err); |
327 | 112 extern int contains_p(int e,int (*p)(int)); |
449 | 113 extern int contains_p1(int arg,int e,int (*p)(int,int)); |
609 | 114 extern int contains_p2(int arg,int e,int (*p)(int,int)); |
61 | 115 extern void fwddef(int l); |
327 | 116 extern int fwdlabel(void); |
117 extern int g_expr(int e1); | |
118 extern int g_expr0(int e1); | |
119 extern int g_expr_u(int e1); | |
456 | 120 extern int is_const(int e); |
463 | 121 extern int is_memory(int e); |
547 | 122 extern int is_local_memory(int e1); |
98 | 123 extern int is_code(NMTBL *fnptr); |
124 extern int is_function(NMTBL *fnptr); | |
453 | 125 extern int is_inline(NMTBL *fnptr); |
327 | 126 extern int scalar(int t); |
336 | 127 extern int make_mask(int from,int to); |
128 | |
341 | 129 extern void init_ptr_cache(); |
130 extern void clear_ptr_cache_reg(int r); | |
131 extern int last_ptr_cache(); | |
132 extern void clear_ptr_cache() ; | |
133 extern int get_ptr_cache(NMTBL *nptr); | |
61 | 134 |
366 | 135 extern int ilog(int i); |
136 | |
596 | 137 /* used by mc-tree */ |
138 | |
139 extern NMTBL str_ret; | |
140 | |
609 | 141 /* used by conv */ |
142 extern int rop_dual(int op); | |
143 extern int copy_expr(int e); | |
144 | |
61 | 145 /* end */ |