be_abi_put_ignore_regs returns now number of ignore registers as unsigned
[libfirm] / ir / be / ia32 / ia32_map_regs.c
index 2224ae4..765ce9f 100644 (file)
@@ -1,8 +1,27 @@
+/*
+ * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
 /**
- * Register mapping for firm nodes. Stolen from bearch_firm :)
- * Calculate requirements for register parameter.
- * @author Christian Wuerdig
- * $Id$
+ * @file
+ * @brief       Register param constraints and some other register handling tools.
+ * @author      Christian Wuerdig
+ * @version     $Id$
  */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -15,6 +34,7 @@
 #include "ia32_map_regs.h"
 #include "ia32_new_nodes.h"
 #include "gen_ia32_regalloc_if.h"
+#include "../benodesets.h"
 
 static int maxnum_gpreg_args = 3;   /* maximum number of int arguments passed in registers; default 3 */
 static int maxnum_fpreg_args = 5;   /* maximum number of float arguments passed in registers; default 5 */
@@ -84,7 +104,7 @@ static struct ia32_irn_reg_assoc *get_irn_reg_assoc(const ir_node *irn, set *reg
 
        templ.irn = irn;
        templ.reg = NULL;
-       hash = HASH_PTR(irn);
+       hash = nodeset_hash(irn);
 
        return set_insert(reg_set, &templ, sizeof(templ), hash);
 }
@@ -225,42 +245,3 @@ const arch_register_t *ia32_get_RegParam_reg(int n, ir_mode **modes, long nr, un
 
        return param_reg;
 }
-
-
-
-/**
- * Translates the projnum into a "real" argument position for register
- * requirements dependend on the predecessor.
- */
-long ia32_translate_proj_pos(const ir_node *proj) {
-       ir_node *pred = get_Proj_pred(proj);
-       long nr       = get_Proj_proj(proj);
-
-       if (is_ia32_Ld(pred)) {
-               if (nr == pn_Load_res || nr == 0)
-                       return 0;
-               assert(0 && "unsupported Proj(Load) number");
-       }
-       else if (is_ia32_Cdq(pred) || is_ia32_MulS(pred) || is_ia32_Mulh(pred)) {
-               if (nr == pn_EAX)
-                       return 0;
-               if (nr == pn_EDX)
-                       return 1;
-       }
-       else if (is_ia32_DivMod(pred)) {
-               if (nr == pn_DivMod_res_div)
-                       return 0;
-               if (nr == pn_DivMod_res_mod)
-                       return 1;
-               assert(0 && "unsupported DivMod");
-       }
-       else if (get_irn_opcode(pred) == iro_Start) {
-               return nr;
-       }
-       else if (is_ia32_CopyB(pred) || is_ia32_CopyB_i(pred)) {
-               return nr;
-       }
-
-//     assert(0 && "unsupported Proj(X)");
-       return 0;
-}