Commit 49185aca authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ia32: Simplify ClimbFrame to not use ProduceVal.

parent d5b9138d
......@@ -1340,12 +1340,11 @@ static void emit_ia32_ClimbFrame(const ir_node *node)
{
const ia32_climbframe_attr_t *attr = get_ia32_climbframe_attr_const(node);
ia32_emitf(node, "movl %S0, %D0");
ia32_emitf(node, "movl $%u, %S1", attr->count);
ia32_emitf(node, "movl $%u, %D1", attr->count);
be_emit_cstring("0:\n");
be_emit_write_line();
ia32_emitf(node, "movl (%D0), %D0");
ia32_emitf(node, "dec %S1");
ia32_emitf(node, "dec %D1");
ia32_emitf(node, "jnz 0b");
}
......
......@@ -1223,13 +1223,13 @@ Call => {
# PS: try gcc __builtin_frame_address(100000) :-)
#
ClimbFrame => {
reg_req => { in => [ "gp", "gp", "gp"], out => [ "in_r3" ] },
ins => [ "frame", "cnt", "tmp" ],
outs => [ "res" ],
reg_req => { in => [ "gp" ], out => [ "in_r1", "!in_r1" ] },
ins => [ "frame" ],
outs => [ "res", "cnt" ],
latency => 4, # random number
attr_type => "ia32_climbframe_attr_t",
attr => "unsigned count",
mode => $mode_gp
modified_flags => $status_flags
},
#
......
......@@ -4728,9 +4728,8 @@ static ir_node *gen_return_address(ir_node *node)
ir_tarval *tv = get_Const_tarval(param);
unsigned long value = get_tarval_long(tv);
if (value > 0) {
ir_node *cnt = new_bd_ia32_ProduceVal(dbgi, block);
ir_node *res = new_bd_ia32_ProduceVal(dbgi, block);
ptr = new_bd_ia32_ClimbFrame(dbgi, block, ptr, cnt, res, value);
ir_node *const cfr = new_bd_ia32_ClimbFrame(dbgi, block, ptr, value);
ptr = new_r_Proj(cfr, ia32_mode_gp, pn_ia32_ClimbFrame_res);
}
/* load the return address from this frame */
......@@ -4768,9 +4767,8 @@ static ir_node *gen_frame_address(ir_node *node)
ir_node *ptr = get_irg_frame(irg);
unsigned long value = get_tarval_long(tv);
if (value > 0) {
ir_node *cnt = new_bd_ia32_ProduceVal(dbgi, block);
ir_node *res = new_bd_ia32_ProduceVal(dbgi, block);
ptr = new_bd_ia32_ClimbFrame(dbgi, block, ptr, cnt, res, value);
ir_node *const cfr = new_bd_ia32_ClimbFrame(dbgi, block, ptr, value);
ptr = new_r_Proj(cfr, ia32_mode_gp, pn_ia32_ClimbFrame_res);
}
/* load the frame address from this frame */
......
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