* @file
* @brief Handling of ia32 specific firm opcodes.
* @author Christian Wuerdig
- * @version $Id$
*
* This file implements the creation of the architecture specific firm opcodes
* and the corresponding node constructors for the ia32 assembler irg.
#include "ia32_nodes_attr.h"
#include "ia32_new_nodes.h"
#include "gen_ia32_regalloc_if.h"
-#include "gen_ia32_machine.h"
/**
* Dumper interface for dumping ia32 nodes in vcg.
fprintf(F, "AM scale = %u\n", get_ia32_am_scale(n));
/* dump pn code */
- if (is_ia32_SwitchJmp(n)) {
- fprintf(F, "default_pn = %ld\n", get_ia32_default_pn(n));
- } else if (is_ia32_CMovcc(n) || is_ia32_Setcc(n) || is_ia32_Jcc(n)) {
+ if (is_ia32_CMovcc(n) || is_ia32_Setcc(n) || is_ia32_Jcc(n)) {
ia32_attr_t *attr = get_ia32_attr(n);
fprintf(F, "condition_code = 0x%X\n", (unsigned)get_ia32_condcode(n));
fprintf(F, "ins_permuted = %u\n", (unsigned)attr->data.ins_permuted);
return op_attr->latency;
}
-/**
- * Returns the condition code of a node.
- */
+const ir_switch_table *get_ia32_switch_table(const ir_node *node)
+{
+ const ia32_switch_attr_t *attr = get_ia32_switch_attr_const(node);
+ return attr->table;
+}
+
ia32_condition_code_t get_ia32_condcode(const ir_node *node)
{
const ia32_condcode_attr_t *attr = get_ia32_condcode_attr_const(node);
attr->condition_code = code;
}
-long get_ia32_default_pn(const ir_node *node)
-{
- const ia32_switch_attr_t *attr = get_ia32_switch_attr_const(node);
- return attr->default_pn;
-}
-
/**
* Returns the condition code of a node.
*/
return attr->size;
}
-/**
- * Get the list of available execution units.
- */
-const be_execution_unit_t ***get_ia32_exec_units(const ir_node *node)
-{
- const ia32_attr_t *attr = get_ia32_attr_const(node);
- return attr->exec_units;
-}
-
/**
* Get the exception label attribute.
*/
*/
static void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags,
const arch_register_req_t **in_reqs,
- const be_execution_unit_t ***execution_units,
int n_res)
{
ir_graph *irg = get_irn_irg(node);
arch_set_irn_flags(node, flags);
arch_set_irn_register_reqs_in(node, in_reqs);
- attr->exec_units = execution_units;
#ifndef NDEBUG
attr->attr_type |= IA32_ATTR_ia32_attr_t;
#endif
attr->count = count;
}
-static void init_ia32_switch_attributes(ir_node *res, long default_pn)
+static void init_ia32_switch_attributes(ir_node *node,
+ const ir_switch_table *table)
{
- ia32_switch_attr_t *attr = (ia32_switch_attr_t*) get_irn_generic_attr(res);
+ unsigned n_outs = arch_get_irn_n_outs(node);
+ unsigned o;
+
+ ia32_switch_attr_t *attr = (ia32_switch_attr_t*) get_irn_generic_attr(node);
#ifndef NDEBUG
attr->attr.attr_type |= IA32_ATTR_ia32_switch_attr_t;
#endif
- attr->default_pn = default_pn;
-}
+ attr->table = table;
+ for (o = 0; o < n_outs; ++o) {
+ arch_set_irn_register_req_out(node, o, arch_no_register_req);
+ }
+}
/* default compare operation to compare attributes */
static int ia32_compare_attr(const ia32_attr_t *a, const ia32_attr_t *b)
return 0;
}
-/** Compare node attributes for nodes with condition code. */
-static int ia32_compare_switch_attr(const ir_node *a, const ir_node *b)
-{
- const ia32_switch_attr_t *attr_a;
- const ia32_switch_attr_t *attr_b;
-
- if (ia32_compare_nodes_attr(a, b))
- return 1;
-
- attr_a = get_ia32_switch_attr_const(a);
- attr_b = get_ia32_switch_attr_const(b);
-
- if (attr_a->default_pn != attr_b->default_pn)
- return 1;
-
- return 0;
-}
-
/** Compare node attributes for call nodes. */
static int ia32_compare_call_attr(const ir_node *a, const ir_node *b)
{