* Sets the supported addrmode of an ia32 node
*/
void set_ia32_am_support(ir_node *node, ia32_am_type_t am_tp) {
- ia32_attr_t *attr = get_ia32_attr(node);
- attr->data.am_support = am_tp;
+ ia32_attr_t *attr = get_ia32_attr(node);
+ attr->data.am_support = am_tp;
}
/**
* Sets the addrmode flavour of an ia32 node
*/
void set_ia32_am_flavour(ir_node *node, ia32_am_flavour_t am_flavour) {
- ia32_attr_t *attr = get_ia32_attr(node);
- attr->data.am_flavour = am_flavour;
+ ia32_attr_t *attr = get_ia32_attr(node);
+ attr->data.am_flavour = am_flavour;
}
/**
attr->res_mode = mode;
}
+/**
+ * Gets the source mode of conversion.
+ */
+ir_mode *get_ia32_src_mode(const ir_node *node) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ return attr->src_mode;
+}
+
+/**
+ * Sets the source mode of conversion.
+ */
+void set_ia32_src_mode(ir_node *node, ir_mode *mode) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ attr->src_mode = mode;
+}
+
+/**
+ * Gets the target mode of conversion.
+ */
+ir_mode *get_ia32_tgt_mode(const ir_node *node) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ return attr->tgt_mode;
+}
+
+/**
+ * Sets the target mode of conversion.
+ */
+void set_ia32_tgt_mode(ir_node *node, ir_mode *mode) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ attr->tgt_mode = mode;
+}
+
/**
* Gets the frame entity assigned to this node;
*/
ia32_attr_t *attr = get_ia32_attr(node);
if (num) {
- attr->slots = NEW_ARR_D(arch_register_t*, get_irg_obstack(get_irn_irg(node)), num);
+ attr->slots = (const arch_register_t **)NEW_ARR_D(arch_register_t*, get_irg_obstack(get_irn_irg(node)), num);
memset(attr->slots, 0, sizeof(attr->slots[0]) * num);
}
else {
/* default compare operation to compare immediate ops */
int ia32_compare_immop_attr(ia32_attr_t *a, ia32_attr_t *b) {
+ int equ = 0;
+
if (a->data.tp == b->data.tp) {
- return a->cnst == b->cnst;
+ equ = (a->cnst == b->cnst);
+ equ = equ ? (a->data.use_frame == b->data.use_frame) : 0;
+
+ if (equ && a->data.use_frame && b->data.use_frame)
+ equ = (a->frame_ent == b->frame_ent);
}
- return 1;
+ return !equ;
}
/* copies the ia32 attributes */
memcpy(attr_new, attr_old, sizeof(*attr_new));
/* copy the register slots */
- attr_new->slots = NEW_ARR_D(arch_register_t*, get_irg_obstack(get_irn_irg(new_node)), n_res);
+ attr_new->slots = (const arch_register_t **)NEW_ARR_D(arch_register_t*, get_irg_obstack(get_irn_irg(new_node)), n_res);
memcpy((void *)attr_new->slots, (void *)attr_old->slots, sizeof(attr_new->slots[0]) * n_res);
}