be: remove remnants of machine description
[libfirm] / ir / be / ia32 / ia32_new_nodes.c
index def6e5f..e056872 100644 (file)
@@ -21,7 +21,6 @@
  * @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 "raw_bitset.h"
 #include "xmalloc.h"
 
-#include "../bearch.h"
-#include "../beinfo.h"
+#include "bearch.h"
+#include "beinfo.h"
 
 #include "bearch_ia32_t.h"
 #include "ia32_common_transform.h"
 #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.
@@ -185,9 +183,7 @@ static void ia32_dump_node(FILE *F, ir_node *n, dump_reason_t reason)
                        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);
@@ -673,9 +669,12 @@ unsigned get_ia32_latency(const ir_node *node)
        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);
@@ -691,12 +690,6 @@ void set_ia32_condcode(ir_node *node, ia32_condition_code_t code)
        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.
  */
@@ -706,15 +699,6 @@ unsigned get_ia32_copyb_size(const ir_node *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.
  */
@@ -824,7 +808,6 @@ void ia32_swap_left_right(ir_node *node)
  */
 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);
@@ -832,10 +815,9 @@ static void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags,
        ia32_attr_t     *attr = get_ia32_attr(node);
        backend_info_t  *info;
 
-       arch_irn_set_flags(node, flags);
-       arch_set_in_register_reqs(node, in_reqs);
+       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
@@ -926,15 +908,22 @@ static void init_ia32_climbframe_attributes(ir_node *res, unsigned count)
        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)
@@ -997,24 +986,6 @@ static int ia32_compare_condcode_attr(const ir_node *a, const ir_node *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)
 {