d0707820cdb65ad4f0415b77577fcb5f12853e1e
[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 Load = dict(
170         ins      = [ "mem", "ptr" ],
171         outs     = [ "M", "X_regular", "X_except", "res" ],
172         attrs    = [
173                 dict(
174                         type = "ir_mode*",
175                         name = "mode",
176                         java_name = "load_mode"
177                 ),
178         ],
179         constructor_args = [
180                 dict(
181                         type = "cons_flags",
182                         name = "flags",
183                 ),
184         ],
185 ),
186
187 Store = dict(
188         ins      = [ "mem", "ptr", "value" ],
189         outs     = [ "M", "X_regular", "X_except" ],
190         constructor_args = [
191                 dict(
192                         type = "cons_flags",
193                         name = "flags",
194                 ),
195         ],
196 ),
197
198 Anchor = dict(
199         mode       = "mode_ANY",
200         ins        = [ "end_block", "start_block", "end", "start",
201                        "end_reg", "end_except", "initial_exec",
202                                    "frame", "tls", "initial_mem", "args",
203                                    "bad", "no_mem" ],
204         knownBlock = True,
205         noconstr   = True
206 ),
207
208 NoMem = dict(
209         mode       = "mode_M",
210         knownBlock = True,
211 ),
212
213 Bad = dict(
214         mode       = "mode_Bad",
215         knownBlock = True,
216 ),
217
218 Pin = dict(
219         ins      = [ "op" ],
220         mode     = "get_irn_mode(op);"
221 ),
222
223 Proj = dict(
224         ins      = [ "pred" ],
225         attrs    = [
226                 dict(
227                         type = "long",
228                         name = "proj"
229                 )
230         ]
231 ),
232
233 Sel = dict(
234         ins    = [ "mem", "ptr" ],
235         arity  = "variable",
236         mode   = "mode_P",
237         attrs    = [
238                 dict(
239                         type = "ir_entity*",
240                         name = "entity"
241                 )
242         ]
243 ),
244
245 Sync = dict(
246         mode     = "mode_M",
247         arity    = "dynamic"
248 ),
249
250 Tuple = dict(
251         arity    = "variable",
252         mode     = "mode_T",
253 ),
254
255 Unknown = dict(
256         knownBlock = True
257 ),
258
259 Confirm = dict(
260         ins      = [ "value", "bound" ],
261         block    = "get_nodes_block(value)",
262         mode     = "get_irn_mode(value)",
263         attrs    = [
264                 dict(
265                         name = "cmp",
266                         type = "pn_Cmp"
267                 ),
268         ],
269 ),
270
271 Return = dict(
272         ins      = [ "mem" ],
273         arity    = "variable",
274         mode     = "mode_X"
275 ),
276
277 unop = dict(
278         abstract = True,
279         ins      = [ "op" ]
280 ),
281
282 Minus = dict(
283         is_a     = "unop"
284 ),
285
286 Mux = dict(
287         ins      = [ "sel", "false", "true" ]
288 ),
289
290 Cond = dict(
291         ins      = [ "selector" ],
292         outs     = [ "false", "true" ],
293 ),
294
295 Cmp = dict(
296         is_a     = "binop",
297         outs     = [ "False", "Eq", "Lt", "Le", "Gt", "Ge", "Lg", "Leg", "Uo", "Ue", "Ul", "Ule", "Ug", "Uge", "Ne", "True" ],
298 ),
299
300 Conv = dict(
301         is_a     = "unop"
302 ),
303
304 Alloc = dict(
305         ins   = [ "mem", "size" ],
306         outs  = [ "M", "X_regular", "X_except", "res" ],
307         attrs = [
308                 dict(
309                         name = "type",
310                         type = "ir_type*"
311                 ),
312                 dict(
313                         name = "where",
314                         type = "ir_where_alloc"
315                 )
316         ]
317 ),
318
319 Free = dict(
320         ins   = [ "mem", "ptr", "size" ],
321         mode  = "mode_M",
322         attrs = [
323                 dict(
324                         name = "type",
325                         type = "ir_type*"
326                 ),
327                 dict(
328                         name = "where",
329                         type = "ir_where_alloc"
330                 )
331         ]
332 ),
333 )