sparc: mostly implement reg+reg address mode
[libfirm] / ir / be / sparc / sparc_cconv.c
index 8554227..92c7297 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2010 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
 #include "xmalloc.h"
 #include "error.h"
 
+/**
+ * Maps an input register representing the i'th register input
+ * to the i'th register output.
+ */
 static const arch_register_t *map_i_to_o_reg(const arch_register_t *reg)
 {
        unsigned idx = arch_register_get_index(reg);
@@ -67,7 +71,6 @@ calling_convention_t *sparc_decide_calling_convention(ir_type *function_type,
                ir_mode            *mode       = get_type_mode(param_type);
                int                 bits       = get_mode_size_bits(mode);
                reg_or_stackslot_t *param      = &params[i];
-               param->type = param_type;
 
                if (regnum < n_param_regs) {
                        const arch_register_t *reg = param_regs[regnum++];
@@ -75,6 +78,7 @@ calling_convention_t *sparc_decide_calling_convention(ir_type *function_type,
                                reg = map_i_to_o_reg(reg);
                        param->reg0 = reg;
                } else {
+                       param->type   = param_type;
                        param->offset = stack_offset;
                        /* increase offset 4 bytes so everything is aligned */
                        stack_offset += bits > 32 ? bits/8 : 4;