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

be: Introduce a generic be_Asm node.

parent a2e4439a
......@@ -717,7 +717,7 @@ static void sparc_set_frame_entity(ir_node *node, ir_entity *entity,
* fulfilled */
static bool has_must_be_same(const ir_node *node)
{
return is_sparc_Cas(node) || is_sparc_ASM(node);
return is_sparc_Cas(node) || be_is_Asm(node);
}
static void fix_constraints_walker(ir_node *block, void *env)
......
......@@ -204,18 +204,6 @@ const sparc_fp_conv_attr_t *get_sparc_fp_conv_attr_const(const ir_node *node)
return (const sparc_fp_conv_attr_t*) get_irn_generic_attr_const(node);
}
sparc_asm_attr_t *get_sparc_asm_attr(ir_node *node)
{
assert(is_sparc_ASM(node));
return (sparc_asm_attr_t*)get_irn_generic_attr(node);
}
const sparc_asm_attr_t *get_sparc_asm_attr_const(const ir_node *node)
{
assert(is_sparc_ASM(node));
return (const sparc_asm_attr_t*)get_irn_generic_attr_const(node);
}
sparc_call_attr_t *get_sparc_call_attr(ir_node *node)
{
assert(is_sparc_Call(node));
......@@ -268,14 +256,6 @@ static void init_sparc_switch_jmp_attributes(ir_node *node,
}
}
static void init_sparc_asm_attributes(ir_node *node, ident *text,
const sparc_asm_operand_t *operands)
{
sparc_asm_attr_t *attr = get_sparc_asm_attr(node);
attr->text = text;
attr->operands = operands;
}
static void init_sparc_call_attributes(ir_node *node, ir_type *call_type)
{
sparc_call_attr_t *attr = get_sparc_call_attr(node);
......@@ -345,13 +325,6 @@ static int sparc_fp_conv_attrs_equal(const ir_node *a, const ir_node *b)
&& attr_a->dest_mode == attr_b->dest_mode;
}
static int sparc_asm_attrs_equal(const ir_node *a, const ir_node *b)
{
const sparc_asm_attr_t *attr_a = get_sparc_asm_attr_const(a);
const sparc_asm_attr_t *attr_b = get_sparc_asm_attr_const(b);
return sparc_attrs_equal(a, b) && attr_a->text == attr_b->text;
}
static int sparc_call_attrs_equal(const ir_node *a, const ir_node *b)
{
const sparc_call_attr_t *attr_a = get_sparc_call_attr_const(a);
......
......@@ -36,9 +36,6 @@ const sparc_fp_attr_t *get_sparc_fp_attr_const(const ir_node *node);
sparc_fp_conv_attr_t *get_sparc_fp_conv_attr(ir_node *node);
const sparc_fp_conv_attr_t *get_sparc_fp_conv_attr_const(const ir_node *node);
sparc_asm_attr_t *get_sparc_asm_attr(ir_node *node);
const sparc_asm_attr_t *get_sparc_asm_attr_const(const ir_node *node);
sparc_call_attr_t *get_sparc_call_attr(ir_node *node);
const sparc_call_attr_t *get_sparc_call_attr_const(const ir_node *node);
......
......@@ -105,13 +105,6 @@ typedef struct sparc_asm_operand_t {
ir_entity *immediate_value_entity;
} sparc_asm_operand_t;
typedef struct sparc_asm_attr_t sparc_asm_attr_t;
struct sparc_asm_attr_t {
sparc_attr_t base;
ident *text;
const sparc_asm_operand_t *operands;
};
enum n_sparc_Return {
n_sparc_Return_mem = 0,
n_sparc_Return_sp = 1,
......
......@@ -114,8 +114,6 @@ $default_copy_attr = "sparc_copy_attr";
"\tinit_sparc_fp_attributes(res, fp_mode);\n",
sparc_fp_conv_attr_t => "be_info_init_irn(res, irn_flags_, in_reqs, n_res);\n".
"\tinit_sparc_fp_conv_attributes(res, src_mode, dest_mode);\n",
sparc_asm_attr_t => "be_info_init_irn(res, irn_flags_, in_reqs, n_res);\n".
"\tinit_sparc_asm_attributes(res, text, operands);",
sparc_call_attr_t => "be_info_init_irn(res, irn_flags_, in_reqs, n_res);\n".
"\tinit_sparc_call_attributes(res, call_type);",
);
......@@ -283,14 +281,6 @@ my $xop = {
%nodes = (
ASM => {
state => "exc_pinned",
in_reqs => "...",
out_reqs => "...",
attr => "ident *text, const sparc_asm_operand_t *operands",
attr_type => "sparc_asm_attr_t",
},
Add => {
template => $binop_operand,
emit => "add %S0, %SI1, %D0",
......
......@@ -453,8 +453,7 @@ static ir_node *gen_ASM(ir_node *node)
dbg_info *const dbgi = get_irn_dbg_info(node);
ir_node *const new_block = be_transform_nodes_block(node);
ident *const text = get_ASM_text(node);
ir_node *const new_node
= new_bd_sparc_ASM(dbgi, new_block, n_ins, in, n_outs, text, operands);
ir_node *const new_node = be_new_Asm(dbgi, new_block, n_ins, in, n_outs, text, operands);
backend_info_t *const info = be_get_info(new_node);
for (size_t o = 0; o < n_outs; ++o) {
......
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