-),
-
-Cmp = dict(
- is_a = "binop",
- outs = [ "False", "Eq", "Lt", "Le", "Gt", "Ge", "Lg", "Leg", "Uo", "Ue", "Ul", "Ule", "Ug", "Uge", "Ne", "True" ],
- flags = "none",
-),
-
-Cond = dict(
- ins = [ "selector" ],
- outs = [ "false", "true" ],
- flags = "cfopcode, forking",
- pinned = "yes",
+
+class Cmp(Binop):
+ """Returns the relation of 2 operands"""
+ outs = [
+ ("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"),
+ ]
+ flags = []
+
+class Cond(Op):
+ """Conditionally change control flow. There are two versions of this node:
+
+ Boolean Cond:
+ Input: A value of mode_b
+ Output: A tuple of two control flows. The first is taken if the input is
+ false, the second if it is true.
+
+ Switch Cond:
+ Input: A value of mode_Iu
+ Output: A tuple of n control flows. If the Cond's input is i, control flow
+ will proceed along output i. If the input is >= n control flow proceeds
+ along output def_proj.
+ """
+ ins = [
+ ("selector", "condition parameter"),
+ ]
+ outs = [
+ ("false", "control flow if operand is \"false\""),
+ ("true", "control flow if operand is \"true\""),
+ ]
+ flags = [ "cfopcode", "forking" ]
+ pinned = "yes"