X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fia32%2Fia32_map_regs.h;h=628c8d29ab153137ed71e79c39a870b49b3000d1;hb=e09c1c179570baa951f7eca3113a550504a4b66c;hp=d2873235f37bb12ebc18a2c8bea9049f3bd290ad;hpb=86997185c0e4d9a49b8f036a8a6fbb5e470ff2b2;p=libfirm diff --git a/ir/be/ia32/ia32_map_regs.h b/ir/be/ia32/ia32_map_regs.h index d2873235f..628c8d29a 100644 --- a/ir/be/ia32/ia32_map_regs.h +++ b/ir/be/ia32/ia32_map_regs.h @@ -1,25 +1,38 @@ -/** - * General reqister mapping stuff. - * @author Christian Wuerdig - * $Id$ +/* + * Copyright (C) 1995-2008 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. */ -#ifndef _IA32_MAP_REGS_H_ -#define _IA32_MAP_REGS_H_ +/** + * @file + * @brief Register param constraints and some other register handling tools. + * @author Christian Wuerdig + * @version $Id$ + */ +#ifndef FIRM_BE_IA32_IA32_MAP_REGS_H +#define FIRM_BE_IA32_IA32_MAP_REGS_H #include "irnode.h" +#include "irmode.h" #include "set.h" -#include "../bearch.h" -#include "ia32_nodes_attr.h" - -/** - * Convenience macro to check if register out<\code> - * and register in<\code> are equal. - */ -#define REGS_ARE_EQUAL(out, in) \ - ((arch_register_get_class(out) == arch_register_get_class(in)) && \ - (arch_register_get_index(out) == arch_register_get_index(in))) +#include "../bearch_t.h" +#include "bearch_ia32_t.h" +#include "gen_ia32_regalloc_if.h" /** * Set compare function @@ -47,39 +60,27 @@ void ia32_build_16bit_reg_map(pmap *reg_map); * name into a pmap. */ void ia32_build_8bit_reg_map(pmap *reg_map); +void ia32_build_8bit_reg_map_high(pmap *reg_map); /** * Returns the corresponding mapped name for a register. */ const char *ia32_get_mapped_reg_name(pmap *reg_map, const arch_register_t *reg); -/** - * Check all parameters and determine the maximum number of parameters - * to pass in gp regs resp. in fp regs. - * - * @param n The number of parameters - * @param modes The list of the parameter modes - * @param n_int Holds the number of int parameters to be passed in regs after the call - * @param n_float Holds the number of float parameters to be passed in regs after the call - * @return The number of the last parameter to be passed in register - */ -int ia32_get_n_regparam_class(int n, ir_mode **modes, int *n_int, int *n_float); - /** * Returns the register for parameter nr. - * - * @param n The number of parameters - * @param modes The list of the parameter modes - * @param nr The number of the parameter to return the requirements for - * @param cc The calling convention - * @return The register */ -const arch_register_t *ia32_get_RegParam_reg(int n, ir_mode **modes, long nr, unsigned cc); +const arch_register_t *ia32_get_RegParam_reg(unsigned cc, size_t nr, + const ir_mode *mode); -/** - * Translates the projnum into a "real" argument position for register - * requirements dependent on the predecessor. - */ -long ia32_translate_proj_pos(const ir_node *proj); +static INLINE int is_unknown_reg(const arch_register_t *reg) +{ + if(reg == &ia32_gp_regs[REG_GP_UKNWN] + || reg == &ia32_xmm_regs[REG_XMM_UKNWN] + || reg == &ia32_vfp_regs[REG_VFP_UKNWN]) + return 1; + + return 0; +} -#endif /* _IA32_MAP_REGS_H_ */ +#endif /* FIRM_BE_IA32_IA32_MAP_REGS_H */