2 * Register mapping for firm nodes. Stolen from bearch_firm :)
11 #include "mips_map_regs.h"
12 #include "mips_new_nodes.h"
14 /* Mapping to store registers in firm nodes */
16 struct mips_irn_reg_assoc {
18 const arch_register_t *reg;
21 int mips_cmp_irn_reg_assoc(const void *a, const void *b, size_t len) {
22 const struct mips_irn_reg_assoc *x = a;
23 const struct mips_irn_reg_assoc *y = b;
25 return x->irn != y->irn;
28 static struct mips_irn_reg_assoc *get_irn_reg_assoc(const ir_node *irn, set *reg_set) {
29 struct mips_irn_reg_assoc templ;
36 return set_insert(reg_set, &templ, sizeof(templ), hash);
39 void mips_set_firm_reg(ir_node *irn, const arch_register_t *reg, set *reg_set) {
40 struct mips_irn_reg_assoc *assoc = get_irn_reg_assoc(irn, reg_set);
44 const arch_register_t *mips_get_firm_reg(const ir_node *irn, set *reg_set) {
45 struct mips_irn_reg_assoc *assoc = get_irn_reg_assoc(irn, reg_set);
50 * Translates the projnum into a "real" argument position for register
51 * requirements dependend on the predecessor.
53 long mips_translate_proj_pos(const ir_node *proj) {
54 return get_Proj_proj(proj);