*/
static const arch_register_t *map_i_to_o_reg(const arch_register_t *reg)
{
- unsigned idx = arch_register_get_index(reg);
+ unsigned idx = reg->global_index;
assert(REG_I0 <= idx && idx <= REG_I7);
idx += REG_O0 - REG_I0;
assert(REG_O0 <= idx && idx <= REG_O7);
- return &sparc_gp_regs[idx];
+ return &sparc_registers[idx];
}
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 = ¶ms[i];
- param->type = param_type;
if (regnum < n_param_regs) {
const arch_register_t *reg = param_regs[regnum++];
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;