Mercurial > hg > CbC > old > device
annotate mc.h @ 803:a5f9e5a4db1b i64-worked
global alignment
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 24 Nov 2010 18:52:28 +0900 |
parents | 75e30aea08cd |
children | 9745d517f113 |
rev | line source |
---|---|
0 | 1 /* Micro-C header file */ |
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 ***********************************************************************/ | |
24 | |
195 | 25 #define FLOAT_CODE 1 |
237 | 26 #define LONGLONG_CODE 1 |
292 | 27 #define CASE_CODE 1 |
316 | 28 #define ASM_CODE 1 |
329 | 29 #define BIT_FIELD_CODE 1 |
786
3ebbec5a72dc
i64 strinit inlined struct init does not zero fill
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
778
diff
changeset
|
30 #define STRUCT_ALIGN 1 |
3ebbec5a72dc
i64 strinit inlined struct init does not zero fill
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
778
diff
changeset
|
31 |
195 | 32 |
164 | 33 /* reserved word start */ |
34 | |
482 | 35 /* type ( keyword ) */ |
36 | |
327 | 37 #define INT (-1) |
38 #define UNSIGNED (-2) | |
39 #define CHAR (-3) | |
40 #define UCHAR (-4) | |
162 | 41 #define POINTER (-5) |
327 | 42 #define ARRAY (-6) |
43 #define STRUCT (-7) | |
44 #define UNION (-8) | |
45 #define FUNCTION (-9) | |
0 | 46 |
482 | 47 #define SIGNED (-10) |
48 #define LONG (-11) | |
49 #define SHORT (-12) | |
50 #define USHORT (-13) | |
51 #define VOID (-14) | |
52 #define CODE (-15) | |
53 #define ENUM (-16) | |
54 | |
55 #define FLOAT (-17) | |
56 #define DOUBLE (-18) | |
57 #define LONGLONG (-19) | |
58 #define ULONGLONG (-20) | |
59 | |
60 /* type qualifier */ | |
61 | |
62 #define KONST (-21) | |
63 #define STATIC (-22) | |
64 #define EXTRN (-23) | |
65 #define EXTRN1 (-24) | |
66 #define VOLATILE (-25) | |
67 #define RESTRICT (-26) | |
68 #define INLINE (-27) | |
691 | 69 #define NOINLINE (-28) |
70 #define REGISTER (-29) | |
71 #define FREGISTER (-30) | |
72 #define DREGISTER (-31) | |
73 #define LREGISTER (-32) | |
74 #define POSSIBLE_VALUES (-33) | |
482 | 75 |
691 | 76 #define DOTS (-34) |
0 | 77 |
482 | 78 /* keyword */ |
79 | |
691 | 80 #define GOTO (-35) |
81 #define RETURN (-36) | |
82 #define BREAK (-37) | |
83 #define CONTINUE (-38) | |
84 #define IF (-39) | |
85 #define ELSE (-40) | |
86 #define FOR (-41) | |
87 #define DO (-42) | |
88 #define WHILE (-43) | |
89 #define SWITCH (-44) | |
90 #define CASE (-45) | |
91 #define DEFAULT (-46) | |
92 #define RESERVE (-47) | |
93 #define TAG (-48) | |
94 #define FIELD (-49) | |
95 #define IDENT (-50) | |
96 #define MACRO (-51) | |
97 #define BLABEL (-52) | |
98 #define FLABEL (-53) | |
99 #define TYPEDEF (-54) | |
100 #define SIZEOF (-55) | |
101 #define TYPE (-56) | |
102 #define DEFINED (-57) | |
482 | 103 |
691 | 104 #define ENVIRONMENT (-58) |
482 | 105 |
691 | 106 #define FMACRO (-59) |
107 #define LMACRO (-60) | |
482 | 108 |
691 | 109 #define TYPEOF (-61) |
110 #define ASM (-62) | |
164 | 111 |
691 | 112 #define C_FILE (-63) |
113 #define C_FUNCTION (-64) | |
114 #define C_LINE (-65) | |
544 | 115 |
691 | 116 #define ALIGNED (-66) |
117 #define GENERATED (-67) | |
118 #define NORETURN (-68) | |
648 | 119 |
164 | 120 /* reserved word end */ |
78 | 121 |
327 | 122 #define EMPTY (-99) |
103 | 123 |
164 | 124 /* mode start */ |
327 | 125 #define TOP 0 |
126 #define GDECL 1 | |
127 #define GSDECL 2 | |
128 #define GUDECL 3 | |
129 #define ADECL 4 | |
130 #define LDECL 5 | |
131 #define LSDECL 6 | |
132 #define LUDECL 7 | |
0 | 133 #define STADECL 8 |
327 | 134 #define STAT 9 |
135 #define GTDECL 10 | |
136 #define LTDECL 11 | |
137 #define IFDEF 12 | |
138 #define MDECL 13 | |
176 | 139 #define GEDECL 14 |
140 #define LEDECL 15 | |
362 | 141 #define LLDECL 16 |
142 #define SFDINIT 17 | |
164 | 143 /* mode end */ |
144 | |
327 | 145 #define US 1 |
146 #define AS 10000 | |
147 #define SOP 200 | |
148 #define COP 400 | |
149 #define DOP 600 | |
150 #define FOP 800 | |
151 #define LOP 1000 | |
164 | 152 |
153 /* tree node tags start */ | |
154 | |
316 | 155 #define LIST_ARGS(i) (i==FUNCTION||i==CODE||i==ASM) |
599 | 156 #define OP(i) (i%SOP) /* tag value without attribute */ |
157 #define OP_TAG(i) (((i)/SOP)*SOP) /* attribute of tag */ | |
164 | 158 |
159 /* nullary argments */ | |
0 | 160 |
327 | 161 #define GVAR 1 |
162 #define RGVAR 2 | |
163 #define URGVAR 3 | |
164 #define LVAR 4 | |
165 #define RLVAR 5 | |
166 #define URLVAR 6 | |
167 #define CRGVAR (COP+RGVAR) | |
168 #define CURGVAR (COP+URGVAR) | |
169 #define CRLVAR (COP+RLVAR) | |
170 #define CURLVAR (COP+URLVAR) | |
171 #define FRGVAR (FOP+RGVAR) | |
172 #define FRLVAR (FOP+RLVAR) | |
173 #define DRGVAR (DOP+RGVAR) | |
174 #define DRLVAR (DOP+RLVAR) | |
175 #define SRGVAR (SOP+RGVAR) | |
176 #define SURGVAR (SOP+URGVAR) | |
177 #define SRLVAR (SOP+RLVAR) | |
178 #define SURLVAR (SOP+URLVAR) | |
179 #define LRGVAR (LOP+RGVAR) | |
180 #define LURGVAR (LOP+URGVAR) | |
181 #define LRLVAR (LOP+RLVAR) | |
182 #define LURLVAR (LOP+URLVAR) | |
164 | 183 |
327 | 184 #define CONST 7 |
185 #define DCONST (DOP+CONST) | |
186 #define FCONST (FOP+CONST) | |
187 #define LCONST (LOP+CONST) | |
188 #define STRING 8 | |
189 #define FNAME 9 | |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
190 #define LCALL 10 |
452 | 191 #define COMMENT 11 |
192 #define DECL 12 | |
193 #define COMP 13 | |
602 | 194 #define IVAR 14 |
195 #define RIVAR 15 | |
616 | 196 #define BUILTIN_INF 16 |
197 #define BUILTIN_INFF 17 | |
198 #define BUILTIN_INFL 18 | |
676 | 199 #define LABEL 19 |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
200 #define STRINGS 20 |
164 | 201 |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
202 #define NULLARY_ARGS(i) (i==RETURN||i==ENVIRONMENT||i==LCALL||i==REGISTER||i==DREGISTER||i==FREGISTER||i==LREGISTER||(GVAR<=(i%SOP)&&(i%SOP)<=LABEL)) |
164 | 203 |
204 /* unary argments */ | |
205 | |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
206 #define ADDRESS 21 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
207 #define MINUS 22 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
208 #define LNOT 23 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
209 #define BNOT 24 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
210 #define INC 25 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
211 #define PERIOD 26 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
212 #define ARROW 27 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
213 #define POSTINC 28 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
214 #define UPOSTINC 29 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
215 #define PREINC 30 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
216 #define UPREINC 31 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
217 #define POSTDEC 32 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
218 #define UPOSTDEC 33 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
219 #define PREDEC 34 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
220 #define UPREDEC 35 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
221 #define DEC 36 |
196 | 222 #define CPOSTINC (COP+POSTINC) |
223 #define CUPOSTINC (COP+UPOSTINC) | |
224 #define CPREINC (COP+PREINC) | |
225 #define CUPREINC (COP+UPREINC) | |
226 #define CPOSTDEC (COP+POSTDEC) | |
227 #define CUPOSTDEC (COP+UPOSTDEC) | |
228 #define CPREDEC (COP+CPREDEC) | |
229 #define CUPREDEC (COP+UPREDEC) | |
230 #define SPOSTINC (SOP+POSTINC) | |
231 #define SUPOSTINC (SOP+UPOSTINC) | |
232 #define SPREINC (SOP+PREINC) | |
233 #define SUPREINC (SOP+UPREINC) | |
234 #define SPOSTDEC (SOP+POSTDEC) | |
235 #define SUPOSTDEC (SOP+UPOSTDEC) | |
236 #define SPREDEC (SOP+PREDEC) | |
237 #define SUPREDEC (SOP+UPREDEC) | |
327 | 238 #define FPOSTINC (FOP+POSTINC) |
239 #define FPREINC (FOP+PREINC) | |
240 #define DPOSTINC (DOP+POSTINC) | |
241 #define DPREINC (DOP+PREINC) | |
242 #define LPOSTINC (LOP+POSTINC) | |
243 #define LPREINC (LOP+PREINC) | |
244 #define LUPOSTINC (LOP+UPOSTINC) | |
245 #define LUPREINC (LOP+UPREINC) | |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
246 #define INDIRECT 37 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
247 #define RINDIRECT 38 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
248 #define URINDIRECT 39 |
327 | 249 #define CRINDIRECT (COP+RINDIRECT) |
250 #define CURINDIRECT (COP+URINDIRECT) | |
251 #define SRINDIRECT (SOP+RINDIRECT) | |
252 #define SURINDIRECT (SOP+URINDIRECT) | |
253 #define FRINDIRECT (FOP+RINDIRECT) | |
254 #define DRINDIRECT (DOP+RINDIRECT) | |
255 #define LRINDIRECT (LOP+RINDIRECT) | |
256 #define LURINDIRECT (LOP+URINDIRECT) | |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
257 #define RSTRUCT 40 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
258 #define ALLOCA 41 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
259 #define BUILTINP 42 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
260 #define BUILTIN_EXPECT 43 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
261 #define BUILTIN_FABS 44 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
262 #define BUILTIN_FABSF 45 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
263 #define BUILTIN_FABSL 46 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
264 #define ATTRIBUTE 47 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
265 #define BIT_FIELD 48 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
266 #define RBIT_FIELD 49 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
267 #define BPREINC 50 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
268 #define BPOSTINC 51 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
269 #define CAST 52 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
270 #define DECL_DATA 53 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
271 #define CONV 54 |
164 | 272 |
273 #define UNARY_ARGS(i) (ADDRESS<=(i%SOP)&&(i%SOP)<=CONV) | |
274 | |
275 /* binary argments */ | |
276 | |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
277 #define MUL 55 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
278 #define UMUL 56 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
279 #define DIV 57 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
280 #define UDIV 58 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
281 #define MOD 59 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
282 #define UMOD 60 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
283 #define ADD 61 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
284 #define SUB 62 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
285 #define CMP 63 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
286 #define RSHIFT 64 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
287 #define URSHIFT 65 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
288 #define LSHIFT 66 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
289 #define ULSHIFT 67 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
290 #define GT 68 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
291 #define UGT 69 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
292 #define GE 70 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
293 #define UGE 71 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
294 #define LT 72 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
295 #define ULT 73 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
296 #define LE 74 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
297 #define ULE 75 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
298 #define EQ 76 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
299 #define NEQ 77 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
300 #define BAND 78 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
301 #define EOR 79 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
302 #define BOR 80 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
303 #define LAND 81 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
304 #define LOR 82 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
305 #define ASS 83 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
306 #define UCMP 84 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
307 #define UCMPGE 85 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
308 #define CMPGE 86 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
309 #define CMPEQ 87 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
310 #define CMPNEQ 88 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
311 #define ASSOP 89 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
312 #define UASSOP 90 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
313 #define COMMA 91 |
164 | 314 |
612 | 315 #define CASS (COP+ASS) |
316 #define CASSOP (COP+ASSOP) | |
317 #define CUASSOP (COP+UASSOP) | |
0 | 318 |
612 | 319 #define SASS (SOP+ASS) |
320 #define SASSOP (SOP+ASSOP) | |
321 #define SUASSOP (SOP+UASSOP) | |
164 | 322 |
327 | 323 #define DASS (DOP+ASS) |
324 #define DCMPGE (DOP+CMPGE) | |
325 #define DCMPEQ (DOP+CMPEQ) | |
326 #define DCMPNEQ (DOP+CMPNEQ) | |
327 #define DASSOP (DOP+ASSOP) | |
328 #define DCMP (DOP+CMP) | |
329 #define DMINUS (DOP+MINUS) | |
330 #define DMUL (DOP+MUL) | |
331 #define DDIV (DOP+DIV) | |
332 #define DADD (DOP+ADD) | |
333 #define DSUB (DOP+SUB) | |
164 | 334 |
327 | 335 #define FASS (FOP+ASS) |
336 #define FCMPGE (FOP+CMPGE) | |
337 #define FCMPEQ (FOP+CMPEQ) | |
338 #define FCMPNEQ (FOP+CMPNEQ) | |
339 #define FASSOP (FOP+ASSOP) | |
340 #define FCMP (FOP+CMP) | |
341 #define FMINUS (FOP+MINUS) | |
342 #define FMUL (FOP+MUL) | |
343 #define FDIV (FOP+DIV) | |
344 #define FADD (FOP+ADD) | |
345 #define FSUB (FOP+SUB) | |
78 | 346 |
327 | 347 #define LASS (LOP+CASS) |
348 #define LCMPGE (LOP+CMPGE) | |
349 #define LCMPEQ (LOP+CMPEQ) | |
350 #define LCMPNEQ (LOP+CMPNEQ) | |
195 | 351 #define LASSOP (LOP+CASSOP) |
164 | 352 #define LUASSOP (LOP+CUASSOP) |
327 | 353 #define LCMP (LOP+CMP) |
354 #define LMINUS (LOP+MINUS) | |
355 #define LMUL (LOP+MUL) | |
356 #define LDIV (LOP+DIV) | |
357 #define LUMUL (LOP+UMUL) | |
358 #define LUDIV (LOP+UDIV) | |
359 #define LADD (LOP+ADD) | |
360 #define LSUB (LOP+SUB) | |
81 | 361 |
195 | 362 |
327 | 363 #define LMOD (LOP+MOD) |
364 #define LUMOD (LOP+UMOD) | |
365 #define LLSHIFT (LOP+LSHIFT) | |
366 #define LULSHIFT (LOP+ULSHIFT) | |
367 #define LRSHIFT (LOP+RSHIFT) | |
368 #define LURSHIFT (LOP+URSHIFT) | |
369 #define LBAND (LOP+BAND) | |
370 #define LEOR (LOP+EOR) | |
371 #define LBOR (LOP+BOR) | |
195 | 372 |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
373 #define BASS 92 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
374 #define BASSOP 93 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
375 #define BFD_REPL 94 |
195 | 376 |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
377 #define JUMP 95 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
378 #define DECL_DATA_ARRAY 96 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
379 #define DECL_DATA_LIST 97 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
380 #define DECL_DATA_FIELD 98 |
609 | 381 |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
382 #define STASS 99 |
326 | 383 |
164 | 384 |
651 | 385 #define BINARY_ARGS(i) ((MUL<=(i%SOP)&&(i%SOP)<=STASS)||i==ARRAY) |
164 | 386 |
609 | 387 /* ternary argments */ |
164 | 388 |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
389 #define COND 100 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
390 #define UCOND 101 |
327 | 391 #define SCOND (SOP+COND) |
490 | 392 #define SUCOND (SOP+UCOND) |
327 | 393 #define DCOND (DOP+COND) |
394 #define FCOND (FOP+COND) | |
395 #define LCOND (LOP+COND) | |
490 | 396 #define LUCOND (LOP+UCOND) |
164 | 397 |
609 | 398 #define TERNARY_ARGS(i) (COND==(i%SOP)||UCOND==(i%SOP)) |
164 | 399 |
400 /* not appeared as tags */ | |
81 | 401 |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
402 #define LPAR 102 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
403 #define RPAR 103 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
404 #define LBRA 104 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
405 #define RBRA 105 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
406 #define LC 106 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
407 #define RC 107 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
408 #define COLON 108 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
409 #define SM 109 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
410 #define CNAME 110 |
194 | 411 |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
412 #define I2C 111 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
413 #define I2S 112 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
414 #define I2I 113 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
415 #define I2U 114 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
416 #define I2D 115 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
417 #define I2F 116 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
418 #define I2LL 117 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
419 #define I2ULL 118 |
353 | 420 |
778
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
421 #define U2UC 119 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
422 #define U2US 120 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
423 #define U2I 121 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
424 #define U2U 122 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
425 #define U2D 123 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
426 #define U2F 124 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
427 #define U2LL 125 |
a177c65f3e37
large string (STRINGS)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
731
diff
changeset
|
428 #define U2ULL 126 |
353 | 429 |
194 | 430 |
327 | 431 #define D2I (DOP+I2I) |
432 #define D2U (DOP+I2U) | |
433 #define D2D (DOP+I2D) | |
434 #define D2F (DOP+I2F) | |
435 #define D2LL (DOP+I2LL) | |
436 #define D2ULL (DOP+I2ULL) | |
164 | 437 |
327 | 438 #define F2I (FOP+I2I) |
439 #define F2U (FOP+I2U) | |
440 #define F2D (FOP+I2D) | |
441 #define F2F (FOP+I2F) | |
442 #define F2LL (FOP+I2LL) | |
443 #define F2ULL (FOP+I2ULL) | |
194 | 444 |
327 | 445 #define LL2I (LOP+I2I) |
446 #define LL2U (LOP+I2U) | |
447 #define LL2D (LOP+I2D) | |
448 #define LL2F (LOP+I2F) | |
449 #define LL2LL (LOP+I2LL) | |
450 #define LL2ULL (LOP+I2ULL) | |
194 | 451 |
327 | 452 #define ULL2I (LOP+U2I) |
453 #define ULL2U (LOP+U2U) | |
454 #define ULL2D (LOP+U2D) | |
455 #define ULL2F (LOP+U2F) | |
456 #define ULL2LL (LOP+U2LL) | |
457 #define ULL2ULL (LOP+U2ULL) | |
194 | 458 |
791 | 459 #define BUILTIN_TYPES_COMPATIBLE_P 127 |
460 | |
164 | 461 /* tree node tags end */ |
462 | |
453 | 463 /* statement start */ |
464 | |
791 | 465 #define ST_DECL 128 |
466 #define ST_IF 129 | |
467 #define ST_DO 130 | |
468 #define ST_WHILE 131 | |
469 #define ST_FOR 132 | |
470 #define ST_SWITCH 133 | |
471 #define ST_COMP 134 | |
472 #define ST_BREAK 135 | |
473 #define ST_CONTINUE 136 | |
474 #define ST_CASE 137 | |
475 #define ST_DEFAULT 138 | |
476 #define ST_RETURN 139 | |
477 #define ST_GOTO 140 | |
478 #define ST_ASM 141 | |
479 #define ST_LABEL 142 | |
480 #define ST_OP 143 | |
481 #define ST_COMMENT 144 | |
453 | 482 |
509 | 483 #define IS_STATEMENT(i) (i==INLINE||(ST_DECL<=i&&i<=ST_COMMENT)) |
453 | 484 |
791 | 485 #define HAS_ADDRESS 145 |
526 | 486 |
453 | 487 /* statement end */ |
488 | |
164 | 489 /* error number start */ |
0 | 490 |
327 | 491 #define FILERR 1 |
492 #define DCERR 2 | |
493 #define RDERR 3 | |
494 #define STERR 4 | |
495 #define EXERR 5 | |
496 #define CNERR 6 | |
497 #define CHERR 7 | |
498 #define GSERR 8 | |
499 #define LSERR 9 | |
500 #define STRERR 10 | |
501 #define LNERR 11 | |
502 #define EOFERR 12 | |
503 #define MCERR 13 | |
504 #define INCERR 14 | |
505 #define HPERR 15 | |
506 #define TYERR 16 | |
507 #define LVERR 17 | |
508 #define UDERR 18 | |
509 #define OPTION 19 | |
510 #define REG_ERR 20 | |
389 | 511 #define RGERR 21 |
512 #define CODE_ERR 22 | |
513 #define MSERR 23 | |
514 #define BTERR 24 | |
515 #define HSERR 25 | |
516 #define NMERR 26 | |
517 #define MMERR 27 | |
518 #define INERR 28 | |
523 | 519 #define AGERR 29 |
520 #define ILERR 30 | |
558 | 521 #define CSERR 31 |
572 | 522 #define GTERR 32 |
523 #define FNERR 33 | |
524 #define UCERR 34 | |
525 #define UFERR 35 | |
574 | 526 #define ENERR 36 |
655 | 527 #define RETERR 37 |
681 | 528 #define UFLDERR 38 |
529 #define SIERR 39 | |
327 | 530 |
164 | 531 /* error number end */ |
0 | 532 |
526 | 533 /* ctmode bit */ |
534 | |
461 | 535 #define KONST_BIT 1 |
536 #define VOLATILE_BIT 2 | |
537 #define RESTRICT_BIT 4 | |
538 | |
25 | 539 #define FILES 10 |
327 | 540 #define MAX_INCLUDE_PATH_COUNT 10 |
448 | 541 /* |
542 For this comiler 8192*2 is Ok. Linux kernel requires 8192*4. | |
609 | 543 we need automatic increment of gsyms? |
448 | 544 */ |
609 | 545 #define GSYMS (8192*32) |
690 | 546 #define HEAPSIZE 150000 |
452 | 547 #define CHEAPSIZE (sizeof(NMTBL)*8192) |
327 | 548 #define LBUFSIZE 4096 |
347 | 549 #define STRSIZE 4096 |
254 | 550 |
0 | 551 typedef struct nametable { |
327 | 552 char *nm; |
348 | 553 struct nametable *next; |
445 | 554 int sc,attr; |
712 | 555 int ty,dsp; |
556 union { | |
557 struct nametable *nptr; | |
558 char *nm; | |
559 } u; | |
560 } NMTBL; | |
0 | 561 |
452 | 562 extern int *heap; /* heap area (in cheap ) */ |
563 extern NMTBL *global_list; /* list of all global NMTBL */ | |
564 extern NMTBL *local_static_list; /* list of local static variable */ | |
0 | 565 |
195 | 566 #if FLOAT_CODE |
81 | 567 extern int dlist2(int e1, double e2); |
195 | 568 #endif |
569 #if LONGLONG_CODE | |
570 extern int llist2(int e1, long long e2); | |
571 #endif | |
61 | 572 extern int list2(int e1, int e2); |
573 extern int list3(int e1, int e2, int e3); | |
711 | 574 extern int list3n(int e1, int e2, NMTBL *e3); |
575 extern int glist3n(int e1, int e2, NMTBL *e3); | |
61 | 576 extern int list4(int e1, int e2, int e3,int e4); |
711 | 577 extern int list4n(int e1, int e2, int e3,NMTBL *e4); |
712 | 578 extern int list4s(int e1, int e2, int e3,char *e4); |
711 | 579 extern int glist4n(int e1, int e2, int e3,NMTBL *e4); |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
580 extern int list5(int e1, int e2, int e3,int e4,int e5); |
712 | 581 extern int list5n(int e1, int e2, int e3,int e4,NMTBL * e5); |
318 | 582 extern int length(int e1); |
464 | 583 extern int getfree(int size); |
318 | 584 extern int nth(int n,int e1); |
61 | 585 extern int reverse0(int t1); |
586 extern int append4(int p,int a1,int a2,int a3); | |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
587 extern int append5(int p,int a1,int a2,int a3,int a4); |
309 | 588 extern int insert_ascend(int p,int e,int eq()); |
61 | 589 |
347 | 590 extern void free_nptr(NMTBL *n); |
591 extern NMTBL *get_nptr(); | |
346 | 592 |
716 | 593 #define align(x,alig) ((x+(alig-1))&~(alig-1)) |
594 | |
609 | 595 // mc-tree.c |
596 | |
597 extern void print_expr(int e, FILE *vout); | |
598 | |
716 | 599 |
731 | 600 // #if 1 |
601 //extern int heapsize; | |
602 // #define CHECK_HEAP1(b) ({int _k=(int)(b);if(_k>heapsize||_k<=0)error(-1);_k;}) | |
603 //#else | |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
604 #define CHECK_HEAP(b) (b) |
731 | 605 //#endif |
33 | 606 |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
607 #define car(e) (heap[(int)(CHECK_HEAP(e))]) |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
608 |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
609 #define cadr(e) (heap[((int)(CHECK_HEAP(e)))+1]) |
33 | 610 |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
611 #define caddr(e) (heap[((int)(CHECK_HEAP(e)))+2]) |
33 | 612 |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
613 #define cadddr(e) (heap[((int)(CHECK_HEAP(e)))+3]) |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
614 |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
449
diff
changeset
|
615 #define caddddr(e) (heap[((int)(CHECK_HEAP(e)))+4]) |
449 | 616 |
711 | 617 #define ncaddr(e) (*(NMTBL**)&heap[((int)(e))+2]) |
618 | |
619 #define ncadddr(e) (*(NMTBL**)&heap[((int)(e))+3]) | |
620 | |
712 | 621 #define ncaddddr(e) (*(NMTBL**)&heap[((int)(e))+4]) |
622 | |
711 | 623 #define vcaddr(e) (*(void**)&heap[((int)(e))+2]) |
624 | |
625 #define vcadddr(e) (*(void**)&heap[((int)(e))+3]) | |
626 | |
627 #define pcaddr(e) (*(int**)&heap[((int)(e))+2]) | |
628 | |
629 #define pcadddr(e) (*(int**)&heap[((int)(e))+3]) | |
630 | |
712 | 631 #define scaddr(e) (*(char**)&heap[((int)(e))+2]) |
632 #ifdef NOTHREAD | |
633 my_spe_run_thread(t_args); | |
634 #endif | |
635 #define scadddr(e) (*(char**)&heap[((int)(e))+3]) | |
636 | |
195 | 637 #if FLOAT_CODE |
81 | 638 #define dcadr(e) (*(double*)&heap[((int)(e))+1]) |
639 #define dcaddr(e) (*(double*)&heap[((int)(e))+2]) | |
195 | 640 #endif |
641 | |
642 #if LONGLONG_CODE | |
643 #define lcadr(e) (*(long long*)&heap[((int)(e))+1]) | |
644 #define lcaddr(e) (*(long long*)&heap[((int)(e))+2]) | |
645 #endif | |
81 | 646 |
33 | 647 /* end */ |