Commit 773ded91 authored by Christoph Mallon's avatar Christoph Mallon Committed by Matthias Braun
Browse files

Factorise code to transform unary ops on AMD64.

parent 40b1e0a5
......@@ -116,15 +116,18 @@ static ir_node *gen_Shr (ir_node *const node) { return gen_binop(node, &new_bd_a
static ir_node *gen_Shrs(ir_node *const node) { return gen_binop(node, &new_bd_amd64_Sar); }
static ir_node *gen_Sub (ir_node *const node) { return gen_binop(node, &new_bd_amd64_Sub); }
static ir_node *gen_Minus(ir_node *node)
static ir_node *gen_unop(ir_node *const node, ir_node *(*const new_node)(dbg_info*, ir_node*, ir_node*))
{
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *val = be_transform_node(get_Minus_op(node));
dbg_info *dbgi = get_irn_dbg_info(node);
dbg_info *const dbgi = get_irn_dbg_info(node);
ir_node *const block = be_transform_node(get_nodes_block(node));
ir_node *const op = get_unop_op(node);
ir_node *const new_op = be_transform_node(op);
return new_bd_amd64_Neg(dbgi, block, val);
return new_node(dbgi, block, new_op);
}
static ir_node *gen_Minus(ir_node *const node) { return gen_unop(node, &new_bd_amd64_Neg); }
static ir_node *gen_Jmp(ir_node *node)
{
ir_node *block = get_nodes_block(node);
......
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