- handle parsing of assembler constraints in backends. Provide functions for
[libfirm] / ir / be / ia32 / ia32_map_regs.c
index e5a6f0e..0bd6c39 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -34,9 +34,9 @@
 
 #include "ia32_map_regs.h"
 #include "ia32_new_nodes.h"
+#include "ia32_architecture.h"
 #include "gen_ia32_regalloc_if.h"
 #include "bearch_ia32_t.h"
-#include "../benodesets.h"
 
 #define MAXNUM_GPREG_ARGS     3
 #define MAXNUM_SSE_ARGS       5
@@ -96,6 +96,7 @@ struct ia32_irn_reg_assoc {
 int ia32_cmp_irn_reg_assoc(const void *a, const void *b, size_t len) {
        const struct ia32_irn_reg_assoc *x = a;
        const struct ia32_irn_reg_assoc *y = b;
+       (void) len;
 
        return x->irn != y->irn;
 }
@@ -106,7 +107,7 @@ static struct ia32_irn_reg_assoc *get_irn_reg_assoc(const ir_node *irn, set *reg
 
        templ.irn = irn;
        templ.reg = NULL;
-       hash = nodeset_hash(irn);
+       hash      = hash_irn(irn);
 
        return set_insert(reg_set, &templ, sizeof(templ), hash);
 }
@@ -161,14 +162,14 @@ const char *ia32_get_mapped_reg_name(pmap *reg_map, const arch_register_t *reg)
 /**
  * Returns the register for parameter nr.
  */
-const arch_register_t *ia32_get_RegParam_reg(ia32_code_gen_t *cg, unsigned cc,
-                                             size_t nr, ir_mode *mode)
+const arch_register_t *ia32_get_RegParam_reg(unsigned cc, size_t nr,
+                                             const ir_mode *mode)
 {
        if(! (cc & cc_reg_param))
                return NULL;
 
        if(mode_is_float(mode)) {
-               if(!USE_SSE2(cg))
+               if(!ia32_cg_config.use_sse2)
                        return NULL;
                if(nr >= MAXNUM_SSE_ARGS)
                        return NULL;
@@ -178,6 +179,9 @@ const arch_register_t *ia32_get_RegParam_reg(ia32_code_gen_t *cg, unsigned cc,
                }
                return fpreg_sse_param_reg_std[nr];
        } else if(mode_is_int(mode) || mode_is_reference(mode)) {
+               if(get_mode_size_bits(mode) > 32)
+                       return NULL;
+
                if(nr >= MAXNUM_GPREG_ARGS)
                        return NULL;