* @version $Id$
*
* This file implements the creation of the achitecture specific firm opcodes
- * and the coresponding node constructors for the ia32 assembler irg.
+ * and the corresponding node constructors for the ia32 assembler irg.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
}
if (reqs[i]->type & arch_register_req_type_should_be_same) {
- ir_fprintf(F, " same as %+F", get_irn_n(n, reqs[i]->other_same));
+ ir_fprintf(F, " same as %+F", get_irn_n(n, reqs[i]->other_same[0]));
+ if (reqs[i]->other_same[1] != -1)
+ ir_fprintf(F, " or %+F", get_irn_n(n, reqs[i]->other_same[1]));
}
if (reqs[i]->type & arch_register_req_type_should_be_different) {
fprintf(F, "AM scale = %d\n", get_ia32_am_scale(n));
/* dump pn code */
- if(is_ia32_SwitchJmp(n)) {
+ if(is_ia32_SwitchJmp(n) || is_ia32_CopyB(n) || is_ia32_CopyB_i(n)) {
fprintf(F, "pn_code = %ld\n", get_ia32_pncode(n));
} else {
- if(get_ia32_pncode(n) & ia32_pn_Cmp_Unsigned) {
- long pnc = get_ia32_pncode(n);
- fprintf(F, "pn_code = %ld (%s, unsigned)\n",
- pnc, get_pnc_string(pnc & ~ia32_pn_Cmp_Unsigned));
- } else {
- fprintf(F, "pn_code = %ld (%s)\n", get_ia32_pncode(n),
- get_pnc_string(get_ia32_pncode(n)));
- }
+ fprintf(F, "pn_code = %ld (%s)\n", get_ia32_pncode(n),
+ get_pnc_string(get_ia32_pncode(n)));
}
/* dump n_res */
attr->data.am_scale = scale;
}
+void ia32_copy_am_attrs(ir_node *to, const ir_node *from)
+{
+ set_ia32_ls_mode(to, get_ia32_ls_mode(from));
+ set_ia32_am_scale(to, get_ia32_am_scale(from));
+ set_ia32_am_sc(to, get_ia32_am_sc(from));
+ if(is_ia32_am_sc_sign(from))
+ set_ia32_am_sc_sign(to);
+ add_ia32_am_offs_int(to, get_ia32_am_offs_int(from));
+ set_ia32_frame_ent(to, get_ia32_frame_ent(from));
+ if (is_ia32_use_frame(from))
+ set_ia32_use_frame(to);
+}
+
/**
* Sets the uses_frame flag.
*/
return ARR_LEN(attr->slots);
}
-/**
- * Returns the flavour of an ia32 node,
- */
-ia32_op_flavour_t get_ia32_flavour(const ir_node *node) {
- const ia32_attr_t *attr = get_ia32_attr_const(node);
- return attr->data.op_flav;
-}
-
-/**
- * Sets the flavour of an ia32 node to flavour_Div/Mod/DivMod/Mul/Mulh.
- */
-void set_ia32_flavour(ir_node *node, ia32_op_flavour_t op_flav) {
- ia32_attr_t *attr = get_ia32_attr(node);
- attr->data.op_flav = op_flav;
-}
-
/**
* Returns the projnum code.
*/
void ia32_swap_left_right(ir_node *node)
{
- ir_node *left = get_irn_n(node, 2);
- ir_node *right = get_irn_n(node, 3);
+ ia32_attr_t *attr = get_ia32_attr(node);
+ ir_node *left = get_irn_n(node, n_ia32_binary_left);
+ ir_node *right = get_irn_n(node, n_ia32_binary_right);
+
assert(is_ia32_commutative(node));
- set_irn_n(node, 2, right);
- set_irn_n(node, 3, left);
- set_ia32_pncode(node, get_inversed_pnc(get_ia32_pncode(node)));
+ attr->data.ins_permuted = !attr->data.ins_permuted;
+ set_irn_n(node, n_ia32_binary_left, right);
+ set_irn_n(node, n_ia32_binary_right, left);
}
/**
if(a->pn_code != b->pn_code)
return 1;
- if (a->data.tp != b->data.tp
- || a->data.op_flav != b->data.op_flav)
+ if (a->data.tp != b->data.tp)
return 1;
if (a->data.except_label != b->data.except_label)
return 1;
+ if (a->data.ins_permuted != b->data.ins_permuted
+ || a->data.cmp_unsigned != b->data.cmp_unsigned)
+ return 1;
+
return 0;
}