fix bad input register requirements
[libfirm] / ir / be / ia32 / ia32_new_nodes.c
index ddfd4df..62ed8d4 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.
@@ -54,7 +53,8 @@
 #include "ia32_nodes_attr.h"
 #include "ia32_new_nodes.h"
 #include "gen_ia32_regalloc_if.h"
-#include "gen_ia32_machine.h"
+
+struct obstack opcodes_obst;
 
 /**
  * Dumper interface for dumping ia32 nodes in vcg.
@@ -63,7 +63,7 @@
  * @param reason   indicates which kind of information should be dumped
  * @return 0 on success or != 0 on failure
  */
-static void ia32_dump_node(FILE *F, ir_node *n, dump_reason_t reason)
+static void ia32_dump_node(FILE *F, const ir_node *n, dump_reason_t reason)
 {
        ir_mode *mode = NULL;
 
@@ -186,7 +186,7 @@ static void ia32_dump_node(FILE *F, ir_node *n, dump_reason_t reason)
 
                        /* dump pn code */
                        if (is_ia32_CMovcc(n) || is_ia32_Setcc(n) || is_ia32_Jcc(n)) {
-                               ia32_attr_t *attr = get_ia32_attr(n);
+                               const ia32_attr_t *attr = get_ia32_attr_const(n);
                                fprintf(F, "condition_code = 0x%X\n", (unsigned)get_ia32_condcode(n));
                                fprintf(F, "ins_permuted = %u\n", (unsigned)attr->data.ins_permuted);
                        }
@@ -701,15 +701,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.
  */
@@ -819,7 +810,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);
@@ -830,7 +820,6 @@ static void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags,
        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
@@ -1064,7 +1053,7 @@ static unsigned ia32_hash_Immediate(const ir_node *irn)
 {
        const ia32_immediate_attr_t *a = get_ia32_immediate_attr_const(irn);
 
-       return HASH_PTR(a->symconst) + (a->sc_sign << 16) + a->offset;
+       return hash_ptr(a->symconst) + (a->sc_sign << 16) + a->offset;
 }
 
 /** Compare node attributes for Immediates. */
@@ -1127,5 +1116,12 @@ static void ia32_copy_attr(ir_graph *irg, const ir_node *old_node,
        new_info->flags = old_info->flags;
 }
 
+static void ia32_init_op(ir_op *op, unsigned latency)
+{
+       ia32_op_attr_t *attr = OALLOCZ(&opcodes_obst, ia32_op_attr_t);
+       attr->latency = latency;
+       set_op_attr(op, attr);
+}
+
 /* Include the generated constructor functions */
 #include "gen_ia32_new_nodes.c.inl"