X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fia32%2Fia32_map_regs.h;h=ffdfc528f5e457eb10832cfb8a8e66e3fab715e8;hb=fa4ec191e159484f0fcbea2ef044deaa2ab2d293;hp=e32de6cee9b8ce7b7b86d60ad6f5930039e413b6;hpb=3b1a4ee674e9522acfd95b6d49c91f86f9b97d32;p=libfirm diff --git a/ir/be/ia32/ia32_map_regs.h b/ir/be/ia32/ia32_map_regs.h index e32de6cee..ffdfc528f 100644 --- a/ir/be/ia32/ia32_map_regs.h +++ b/ir/be/ia32/ia32_map_regs.h @@ -7,18 +7,73 @@ #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))) + +/** + * Set compare function + */ int ia32_cmp_irn_reg_assoc(const void *a, const void *b, size_t len); + +/** + * Assigns a register to a firm node. + */ void ia32_set_firm_reg(ir_node *irn, const arch_register_t *reg, set *reg_set); + +/** + * Gets the register assigned to a firm node. + */ const arch_register_t *ia32_get_firm_reg(const ir_node *irn, set *reg_set); -int ia32_cmp_reg_projnum_assoc(const void *a, const void *b, size_t len); -void ia32_set_reg_projnum(const arch_register_t *reg, long proj_num, set *reg_set); -long ia32_get_reg_projnum(const arch_register_t *reg, set *reg_set); +/** + * Enters for each general purpose register the corresponding 16bit + * name into a pmap. + */ +void ia32_build_16bit_reg_map(pmap *reg_map); + +/** + * Enters for each general purpose register the corresponding 8bit + * name into a pmap. + */ +void ia32_build_8bit_reg_map(pmap *reg_map); + +/** + * Returns the corresponding mapped name for a register. + */ +char *ia32_get_mapped_reg_name(pmap *reg_map, const arch_register_t *reg); -int ia32_get_n_regparam_class(int n, ir_node **params, int *n_int, int *n_float); +/** + * 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); -const ia32_register_req_t *ia32_get_RegParam_req(int n, ir_node **params, long nr, unsigned cc); +/** + * 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); +/** + * Translates the projnum into a "real" argument position for register + * requirements dependent on the predecessor. + */ long ia32_translate_proj_pos(const ir_node *proj); #endif /* _IA32_MAP_REGS_H_ */