Mercurial > hg > CbC > old > device
annotate mc-codegen.h @ 718:d12029c499df
mc-code-spu no compile error
author | kono |
---|---|
date | Tue, 20 Nov 2007 17:51:50 +0900 |
parents | 21f770a3b298 |
children | c9d4390b2b4e |
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 | |
715 | 29 extern int size_of_pointer; |
327 | 30 extern int size_of_int; |
31 extern int size_of_short; | |
32 extern int size_of_float; | |
33 extern int size_of_double; | |
34 extern int size_of_longlong; | |
718 | 35 extern int size_of_vector; |
327 | 36 extern int bit_of_byte; |
37 extern int endian; | |
716 | 38 extern int struct_align; |
39 | |
83 | 40 |
221 | 41 #define USE_CREG (-1) |
320 | 42 #define ASM_INPUT 1 |
43 #define ASM_OUTPUT 2 | |
44 #define ASM_USED 3 | |
45 #define MAX_ASM_REG 30 | |
61 | 46 |
327 | 47 /* used by mc-parse */ |
104 | 48 |
445 | 49 extern NMTBL * def(NMTBL *n,int ctmode); |
331 | 50 extern int arg_reorder(int arg,int new_arg); |
692 | 51 extern int assign_data(int e, int t, int v,int offset); |
331 | 52 extern int assign_expr(int e1,int e2,int t); |
53 extern int assign_expr0(int e1,int e2,int t,int type0); | |
54 extern int assop(int e1,int e2,int op,int t,int no_float); | |
55 extern int backdef(void); | |
56 extern int binop(int op, int e1, int e2, int t1, int t2); | |
705 | 57 extern int binop0(int op, int e1, int e2, int t1, int t2); // no inline |
331 | 58 extern int cexpr(int e); |
59 extern int cond(int t,int e1,int e2,int e3); | |
60 extern int correct_type(int e,int t); | |
682 | 61 extern int skip_cast(int e); |
331 | 62 extern int csvalue(); |
63 extern int function_type(int e1,int *dots); | |
64 extern int gexpr(int e1,int use0); | |
65 extern int indop(int e); | |
66 extern int integral(int t); | |
67 extern int new_lvar(int size); | |
648 | 68 extern int new_lvar0(int sz, int align); |
327 | 69 extern int rvalue(int e); |
70 extern int rvalue_t(int e,int t); | |
331 | 71 extern int search_struct_type(int type,char *name,int *dsp); |
72 extern int strop(int e,int ind); | |
137 | 73 extern void arg_register(NMTBL *fnptr); |
438
626d705471d5
Unexecuted code in conditional. Lazy jmp code generation.
kono
parents:
397
diff
changeset
|
74 extern int bexpr(int e1, char cond, int l1); |
552 | 75 extern void checkret(void); // check delayed jump, delayed last exp |
327 | 76 extern void closing(); |
77 extern void cmpdimm(int e, int csreg,int label,int cond); | |
331 | 78 extern void codegen_decl_init(); /* called before each declaration */ |
327 | 79 extern void codegen_init(); /* called only once */ |
80 extern void codegen_reinit(); /* called for each file */ | |
692 | 81 extern void data_closing(int v); |
648 | 82 extern void df_label(int cslabel, int dlabel); |
327 | 83 extern void emit_init_vars(void); |
331 | 84 extern void fcheck(NMTBL *n); |
327 | 85 extern void fdecl_struct(int fntype); |
86 extern void free_lvar(int disp); | |
456 | 87 extern void gen_comment(char *s); |
327 | 88 extern void gen_code_enter(char *name); |
89 extern void gen_code_enter1(int args); | |
90 extern void gen_code_leave(char *name); | |
91 extern void gen_enter(char *name); | |
92 extern void gen_enter1(); | |
331 | 93 extern void gen_jmp(int l); |
363 | 94 extern void gen_indirect_goto(int e1); |
327 | 95 extern void gen_leave(int control, char *name); |
331 | 96 extern void init_free_lvar_list(); |
97 extern void lcheck(int e); | |
98 extern void opening(char *filename); | |
99 extern void parallel_rassign(int assigns); | |
100 extern void replace_return_struct(int func,int left); | |
327 | 101 extern void ret(void); |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
102 extern void gen_ret(void); |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
103 extern void gen_label_call(int l); |
692 | 104 extern void flush_delayed_decl_data(int v); |
696 | 105 extern void jump(int e,int env); |
715 | 106 extern int arg_alignment(int disp0,NMTBL *n,int type0,int sz); |
327 | 107 |
681 | 108 |
552 | 109 /* used by mc-inline */ |
110 | |
111 extern void checkjmp(int l); // generate delayed jump, l = current label | |
557 | 112 extern int reference(int e1); // recover lvalue from rvalue of memory or register |
113 extern int type_of_bop(int op); | |
114 extern int type_of_conv(int op); | |
681 | 115 extern int type_compatible(int t1, int t2); |
701 | 116 extern int gen_decl_data(int e,int v); |
552 | 117 |
118 /* used by mc-code-* */ | |
327 | 119 |
120 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
|
121 extern int b_expr(int e1, char cond, int l1,int err); |
327 | 122 extern int contains_p(int e,int (*p)(int)); |
449 | 123 extern int contains_p1(int arg,int e,int (*p)(int,int)); |
609 | 124 extern int contains_p2(int arg,int e,int (*p)(int,int)); |
61 | 125 extern void fwddef(int l); |
327 | 126 extern int fwdlabel(void); |
127 extern int g_expr(int e1); | |
128 extern int g_expr0(int e1); | |
129 extern int g_expr_u(int e1); | |
456 | 130 extern int is_const(int e); |
463 | 131 extern int is_memory(int e); |
547 | 132 extern int is_local_memory(int e1); |
98 | 133 extern int is_code(NMTBL *fnptr); |
134 extern int is_function(NMTBL *fnptr); | |
453 | 135 extern int is_inline(NMTBL *fnptr); |
327 | 136 extern int scalar(int t); |
336 | 137 extern int make_mask(int from,int to); |
716 | 138 extern void free_register_var(int reg_arg_list); |
336 | 139 |
341 | 140 extern void init_ptr_cache(); |
141 extern void clear_ptr_cache_reg(int r); | |
142 extern int last_ptr_cache(); | |
143 extern void clear_ptr_cache() ; | |
144 extern int get_ptr_cache(NMTBL *nptr); | |
61 | 145 |
715 | 146 // standard 32bit alignment |
147 extern int code_arg_alignment0(int disp0,NMTBL *n,int type0,int sz); | |
148 extern int code_lvar_alignment0(int disp0,NMTBL *n,int type0,int sz); | |
149 | |
366 | 150 extern int ilog(int i); |
151 | |
648 | 152 extern char * nm(NMTBL *n) ; |
153 extern int new_lvar_align(int size,int align); | |
154 | |
596 | 155 /* used by mc-tree */ |
156 | |
157 extern NMTBL str_ret; | |
158 | |
609 | 159 /* used by conv */ |
160 extern int rop_dual(int op); | |
161 extern int copy_expr(int e); | |
162 | |
648 | 163 |
164 | |
61 | 165 /* end */ |