in[2] = irn_right;
res = new_ir_node(dbgi, irg, block, op_Div, mode_T, 3, in);
- res->attr.divmod.resmode = resmode;
- res->attr.divmod.no_remainder = 1;
- res->attr.divmod.exc.pin_state = pin_state;
+ res->attr.div.resmode = resmode;
+ res->attr.div.no_remainder = 1;
+ res->attr.div.exc.pin_state = pin_state;
res = optimize_node(res);
irn_verify_irg(res, irg);
return res;
/** Compares the attributes of two Div nodes. */
static int node_cmp_attr_Div(ir_node *a, ir_node *b)
{
- const divmod_attr *ma = &a->attr.divmod;
- const divmod_attr *mb = &b->attr.divmod;
+ const div_attr *ma = &a->attr.div;
+ const div_attr *mb = &b->attr.div;
return ma->exc.pin_state != mb->exc.pin_state ||
ma->resmode != mb->resmode ||
ma->no_remainder != mb->no_remainder;
} /* node_cmp_attr_Div */
-/** Compares the attributes of two Div or Mod nodes. */
-static int node_cmp_attr_Div_Mod(ir_node *a, ir_node *b)
-{
- const divmod_attr *ma = &a->attr.divmod;
- const divmod_attr *mb = &b->attr.divmod;
- return ma->exc.pin_state != mb->exc.pin_state ||
- ma->resmode != mb->resmode;
-} /* node_cmp_attr_Div_Mod */
-
/** Compares the attributes of two Mod nodes. */
static int node_cmp_attr_Mod(ir_node *a, ir_node *b)
{
- return node_cmp_attr_Div_Mod(a, b);
+ const mod_attr *ma = &a->attr.mod;
+ const mod_attr *mb = &b->attr.mod;
+ return ma->exc.pin_state != mb->exc.pin_state ||
+ ma->resmode != mb->resmode;
} /* node_cmp_attr_Mod */
/** Compares the attributes of two Confirm nodes. */
char strict; /**< If set, this is a strict Conv that cannot be removed. */
} conv_attr;
-/** Div/Mod attribute. */
-typedef struct divmod_attr {
+/** Div attribute. */
+typedef struct div_attr {
except_attr exc; /**< The exception attribute. MUST be the first one. */
ir_mode *resmode; /**< Result mode for the division. */
char no_remainder; /**< Set, if known that a division can be done without a remainder. */
-} divmod_attr;
+} div_attr;
+
+/** Mod attribute. */
+typedef struct mod_attr {
+ except_attr exc; /**< The exception attribute. MUST be the first one. */
+ ir_mode *resmode; /**< Result mode for the division. */
+} mod_attr;
/** Inline Assembler support attribute. */
typedef struct asm_attr {
copyb_attr copyb; /**< For CopyB operation */
bound_attr bound; /**< For Bound operation */
conv_attr conv; /**< For Conv operation */
- divmod_attr divmod; /**< For Div/Mod operation */
+ div_attr div; /**< For Div operation */
+ mod_attr mod; /**< For Mod operation */
asm_attr assem; /**< For ASM operation. */
} ir_attr;
("res", "result of computation", "pn_Generic_other"),
]
flags = [ "fragile", "uses_memory" ]
- attrs_name = "divmod"
+ attrs_name = "div"
attrs = [
dict(
type = "ir_mode*",
init = "0",
)
]
- attr_struct = "divmod_attr"
+ attr_struct = "div_attr"
pinned = "exception"
op_index = 1
arity_override = "oparity_binary"
("res", "result of computation", "pn_Generic_other"),
]
flags = [ "fragile", "uses_memory" ]
- attrs_name = "divmod"
+ attrs_name = "mod"
attrs = [
dict(
type = "ir_mode*",
comment = "mode of the result",
),
]
- attr_struct = "divmod_attr"
+ attr_struct = "mod_attr"
pinned = "exception"
op_index = 1
arity_override = "oparity_binary"