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