Commit 4ed3e26c authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Replace magic 4 by SPARC_REGISTER_SIZE.

parent 268ddd70
......@@ -74,13 +74,14 @@ extern const arch_irn_ops_t sparc_irn_ops;
* param 0-5 in this spaces and then handle va_next by simply
* incrementing the stack pointer
*/
#define SPARC_IMMEDIATE_MIN -4096
#define SPARC_IMMEDIATE_MAX 4095
#define SPARC_MIN_STACKSIZE 92
#define SPARC_AGGREGATE_RETURN_OFFSET 64
#define SPARC_PARAMS_SPILL_OFFSET 68
#define SPARC_N_PARAM_REGS 6
#define SPARC_STACK_ALIGNMENT 8
#define SPARC_IMMEDIATE_MIN -4096
#define SPARC_IMMEDIATE_MAX 4095
#define SPARC_MIN_STACKSIZE 92
#define SPARC_AGGREGATE_RETURN_OFFSET 64
#define SPARC_PARAMS_SPILL_OFFSET 68
#define SPARC_N_PARAM_REGS 6
#define SPARC_STACK_ALIGNMENT 8
#define SPARC_REGISTER_SIZE 4
static inline bool sparc_is_value_imm_encodeable(int32_t value)
{
......
......@@ -246,8 +246,8 @@ calling_convention_t *sparc_decide_calling_convention(ir_type *function_type,
} else {
param->type = param_type;
param->offset = stack_offset;
/* increase offset 4 bytes so everything is aligned */
stack_offset += bits > 32 ? bits/8 : 4;
/* increase offset by at least SPARC_REGISTER_SIZE bytes so everything is aligned */
stack_offset += bits > 8 * SPARC_REGISTER_SIZE ? bits / 8 : SPARC_REGISTER_SIZE;
continue;
}
......@@ -269,7 +269,7 @@ calling_convention_t *sparc_decide_calling_convention(ir_type *function_type,
param->type = type;
param->offset = stack_offset;
assert(get_mode_size_bits(regmode) == 32);
stack_offset += 4;
stack_offset += SPARC_REGISTER_SIZE;
}
}
}
......
......@@ -577,7 +577,7 @@ static void emit_be_Perm(const ir_node *irn)
* the next bigger integer that's evenly divisible by it. */
static unsigned get_aligned_sp_change(unsigned const memperm_arity)
{
const unsigned bytes = memperm_arity * 4;
const unsigned bytes = memperm_arity * SPARC_REGISTER_SIZE;
return round_up2(bytes, SPARC_STACK_ALIGNMENT);
}
......@@ -616,14 +616,14 @@ static void emit_be_MemPerm(const ir_node *node)
/* load from entity */
be_emit_irprintf("\tld [%%fp%+d], %%l%d", offset, i);
be_emit_finish_line_gas(node);
sp_change += 4;
sp_change += SPARC_REGISTER_SIZE;
}
for (i = memperm_arity-1; i >= 0; --i) {
ir_entity *entity = be_get_MemPerm_out_entity(node, i);
int offset = be_get_stack_entity_offset(layout, entity, 0);
sp_change -= 4;
sp_change -= SPARC_REGISTER_SIZE;
/* store to new entity */
be_emit_irprintf("\tst %%l%d, [%%fp%+d]", i, offset);
......
......@@ -216,7 +216,7 @@ static ir_type *compute_arg_type(ir_graph *irg, calling_convention_t *cconv,
if (param->reg0 != NULL) {
/* use reserved spill space on between type */
if (entity != NULL) {
long offset = SPARC_PARAMS_SPILL_OFFSET + i*4;
long offset = SPARC_PARAMS_SPILL_OFFSET + i * SPARC_REGISTER_SIZE;
assert(i < SPARC_N_PARAM_REGS);
set_entity_owner(entity, between_type);
set_entity_offset(entity, offset);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment