ir_spec.py 17.3 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from spec_util import abstract, setnodedefaults

class Op(object):
	"Base class for firm nodes"
abstract(Op)

class Unop(Op):
	"Unary nodes have exactly 1 input"
	name     = "unop"
	ins      = [ "op" ]
	op_index = 0
	pinned   = "no"
abstract(Unop)

class Binop(Op):
	"Binary nodes have exactly 2 inputs"
	name     = "binop"
	ins      = [ "left", "right" ]
	op_index = 0
	pinned   = "no"
abstract(Binop)

class Add(Binop):
	flags = ["commutative"]

class Alloc(Op):
27
	ins   = [ "mem", "count" ]
28
29
30
31
32
33
	outs  = [
		("M",         "memory result",                         "pn_Generic_M"),
		("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"),
		("X_except",  "control flow when exception occured",   "pn_Generic_X_except"),
		("res",       "pointer to newly allocated memory",     "pn_Generic_other"),
	]
34
	flags = [ "fragile", "uses_memory" ]
35
36
37
38
39
40
41
42
43
	attrs = [
		dict(
			name = "type",
			type = "ir_type*"
		),
		dict(
			name = "where",
			type = "ir_where_alloc"
		)
44
45
46
47
48
49
50
51
52
	]
	pinned      = "yes"
	attr_struct = "alloc_attr"

class Anchor(Op):
	mode        = "mode_ANY"
	arity       = "variable"
	flags       = [ "dump_noblock" ]
	pinned      = "yes"
53
	attr_struct = "irg_attr"
54
55
56
57
58
59
60
61
62
63
64
65
	knownBlock  = True
	singleton   = True

class And(Binop):
	flags    = [ "commutative" ]

class ASM(Op):
	mode          = "mode_T"
	arity         = "variable"
	flags         = [ "keep", "uses_memory" ]
	pinned        = "memory"
	pinned_init   = "op_pin_state_pinned"
66
67
	attr_struct   = "asm_attr"
	attrs_name    = "assem"
68
69
70
71
72
73
74
75
	attrs = [
		dict(
			name = "input_constraints",
			type = "ir_asm_constraint*",
		),
		dict(
			name = "n_output_constraints",
			type = "int",
76
			noprop = True,
77
78
79
80
81
82
83
84
		),
		dict(
			name = "output_constraints",
			type = "ir_asm_constraint*",
		),
		dict(
			name = "n_clobbers",
			type = "int",
85
			noprop = True,
86
87
88
89
90
91
92
93
94
		),
		dict(
			name = "clobbers",
			type = "ident**",
		),
		dict(
			name = "text",
			type = "ident*",
		),
95
96
97
98
	]
	java_noconstr = True

class Bad(Op):
Matthias Braun's avatar
Matthias Braun committed
99
	mode        = "mode_Bad"
100
	flags       = [ "cfopcode", "start_block", "dump_noblock" ]
Matthias Braun's avatar
Matthias Braun committed
101
102
103
	pinned      = "yes"
	knownBlock  = True
	singleton   = True
104
	attr_struct = "bad_attr"
105
106
	init = '''
	res->attr.irg.irg = irg;
107
108
	'''

109
110
111
112
113
114
115
class Deleted(Op):
	mode        = "mode_Bad"
	flags       = [ ]
	pinned      = "yes"
	knownBlock  = True
	singleton   = True

116
117
118
119
120
121
122
123
124
125
class Block(Op):
	mode        = "mode_BB"
	knownBlock  = True
	block       = "NULL"
	pinned      = "yes"
	optimize    = False
	arity       = "variable"
	flags       = [ "labeled" ]
	attr_struct = "block_attr"
	java_noconstr = True
Moritz Kroll's avatar
Moritz Kroll committed
126
127
128

	init = '''
	res->attr.block.is_dead     = 0;
129
	res->attr.block.irg.irg     = irg;
Moritz Kroll's avatar
Moritz Kroll committed
130
131
132
133
	res->attr.block.backedge    = new_backedge_arr(irg->obst, arity);
	res->attr.block.in_cg       = NULL;
	res->attr.block.cg_backedge = NULL;
	res->attr.block.extblk      = NULL;
134
	res->attr.block.entity      = NULL;
Moritz Kroll's avatar
Moritz Kroll committed
135
136
137

	set_Block_matured(res, 1);
	set_Block_block_visited(res, 0);
138
139

	/* Create and initialize array for Phi-node construction. */
140
141
142
	if (get_irg_phase_state(irg) == phase_building) {
		res->attr.block.graph_arr = NEW_ARR_D(ir_node *, irg->obst, irg->n_loc);
		memset(res->attr.block.graph_arr, 0, irg->n_loc * sizeof(ir_node*));
143
	}
144
	'''
145

146
147
	java_add   = '''
	public void addPred(Node node) {
148
		binding_ircons.add_immBlock_pred(ptr, node.ptr);
149
150
151
	}

	public void mature() {
152
		binding_ircons.mature_immBlock(ptr);
153
154
155
156
157
158
159
160
	}

	@Override
	public Block getBlock() {
		return null;
	}

	public boolean blockVisited() {
161
		return 0 != binding_irnode.Block_block_visited(ptr);
162
163
164
	}

	public void markBlockVisited() {
165
		binding_irnode.mark_Block_block_visited(ptr);
166
167
168
	}

	public boolean isBad() {
169
		return binding_irnode.is_Bad(ptr) != 0;
170
	}
171
172
	'''

173
174
175
class Borrow(Binop):
	flags = []

176
177
class Bound(Op):
	ins    = [ "mem", "index", "lower", "upper" ]
178
179
180
181
182
183
	outs  = [
		("M",         "memory result",                         "pn_Generic_M"),
		("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"),
		("X_except",  "control flow when exception occured",   "pn_Generic_X_except"),
		("res",       "the checked index",                     "pn_Generic_other"),
	]
184
185
186
187
 	flags  = [ "fragile", "highlevel" ]
	pinned = "exception"
	pinned_init = "op_pin_state_pinned"
	attr_struct = "bound_attr"
188
	attrs_name  = "bound"
189
190
191
192

class Builtin(Op):
	ins      = [ "mem" ]
	arity    = "variable"
193
194
195
196
	outs     = [
		("M",        "memory result", "pn_Generic_M"),
		("1_result", "first result",  "pn_Generic_other"),
	]
197
	flags    = [ "uses_memory" ]
198
	attrs    = [
199
200
201
202
		dict(
			type = "ir_builtin_kind",
			name = "kind"
		),
203
		dict(
204
205
206
			type = "ir_type*",
			name = "type"
		)
207
208
209
210
	]
	pinned      = "memory"
	pinned_init = "op_pin_state_pinned"
	attr_struct = "builtin_attr"
211
	init   = '''
212
213
214
	assert((get_unknown_type() == type) || is_Method_type(type));
	'''

215
216
217
class Call(Op):
	ins      = [ "mem", "ptr" ]
	arity    = "variable"
218
219
220
221
222
223
224
	outs     = [
		("M",                "memory result",                         "pn_Generic_M"),
		("X_regular",        "control flow when no exception occurs", "pn_Generic_X_regular"),
		("X_except",         "control flow when exception occured",   "pn_Generic_X_except"),
		("T_result",         "tuple containing all results",          "pn_Generic_other"),
		("P_value_res_base", "pointer to memory register containing copied results passed by value"),
	]
225
	flags    = [ "fragile", "uses_memory" ]
226
	attrs    = [
227
228
229
		dict(
			type = "ir_type*",
			name = "type"
230
231
232
233
234
235
		),
		dict(
			type = "unsigned",
			name = "tail_call",
			# the tail call attribute can only be set by analysis
			init = "0"
236
		)
237
238
239
240
	]
	attr_struct = "call_attr"
	pinned      = "memory"
	pinned_init = "op_pin_state_pinned"
241
242
	init = '''
	assert((get_unknown_type() == type) || is_Method_type(type));
243
	'''
244

245
246
247
class Carry(Binop):
	flags = [ "commutative" ]

Michael Beck's avatar
Michael Beck committed
248
class Cast(Unop):
249
250
	mode     = "get_irn_mode(irn_op)"
	flags    = [ "highlevel" ]
251
252
253
254
255
	attrs    = [
		dict(
			type = "ir_type*",
			name = "type"
		)
256
257
	]
	attr_struct = "cast_attr"
258
	init     = "assert(is_atomic_type(type));"
259
260

class Cmp(Binop):
261
	outs  = [
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
		("False", "always false",                            "0"),
		("Eq",    "equal",                                   "1"),
		("Lt",    "less",                                    "2"),
		("Le",    "less or equal",                           "pn_Cmp_Eq|pn_Cmp_Lt"),
		("Gt",    "greater",                                 "4"),
		("Ge",    "greater or equal",                        "pn_Cmp_Eq|pn_Cmp_Gt"),
		("Lg",    "less or greater ('not equal' for integer numbers)", "pn_Cmp_Lt|pn_Cmp_Gt"),
		("Leg",   "less, equal or greater ('not unordered')", "pn_Cmp_Lt|pn_Cmp_Eq|pn_Cmp_Gt"),
		("Uo",    "unordered",                               "8"),
		("Ue",    "unordered or equal",                      "pn_Cmp_Uo|pn_Cmp_Eq"),
		("Ul",    "unordered or less",                       "pn_Cmp_Uo|pn_Cmp_Lt"),
		("Ule",   "unordered, less or equal",                "pn_Cmp_Uo|pn_Cmp_Lt|pn_Cmp_Eq"),
		("Ug",    "unordered or greater",                    "pn_Cmp_Uo|pn_Cmp_Gt"),
		("Uge",   "onordered, greater or equal",             "pn_Cmp_Uo|pn_Cmp_Gt|pn_Cmp_Eq"),
		("Ne",    "unordered, less or greater ('not equal' for floatingpoint numbers)", "pn_Cmp_Uo|pn_Cmp_Lt|pn_Cmp_Gt"),
		("True",  "always true",                             "15"),
278
	]
279
280
281
282
	flags = []

class Cond(Op):
	ins      = [ "selector" ]
283
284
285
286
	outs     = [
		("false", "control flow if operand is \"false\""),
		("true",  "control flow if operand is \"true\""),
	]
287
288
	flags    = [ "cfopcode", "forking" ]
	pinned   = "yes"
289
290
291
292
293
294
295
296
297
298
299
	attrs    = [
		dict(
			name = "default_proj",
			type = "long",
			init = "0"
		),
		dict(
			name = "jmp_pred",
			type = "cond_jmp_predicate",
			init = "COND_JMP_PRED_NONE"
		)
300
	]
301
	attr_struct = "cond_attr"
302

303
304
305
306
307
class Confirm(Op):
	ins      = [ "value", "bound" ]
	mode     = "get_irn_mode(irn_value)"
	flags    = [ "highlevel" ]
	pinned   = "yes"
308
309
310
311
312
	attrs    = [
		dict(
			name = "cmp",
			type = "pn_Cmp"
		),
313
314
	]
	attr_struct = "confirm_attr"
315
	attrs_name  = "confirm"
316
317
318
319
320
321
322

class Const(Op):
	mode       = ""
	flags      = [ "constlike", "start_block" ]
	knownBlock = True
	pinned     = "no"
	attrs_name = "con"
323
324
	attrs      = [
		dict(
Matthias Braun's avatar
Matthias Braun committed
325
			type = "ir_tarval*",
326
327
			name = "tarval",
		)
328
329
	]
	attr_struct = "const_attr"
330

331
332
class Conv(Unop):
	flags = []
333
334
335
336
337
338
339
340
341
342
	attrs = [
		dict(
			name = "strict",
			type = "int",
			init = "0",
			special = dict(
				prefix = "strict",
				init = "1"
			)
		)
343
344
	]
	attr_struct = "conv_attr"
345
	attrs_name  = "conv"
346
347
348

class CopyB(Op):
	ins   = [ "mem", "dst", "src" ]
349
350
351
352
353
	outs  = [
		("M",         "memory result",                         "pn_Generic_M"),
		("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"),
		("X_except",  "control flow when exception occured",   "pn_Generic_X_except"),
	]
354
	flags = [ "fragile", "highlevel", "uses_memory" ]
355
356
	attrs = [
		dict(
357
358
			name = "type",
			type = "ir_type*"
359
		)
360
361
	]
	attr_struct = "copyb_attr"
362
	attrs_name  = "copyb"
363
364
	pinned      = "memory"
	pinned_init = "op_pin_state_pinned"
365

366
367
class Div(Op):
	ins   = [ "mem", "left", "right" ]
368
369
370
371
372
373
	outs  = [
		("M",         "memory result",                         "pn_Generic_M"),
		("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"),
		("X_except",  "control flow when exception occured",   "pn_Generic_X_except"),
		("res",       "result of computation",                 "pn_Generic_other"),
	]
374
375
	flags = [ "fragile", "uses_memory" ]
	attrs_name = "divmod"
376
377
378
379
380
	attrs = [
		dict(
			type = "ir_mode*",
			name = "resmode"
		),
Moritz Kroll's avatar
Moritz Kroll committed
381
382
383
384
385
386
387
388
		dict(
			name = "no_remainder",
			type = "int",
			init = "0",
			special = dict(
				suffix = "RL",
				init = "1"
			)
389
		)
390
391
392
393
394
	]
	attr_struct = "divmod_attr"
	pinned      = "exception"
	op_index    = 1
	arity_override = "oparity_binary"
395

396
397
class DivMod(Op):
	ins   = [ "mem", "left", "right" ]
398
399
400
401
402
403
404
	outs  = [
		("M",         "memory result",                         "pn_Generic_M"),
		("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"),
		("X_except",  "control flow when exception occured",   "pn_Generic_X_except"),
		("res_div",   "result of computation a/b",             "pn_Generic_other"),
		("res_mod",   "result of computation a%b"),
	]
405
406
	flags = [ "fragile", "uses_memory" ]
	attrs_name = "divmod"
407
408
409
410
411
	attrs = [
		dict(
			type = "ir_mode*",
			name = "resmode"
		),
412
413
414
415
416
417
418
419
	]
	attr_struct = "divmod_attr"
	pinned      = "exception"
	op_index    = 1
	arity_override = "oparity_binary"

class Dummy(Op):
	ins   = []
420
	flags = [ "cfopcode", "start_block", "constlike", "dump_noblock" ]
421
422
423
424
425
426
427
428
429
430
431
432
433
	knownBlock = True
	pinned     = "yes"
	block      = "get_irg_start_block(irg)"

class End(Op):
	mode       = "mode_X"
	pinned     = "yes"
	arity      = "dynamic"
	flags      = [ "cfopcode" ]
	singleton  = True

class Eor(Binop):
	flags    = [ "commutative" ]
434

435
436
437
438
439
class Free(Op):
	ins    = [ "mem", "ptr", "size" ]
	mode   = "mode_M"
	flags  = [ "uses_memory" ]
	pinned = "yes"
440
	attrs  = [
441
		dict(
442
443
			name = "type",
			type = "ir_type*"
444
445
		),
		dict(
446
447
			name = "where",
			type = "ir_where_alloc"
448
		)
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
	]
	attr_struct = "free_attr"

class Id(Op):
	ins    = [ "pred" ]
	pinned = "no"
	flags  = []

class IJmp(Op):
	mode     = "mode_X"
	pinned   = "yes"
	ins      = [ "target" ]
	flags    = [ "cfopcode", "forking", "keep" ]

class InstOf(Op):
	ins   = [ "store", "obj" ]
465
466
467
468
469
470
	outs  = [
		("M",         "memory result",                         "pn_Generic_M"),
		("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"),
		("X_except",  "control flow when exception occured",   "pn_Generic_X_except"),
		("res",       "checked object pointer",                "pn_Generic_other"),
	]
471
	flags = [ "highlevel" ]
472
473
474
475
476
	attrs = [
		dict(
			name = "type",
			type = "ir_type*"
		)
477
478
479
480
481
482
483
484
485
486
487
488
489
	]
	attr_struct = "io_attr"
	pinned      = "memory"
	pinned_init = "op_pin_state_floats"

class Jmp(Op):
	mode     = "mode_X"
	pinned   = "yes"
	ins      = []
	flags    = [ "cfopcode" ]

class Load(Op):
	ins      = [ "mem", "ptr" ]
490
491
492
493
494
495
	outs  = [
		("M",         "memory result",                         "pn_Generic_M"),
		("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"),
		("X_except",  "control flow when exception occured",   "pn_Generic_X_except"),
		("res",       "result of load operation",              "pn_Generic_other"),
	]
496
497
498
	flags    = [ "fragile", "uses_memory" ]
	pinned   = "exception"
	pinned_init = "flags & cons_floats ? op_pin_state_floats : op_pin_state_pinned"
499
500
501
502
503
504
	attrs    = [
		dict(
			type = "ir_mode*",
			name = "mode",
			java_name = "load_mode"
		),
505
506
	]
	attr_struct = "load_attr"
507
508
	constructor_args = [
		dict(
Moritz Kroll's avatar
Moritz Kroll committed
509
			type = "ir_cons_flags",
510
511
			name = "flags",
		),
512
513
514
515
516
517
518
	]

class Minus(Unop):
	flags = []

class Mod(Op):
	ins   = [ "mem", "left", "right" ]
519
520
521
522
523
524
	outs  = [
		("M",         "memory result",                         "pn_Generic_M"),
		("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"),
		("X_except",  "control flow when exception occured",   "pn_Generic_X_except"),
		("res",       "result of computation",                 "pn_Generic_other"),
	]
525
526
	flags = [ "fragile", "uses_memory" ]
	attrs_name = "divmod"
527
	attrs = [
528
		dict(
529
530
			type = "ir_mode*",
			name = "resmode"
531
		),
532
533
534
535
536
	]
	attr_struct = "divmod_attr"
	pinned      = "exception"
	op_index    = 1
	arity_override = "oparity_binary"
Matthias Braun's avatar
Matthias Braun committed
537

538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
class Mul(Binop):
	flags = [ "commutative" ]

class Mulh(Binop):
	flags = [ "commutative" ]

class Mux(Op):
	ins    = [ "sel", "false", "true" ]
	flags  = []
	pinned = "no"

class NoMem(Op):
	mode       = "mode_M"
	flags      = [ "dump_noblock", "dump_noinput" ]
	pinned     = "yes"
	knownBlock = True
	singleton  = True

class Not(Unop):
	flags = []

class Or(Binop):
	flags = [ "commutative" ]

class Phi(Op):
563
564
565
566
	pinned        = "yes"
	arity         = "variable"
	flags         = []
	attr_struct   = "phi_attr"
567
	java_noconstr = True
Matthias Braun's avatar
Matthias Braun committed
568
569
570
571
572
573
	init = '''
	/* Memory Phis in endless loops must be kept alive.
	   As we can't distinguish these easily we keep all of them alive. */
   	if (is_Phi(res) && mode == mode_M)
		add_End_keepalive(get_irg_end(irg), res);
	'''
574
575
576
577
578
579
580
581

class Pin(Op):
	ins      = [ "op" ]
	mode     = "get_irn_mode(irn_op)"
	flags    = [ "highlevel" ]
	pinned   = "yes"

class Proj(Op):
582
583
584
585
586
587
588
589
	ins        = [ "pred" ]
	flags      = []
	pinned     = "no"
	knownBlock = True
	knownGraph = True
	block      = "get_nodes_block(irn_pred)"
	graph      = "get_irn_irg(irn_pred)"
	attrs      = [
590
591
		dict(
			type = "long",
592
			name = "proj",
593
594
			initname = "",
			noprop = False,
595
		)
596
597
598
599
600
	]
	attr_struct = "long"

class Quot(Op):
	ins   = [ "mem", "left", "right" ]
601
602
603
604
605
606
	outs  = [
		("M",         "memory result",                         "pn_Generic_M"),
		("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"),
		("X_except",  "control flow when exception occured",   "pn_Generic_X_except"),
		("res",       "result of computation",                 "pn_Generic_other"),
	]
607
608
	flags = [ "fragile", "uses_memory" ]
	attrs_name = "divmod"
609
	attrs = [
610
		dict(
611
612
613
			type = "ir_mode*",
			name = "resmode"
		),
614
615
616
617
618
619
620
621
	]
	attr_struct = "divmod_attr"
	pinned      = "exception"
	op_index    = 1
	arity_override = "oparity_binary"

class Raise(Op):
	ins    = [ "mem", "exo_ptr" ]
622
623
624
625
	outs  = [
		("M", "memory result",                     "pn_Generic_M"),
		("X", "control flow to exception handler", "pn_Generic_X_regular"),
	]
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
	flags  = [ "highlevel", "cfopcode" ]
	pinned = "yes"

class Return(Op):
	ins      = [ "mem" ]
	arity    = "variable"
	mode     = "mode_X"
	flags    = [ "cfopcode" ]
	pinned   = "yes"

class Rotl(Binop):
	flags    = []

class Sel(Op):
	ins    = [ "mem", "ptr" ]
	arity  = "variable"
	flags  = []
	mode   = "is_Method_type(get_entity_type(entity)) ? mode_P_code : mode_P_data"
	pinned = "no"
645
	attrs  = [
646
		dict(
647
648
649
			type = "ir_entity*",
			name = "entity"
		)
650
651
652
653
654
655
656
657
658
659
660
661
662
	]
	attr_struct = "sel_attr"

class Shl(Binop):
	flags = []

class Shr(Binop):
	flags = []

class Shrs(Binop):
	flags = []

class Start(Op):
663
664
665
666
667
668
669
	outs       = [
		("X_initial_exec", "control flow"),
		("M",              "initial memory"),
		("P_frame_base",   "frame base pointer"),
		("P_tls",          "pointer to thread local storage segment"),
		("T_args",         "function arguments")
	]
670
671
672
673
674
675
676
	mode       = "mode_T"
	pinned     = "yes"
	flags      = [ "cfopcode" ]
	singleton  = True

class Store(Op):
	ins      = [ "mem", "ptr", "value" ]
677
678
679
680
681
	outs  = [
		("M",         "memory result",                         "pn_Generic_M"),
		("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"),
		("X_except",  "control flow when exception occured",   "pn_Generic_X_except"),
	]
682
683
684
685
	flags    = [ "fragile", "uses_memory" ]
	pinned   = "exception"
	attr_struct = "store_attr"
	pinned_init = "flags & cons_floats ? op_pin_state_floats : op_pin_state_pinned"
686
	constructor_args = [
687
		dict(
688
689
			type = "ir_cons_flags",
			name = "flags",
690
		),
691
692
693
694
695
696
697
698
699
700
	]

class Sub(Binop):
	flags = []

class SymConst(Op):
	mode       = "mode_P"
	flags      = [ "constlike", "start_block" ]
	knownBlock = True
	pinned     = "no"
701
	attrs      = [
702
		dict(
703
			type = "ir_entity*",
704
705
			name = "entity",
			noprop = True
706
		)
707
708
709
710
711
712
713
714
715
	]
	attr_struct = "symconst_attr"
	java_noconstr = True

class Sync(Op):
	mode     = "mode_M"
	flags    = []
	pinned   = "no"
	optimize = False
716
	arity    = "dynamic"
717

718
719
720
721
722
class Tuple(Op):
	arity  = "variable"
	mode   = "mode_T"
	pinned = "no"
	flags  = [ "labeled" ]
723
	java_noconstr = True
724
725
726
727
728

class Unknown(Op):
	knownBlock = True
	pinned     = "yes"
	block      = "get_irg_start_block(irg)"
729
	flags      = [ "cfopcode", "start_block", "constlike", "dump_noblock" ]
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745

# Prepare node list

def getOpList(namespace):
	nodes = []
	for t in namespace.values():
		if type(t) != type:
			continue

		if issubclass(t, Op):
			setnodedefaults(t)
			nodes.append(t)
	return nodes

nodes = getOpList(globals())
nodes = sorted(nodes, lambda x,y: cmp(x.name, y.name))