From: Christoph Mallon Date: Tue, 22 Apr 2008 14:41:59 +0000 (+0000) Subject: Fix inconsistency between reg_req and ins of Push: reg_req expected the stack in... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=7e8388fa7996ff182d3aa4e0cdd41b27bed4982f;p=libfirm Fix inconsistency between reg_req and ins of Push: reg_req expected the stack in the fourth place and val as fith, ins said "val" before "stack". Make the val parameter fourth and stack last to be more consistent with most other AM nodes. [r19358] --- diff --git a/ir/be/ia32/bearch_ia32.c b/ir/be/ia32/bearch_ia32.c index b199cd662..f872202b9 100644 --- a/ir/be/ia32/bearch_ia32.c +++ b/ir/be/ia32/bearch_ia32.c @@ -451,7 +451,7 @@ static const arch_register_t *ia32_abi_prologue(void *self, ir_node **mem, pmap be_node_set_flags(get_Proj_pred(curr_bp), BE_OUT_POS(get_Proj_proj(curr_bp)), arch_irn_flags_ignore); /* push ebp */ - push = new_rd_ia32_Push(NULL, env->irg, bl, noreg, noreg, *mem, curr_sp, curr_bp); + push = new_rd_ia32_Push(NULL, env->irg, bl, noreg, noreg, *mem, curr_bp, curr_sp); curr_sp = new_r_Proj(env->irg, bl, push, get_irn_mode(curr_sp), pn_ia32_Push_stack); *mem = new_r_Proj(env->irg, bl, push, mode_M, pn_ia32_Push_M); @@ -1256,7 +1256,7 @@ static ir_node *create_push(ia32_code_gen_t *cg, ir_node *node, ir_node *schedpo ir_node *noreg = ia32_new_NoReg_gp(cg); ir_node *frame = get_irg_frame(irg); - ir_node *push = new_rd_ia32_Push(dbg, irg, block, frame, noreg, mem, sp, noreg); + ir_node *push = new_rd_ia32_Push(dbg, irg, block, frame, noreg, mem, noreg, sp); set_ia32_frame_ent(push, ent); set_ia32_use_frame(push); diff --git a/ir/be/ia32/ia32_optimize.c b/ir/be/ia32/ia32_optimize.c index 1f5fa6d82..b6fc4d797 100644 --- a/ir/be/ia32/ia32_optimize.c +++ b/ir/be/ia32/ia32_optimize.c @@ -119,7 +119,7 @@ static void peephole_ia32_Store_IncSP_to_push(ir_node *node) noreg = ia32_new_NoReg_gp(cg); base = be_get_IncSP_pred(incsp); val = get_irn_n(node, n_ia32_Store_val); - push = new_rd_ia32_Push(dbgi, irg, block, noreg, noreg, mem, base, val); + push = new_rd_ia32_Push(dbgi, irg, block, noreg, noreg, mem, val, base); proj = new_r_Proj(irg, block, push, mode_M, pn_ia32_Push_M); @@ -451,7 +451,7 @@ static void peephole_IncSP_Store_to_push(ir_node *irn) mem = get_irn_n(store, n_ia32_mem); spreg = arch_get_irn_register(cg->arch_env, curr_sp); - push = new_rd_ia32_Push(get_irn_dbg_info(store), irg, block, noreg, noreg, mem, curr_sp, val); + push = new_rd_ia32_Push(get_irn_dbg_info(store), irg, block, noreg, noreg, mem, val, curr_sp); sched_add_before(irn, push); diff --git a/ir/be/ia32/ia32_spec.pl b/ir/be/ia32/ia32_spec.pl index 4b8d1d6f4..84c2425bf 100644 --- a/ir/be/ia32/ia32_spec.pl +++ b/ir/be/ia32/ia32_spec.pl @@ -1365,9 +1365,9 @@ Lea => { Push => { state => "exc_pinned", - reg_req => { in => [ "gp", "gp", "none", "esp", "gp" ], out => [ "esp", "none" ] }, + reg_req => { in => [ "gp", "gp", "none", "gp", "esp" ], out => [ "esp", "none" ] }, ins => [ "base", "index", "mem", "val", "stack" ], - emit => '. push%M %unop4', + emit => '. push%M %unop3', outs => [ "stack:I|S", "M" ], am => "source,binary", latency => 2,