Commit d74abd3a authored by Christoph Mallon's avatar Christoph Mallon
Browse files

sparc: Generate the input enum for Return.

parent 206804ae
......@@ -105,9 +105,4 @@ typedef struct sparc_asm_operand_t {
ir_entity *immediate_value_entity;
} sparc_asm_operand_t;
enum n_sparc_Return {
n_sparc_Return_mem = 0,
n_sparc_Return_sp = 1,
};
#endif
......@@ -530,6 +530,7 @@ Return => {
template => $xop,
irn_flags => [ "has_delay_slot" ],
in_reqs => "...",
ins => [ "mem", "sp", "first_result" ],
constructors => {
imm => {
attr => "ir_entity *entity, int32_t offset",
......
......@@ -1682,22 +1682,20 @@ static ir_node *gen_Return(ir_node *node)
struct obstack *be_obst = be_get_be_obst(irg);
/* estimate number of return values */
size_t n_ins = 2 + n_res; /* memory + stackpointer, return values */
unsigned p = n_sparc_Return_first_result;
unsigned n_ins = p + n_res;
if (current_cconv->omit_fp)
n_ins += ARRAY_SIZE(omit_fp_callee_saves);
const arch_register_req_t **reqs
= OALLOCN(be_obst, const arch_register_req_t*, n_ins);
ir_node **in = ALLOCAN(ir_node*, n_ins);
size_t p = 0;
in[p] = new_mem;
reqs[p] = arch_no_register_req;
++p;
in[n_sparc_Return_mem] = new_mem;
reqs[n_sparc_Return_mem] = arch_no_register_req;
in[p] = sp;
reqs[p] = sp_reg->single_req;
++p;
in[n_sparc_Return_sp] = sp;
reqs[n_sparc_Return_sp] = sp_reg->single_req;
/* result values */
for (size_t i = 0; i < n_res; ++i) {
......
Supports Markdown
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