-
- assert(reg && "no out register found");
- return reg;
-}
-
-/**
- * Returns the number of the in register at position pos.
- */
-int get_mips_reg_nr(ir_node *irn, int pos, int in_out)
-{
- const arch_register_t *reg;
-
- if (in_out == 1) {
- reg = get_in_reg(irn, pos);
- }
- else {
- reg = get_out_reg(irn, pos);
- }
-
- return arch_register_get_index(reg);
-}
-
-/**
- * Returns the name of the in register at position pos.
- */
-const char *get_mips_reg_name(ir_node *irn, int pos, int in_out)
-{
- const arch_register_t *reg;
-
- if (in_out == 1) {
- reg = get_in_reg(irn, pos);
- }
- else {
- reg = get_out_reg(irn, pos);
- }
-
- return arch_register_get_name(reg);
-}
-
-/**
- * Get the register name for a node.
- */
-static int mips_get_reg_name(lc_appendable_t *app,
- const lc_arg_occ_t *occ, const lc_arg_value_t *arg)
-{
- const char *buf;
- int res;
- ir_node *X = arg->v_ptr;
- int nr = occ->width - 1;
-
- if (!X)
- return lc_arg_append(app, occ, "(null)", 6);
-
- if (occ->conversion == 'S') {
- buf = get_mips_reg_name(X, nr, 1);
- }
- else { /* 'D' */
- buf = get_mips_reg_name(X, nr, 0);
- }
-
- res = lc_appendable_chadd(app, '$');
- res += lc_appendable_snadd(app, buf, strlen(buf));
- return res;
-}
-
-/**
- * Returns the tarval or offset of an mips node as a string.
- */
-static int mips_const_to_str(lc_appendable_t *app,
- const lc_arg_occ_t *occ, const lc_arg_value_t *arg)
-{
- const char *buf;
- ir_node *X = arg->v_ptr;
-
- if (!X)
- return lc_arg_append(app, occ, "(null)", 6);
-
- if (occ->conversion == 'C') {
- buf = node_const_to_str(X);
- }
- else { /* 'O' */
- buf = node_offset_to_str(X);
- }
-
- return lc_arg_append(app, occ, buf, strlen(buf));