f997b02d7e1888505c18ae72f03b6585ca293ffc
[libfirm] / scripts / ir_spec.py
1 nodes = dict(
2 Start = dict(
3         mode       = "mode_T",
4         op_flags   = "cfopcode",
5         state      = "pinned",
6         knownBlock = True,
7         noconstr   = True,
8 ),
9
10 End = dict(
11         mode       = "mode_X",
12         op_flags   = "cfopcode",
13         state      = "pinned",
14         arity      = "dynamic",
15         knownBlock = True,
16         noconstr   = True,
17 ),
18
19 Phi = dict(
20         noconstr = True,
21         state    = "pinned",
22         arity    = "variable",
23 ),
24
25 Jmp = dict(
26         mode     = "mode_X",
27         op_flags = "cfopcode",
28         state    = "pinned",
29         ins      = [],
30 ),
31
32 IJmp = dict(
33         mode     = "mode_X",
34         op_flags = "cfopcode",
35         state    = "pinned",
36         ins      = [ "target" ],
37 ),
38
39 Const = dict(
40         mode       = "",
41         knownBlock = True,
42         attrs      = [
43                 dict(
44                         type = "tarval*",
45                         name = "tarval",
46                 )
47         ],
48 ),
49
50 Block = dict(
51         mode   = "mode_BB",
52         knownBlock = True,
53         noconstr   = True,
54         arity      = "variable",
55         java_add   = '''
56         public void addPred(Node node) {
57                 binding_cons.add_immBlock_pred(ptr, node.ptr);
58         }
59
60         public void mature() {
61                 binding_cons.mature_immBlock(ptr);
62         }
63
64         @Override
65         public Block getBlock() {
66                 return null;
67         }
68
69         public boolean blockVisited() {
70                 return 0 != binding.Block_block_visited(ptr);
71         }
72
73         public void markBlockVisited() {
74                 binding.mark_Block_block_visited(ptr);
75         }''',
76 ),
77
78 SymConst = dict(
79         mode       = "mode_P",
80         knownBlock = True,
81         noconstr   = True,
82         attrs      = [
83                 dict(
84                         type = "ir_entity*",
85                         name = "entity"
86                 )
87         ],
88 ),
89
90 # SymConst
91
92 Call = dict(
93         ins      = [ "mem", "ptr" ],
94         arity    = "variable",
95         outs     = [ "M_regular", "X_regular", "X_except", "T_result", "M_except", "P_value_res_base" ],
96         attrs    = [
97                 dict(
98                         type = "ir_type*",
99                         name = "type"
100                 )
101         ]
102 ),
103
104 binop = dict(
105         abstract = True,
106         ins      = [ "left", "right" ]
107 ),
108
109 Add = dict(
110         is_a     = "binop"
111 ),
112
113 Carry = dict(
114         is_a     = "binop"
115 ),
116
117 Sub = dict(
118         is_a     = "binop"
119 ),
120
121 Borrow = dict(
122         is_a     = "binop"
123 ),
124
125 Mul = dict(
126         is_a     = "binop"
127 ),
128
129 Mulh = dict(
130         is_a     = "binop"
131 ),
132
133 Abs = dict(
134         is_a     = "unop"
135 ),
136
137 And = dict(
138         is_a     = "binop"
139 ),
140
141 Or = dict(
142         is_a     = "binop"
143 ),
144
145 Eor = dict(
146         is_a     = "binop"
147 ),
148
149 Not = dict(
150         is_a     = "unop"
151 ),
152
153 Shl = dict(
154         is_a     = "binop"
155 ),
156
157 Shr = dict(
158         is_a     = "binop"
159 ),
160
161 Shrs = dict(
162         is_a     = "binop"
163 ),
164
165 Rotl = dict(
166         is_a     = "binop"
167 ),
168
169 Quot = dict(
170         ins   = [ "mem", "dividend", "divisor" ],
171         outs  = [ "M", "X_regular", "X_except", "res" ],
172         attrs = [
173                 dict(
174                         type = "ir_mode*",
175                         name = "resmode"
176                 ),
177                 dict(
178                         name = "state",
179                         type = "op_pin_state"
180                 )
181         ]
182 ),
183
184 Div = dict(
185         ins   = [ "mem", "dividend", "divisor" ],
186         outs  = [ "M", "X_regular", "X_except", "res" ],
187         attrs = [
188                 dict(
189                         type = "ir_mode*",
190                         name = "resmode"
191                 ),
192                 dict(
193                         name = "state",
194                         type = "op_pin_state"
195                 )
196         ]
197 ),
198
199 DivMod = dict(
200         ins   = [ "mem", "dividend", "divisor" ],
201         outs  = [ "M", "X_regular", "X_except", "res_div", "res_mod" ],
202         attrs = [
203                 dict(
204                         type = "ir_mode*",
205                         name = "resmode"
206                 ),
207                 dict(
208                         name = "state",
209                         type = "op_pin_state"
210                 )
211         ]
212 ),
213
214 Mod = dict(
215         ins   = [ "mem", "dividend", "divisor" ],
216         outs  = [ "M", "X_regular", "X_except", "res" ],
217         attrs = [
218                 dict(
219                         type = "ir_mode*",
220                         name = "resmode"
221                 ),
222                 dict(
223                         name = "state",
224                         type = "op_pin_state"
225                 )
226         ]
227 ),
228
229 Load = dict(
230         ins      = [ "mem", "ptr" ],
231         outs     = [ "M", "X_regular", "X_except", "res" ],
232         attrs    = [
233                 dict(
234                         type = "ir_mode*",
235                         name = "mode",
236                         java_name = "load_mode"
237                 ),
238         ],
239         constructor_args = [
240                 dict(
241                         type = "cons_flags",
242                         name = "flags",
243                 ),
244         ],
245 ),
246
247 Store = dict(
248         ins      = [ "mem", "ptr", "value" ],
249         outs     = [ "M", "X_regular", "X_except" ],
250         constructor_args = [
251                 dict(
252                         type = "cons_flags",
253                         name = "flags",
254                 ),
255         ],
256 ),
257
258 Anchor = dict(
259         mode       = "mode_ANY",
260         ins        = [ "end_block", "start_block", "end", "start",
261                        "end_reg", "end_except", "initial_exec",
262                                    "frame", "tls", "initial_mem", "args",
263                                    "bad", "no_mem" ],
264         knownBlock = True,
265         noconstr   = True
266 ),
267
268 NoMem = dict(
269         mode       = "mode_M",
270         knownBlock = True,
271 ),
272
273 Bad = dict(
274         mode       = "mode_Bad",
275         knownBlock = True,
276 ),
277
278 Pin = dict(
279         ins      = [ "op" ],
280         mode     = "get_irn_mode(op);"
281 ),
282
283 Proj = dict(
284         ins      = [ "pred" ],
285         attrs    = [
286                 dict(
287                         type = "long",
288                         name = "proj"
289                 )
290         ]
291 ),
292
293 Sel = dict(
294         ins    = [ "mem", "ptr" ],
295         arity  = "variable",
296         mode   = "mode_P",
297         attrs    = [
298                 dict(
299                         type = "ir_entity*",
300                         name = "entity"
301                 )
302         ]
303 ),
304
305 Sync = dict(
306         mode     = "mode_M",
307         arity    = "dynamic"
308 ),
309
310 Tuple = dict(
311         arity    = "variable",
312         mode     = "mode_T",
313 ),
314
315 Unknown = dict(
316         knownBlock = True
317 ),
318
319 Confirm = dict(
320         ins      = [ "value", "bound" ],
321         block    = "get_nodes_block(value)",
322         mode     = "get_irn_mode(value)",
323         attrs    = [
324                 dict(
325                         name = "cmp",
326                         type = "pn_Cmp"
327                 ),
328         ],
329 ),
330
331 Return = dict(
332         ins      = [ "mem" ],
333         arity    = "variable",
334         mode     = "mode_X"
335 ),
336
337 unop = dict(
338         abstract = True,
339         ins      = [ "op" ]
340 ),
341
342 Minus = dict(
343         is_a     = "unop"
344 ),
345
346 Mux = dict(
347         ins      = [ "sel", "false", "true" ]
348 ),
349
350 Cond = dict(
351         ins      = [ "selector" ],
352         outs     = [ "false", "true" ],
353 ),
354
355 Cmp = dict(
356         is_a     = "binop",
357         outs     = [ "False", "Eq", "Lt", "Le", "Gt", "Ge", "Lg", "Leg", "Uo", "Ue", "Ul", "Ule", "Ug", "Uge", "Ne", "True" ],
358 ),
359
360 Conv = dict(
361         is_a     = "unop"
362 ),
363
364 Alloc = dict(
365         ins   = [ "mem", "size" ],
366         outs  = [ "M", "X_regular", "X_except", "res" ],
367         attrs = [
368                 dict(
369                         name = "type",
370                         type = "ir_type*"
371                 ),
372                 dict(
373                         name = "where",
374                         type = "ir_where_alloc"
375                 )
376         ]
377 ),
378
379 Free = dict(
380         ins   = [ "mem", "ptr", "size" ],
381         mode  = "mode_M",
382         attrs = [
383                 dict(
384                         name = "type",
385                         type = "ir_type*"
386                 ),
387                 dict(
388                         name = "where",
389                         type = "ir_where_alloc"
390                 )
391         ]
392 ),
393 )