- ],
- attr_struct = "divmod_attr",
- pinned = "exception",
- op_index = 1,
- d_post = '''
- #if PRECISE_EXC_CONTEXT
- firm_alloc_frag_arr(res, op_Mod, &res->attr.except.frag_arr);
- #endif
- '''
-),
-
-Mul = dict(
- is_a = "binop",
- flags = "commutative",
-),
-
-Mulh = dict(
- is_a = "binop",
- flags = "commutative",
-),
-
-Mux = dict(
- ins = [ "sel", "false", "true" ],
- flags = "none",
-),
-
-NoMem = dict(
- mode = "mode_M",
- flags = "dump_noblock, dump_noinput",
- knownBlock = True,
- singleton = True,
-),
-
-Not = dict(
- is_a = "unop",
- flags = "none",
-),
-
-Or = dict(
- is_a = "binop",
- flags = "commutative",
-),
-
-Phi = dict(
- pinned = "yes",
- arity = "variable",
- flags = "none",
- attr_struct = "phi_attr",
- custom_is = True,
- java_noconstr = True,
-),
-
-Pin = dict(
- ins = [ "op" ],
- mode = "get_irn_mode(irn_op)",
- flags = "highlevel",
-),
-
-Proj = dict(
- ins = [ "pred" ],
- flags = "none",
- attrs = [
+ ]
+ attr_struct = "mod_attr"
+ pinned = "exception"
+ throws_init = "false"
+ op_index = 1
+ arity_override = "oparity_binary"
+
+class Mul(Binop):
+ """returns the product of its operands"""
+ flags = [ "commutative" ]
+
+class Mulh(Binop):
+ """returns the upper word of the product of its operands (the part which
+ would not fit into the result mode of a normal Mul anymore)"""
+ flags = [ "commutative" ]
+
+class Mux(Op):
+ """returns the false or true operand depending on the value of the sel
+ operand"""
+ ins = [
+ ("sel", "value making the output selection"),
+ ("false", "selected if sel input is false"),
+ ("true", "selected if sel input is true"),
+ ]
+ flags = []
+ pinned = "no"
+
+class NoMem(Op):
+ """Placeholder node for cases where you don't need any memory input"""
+ mode = "mode_M"
+ flags = [ "dump_noblock", "dump_noinput" ]
+ pinned = "yes"
+ knownBlock = True
+ block = "get_irg_start_block(irg)"
+ singleton = True
+
+class Not(Unop):
+ """returns the logical complement of a value. Works for integer values too.
+ If the input is false/zero then true/one is returned, otherwise false/zero
+ is returned."""
+ flags = []
+
+class Or(Binop):
+ """returns the result of a bitwise or operation of its operands"""
+ flags = [ "commutative" ]
+
+class Phi(Op):
+ """Choose a value based on control flow. A phi node has 1 input for each
+ predecessor of its block. If a block is entered from its nth predecessor
+ all phi nodes produce their nth input as result."""
+ pinned = "yes"
+ arity = "variable"
+ flags = []
+ attr_struct = "phi_attr"
+ init = '''
+ res->attr.phi.u.backedge = new_backedge_arr(irg->obst, arity);'''
+ init_after_opt = '''
+ /* 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);'''
+ customSerializer = True
+
+class Pin(Op):
+ """Pin the value of the node node in the current block. No users of the Pin
+ node can float above the Block of the Pin. The node cannot float behind
+ this block. Often used to Pin the NoMem node."""
+ ins = [
+ ("op", "value which is pinned"),
+ ]
+ mode = "get_irn_mode(irn_op)"
+ flags = [ "highlevel" ]
+ pinned = "yes"
+
+class Proj(Op):
+ """returns an entry of a tuple value"""
+ ins = [
+ ("pred", "the tuple value from which a part is extracted"),
+ ]
+ flags = []
+ pinned = "no"
+ knownBlock = True
+ knownGraph = True
+ block = "get_nodes_block(irn_pred)"
+ graph = "get_irn_irg(irn_pred)"
+ attrs = [