Commit 799d89c9 authored by Matthias Braun's avatar Matthias Braun
Browse files

some cleanups for middleend node creation in backends

Some backends create nodes in their lower_for_target phases already.
These nodes are placeholders for real backend nodes later, in contrast
they do not have register requirements or backend attributes. Simplified
this by allowing custom dumpers for them and leaving out the backend
node structs.
parent 0363d8fc
...@@ -309,14 +309,15 @@ Adc => { ...@@ -309,14 +309,15 @@ Adc => {
}, },
l_Add => { l_Add => {
op_flags => [ "constlike" ],
reg_req => { in => [ "none", "none" ], out => [ "none" ] },
ins => [ "left", "right" ], ins => [ "left", "right" ],
attr_type => "",
dump_func => "NULL",
}, },
l_Adc => { l_Adc => {
reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
ins => [ "left", "right", "eflags" ], ins => [ "left", "right", "eflags" ],
attr_type => "",
dump_func => "NULL",
}, },
Mul => { Mul => {
...@@ -335,14 +336,10 @@ Mul => { ...@@ -335,14 +336,10 @@ Mul => {
}, },
l_Mul => { l_Mul => {
# we should not rematrialize this node. It produces 2 results and has
# very strict constraints
op_flags => [ "constlike" ],
cmp_attr => "return 1;",
reg_req => { in => [ "none", "none" ],
out => [ "none", "none", "none", "none" ] },
ins => [ "left", "right" ], ins => [ "left", "right" ],
outs => [ "res_low", "flags", "M", "res_high" ], outs => [ "res_low", "flags", "M", "res_high" ],
attr_type => "",
dump_func => "NULL",
}, },
IMul => { IMul => {
...@@ -376,12 +373,10 @@ IMul1OP => { ...@@ -376,12 +373,10 @@ IMul1OP => {
}, },
l_IMul => { l_IMul => {
op_flags => [ "constlike" ],
cmp_attr => "return 1;",
reg_req => { in => [ "none", "none" ],
out => [ "none", "none", "none", "none" ] },
ins => [ "left", "right" ], ins => [ "left", "right" ],
outs => [ "res_low", "flags", "M", "res_high" ], outs => [ "res_low", "flags", "M", "res_high" ],
attr_type => "",
dump_func => "NULL",
}, },
And => { And => {
...@@ -579,13 +574,15 @@ Sbb0 => { ...@@ -579,13 +574,15 @@ Sbb0 => {
}, },
l_Sub => { l_Sub => {
reg_req => { in => [ "none", "none" ], out => [ "none" ] },
ins => [ "minuend", "subtrahend" ], ins => [ "minuend", "subtrahend" ],
attr_type => "",
dump_func => "NULL",
}, },
l_Sbb => { l_Sbb => {
reg_req => { in => [ "none", "none", "none" ], out => [ "none" ] },
ins => [ "minuend", "subtrahend", "eflags" ], ins => [ "minuend", "subtrahend", "eflags" ],
attr_type => "",
dump_func => "NULL",
}, },
IDiv => { IDiv => {
...@@ -977,6 +974,14 @@ Test8Bit => { ...@@ -977,6 +974,14 @@ Test8Bit => {
modified_flags => $status_flags modified_flags => $status_flags
}, },
l_Setcc => {
ins => [ "cond" ],
outs => [ "res" ],
mode => "mode_Bu",
attr_type => "",
dump_func => "NULL",
},
Setcc => { Setcc => {
#irn_flags => [ "rematerializable" ], #irn_flags => [ "rematerializable" ],
reg_req => { in => [ "eflags" ], out => [ "eax ebx ecx edx" ] }, reg_req => { in => [ "eflags" ], out => [ "eax ebx ecx edx" ] },
...@@ -1919,18 +1924,16 @@ CvtSI2SD => { ...@@ -1919,18 +1924,16 @@ CvtSI2SD => {
l_LLtoFloat => { l_LLtoFloat => {
op_flags => [ "labeled" ],
cmp_attr => "return 1;",
ins => [ "val_high", "val_low" ], ins => [ "val_high", "val_low" ],
reg_req => { in => [ "none", "none" ], out => [ "none" ] } attr_type => "",
dump_func => "NULL",
}, },
l_FloattoLL => { l_FloattoLL => {
op_flags => [ "labeled" ],
cmp_attr => "return 1;",
ins => [ "val" ], ins => [ "val" ],
outs => [ "res_high", "res_low" ], outs => [ "res_high", "res_low" ],
reg_req => { in => [ "none" ], out => [ "none", "none" ] } attr_type => "",
dump_func => "NULL",
}, },
CopyB => { CopyB => {
......
...@@ -655,12 +655,14 @@ EOF ...@@ -655,12 +655,14 @@ EOF
} }
# set default values for state and flags if not given # set default values for state and flags if not given
$n{"state"} = "floats" if (! exists($n{"state"})); $n{"state"} = "floats" if (! exists($n{"state"}));
$n{"op_flags"} = ["none"] if (! exists($n{"op_flags"})); $n{"op_flags"} = ["none"] if (! exists($n{"op_flags"}));
$n{"dump_func"} = "${arch}_dump_node" if (!exists($n{"dump_func"}));
my $dump_func = $n{"dump_func"};
push(@obst_new_irop, "\n\tmemset(&ops, 0, sizeof(ops));\n"); push(@obst_new_irop, "\n\tmemset(&ops, 0, sizeof(ops));\n");
push(@obst_new_irop, "\tops.be_ops = be_ops;\n"); push(@obst_new_irop, "\tops.be_ops = be_ops;\n");
push(@obst_new_irop, "\tops.dump_node = $arch\_dump_node;\n"); push(@obst_new_irop, "\tops.dump_node = ${dump_func};\n");
if (defined($cmp_attr_func)) { if (defined($cmp_attr_func)) {
push(@obst_new_irop, "\tops.node_cmp_attr = ${cmp_attr_func};\n"); push(@obst_new_irop, "\tops.node_cmp_attr = ${cmp_attr_func};\n");
......
...@@ -93,9 +93,6 @@ static void sparc_dump_node(FILE *F, ir_node *n, dump_reason_t reason) ...@@ -93,9 +93,6 @@ static void sparc_dump_node(FILE *F, ir_node *n, dump_reason_t reason)
break; break;
case dump_node_info_txt: case dump_node_info_txt:
if (is_sparc_AddX_t(n) || is_sparc_AddCC_t(n))
break;
arch_dump_reqs_and_registers(F, n); arch_dump_reqs_and_registers(F, n);
sparc_attr = get_sparc_attr_const(n); sparc_attr = get_sparc_attr_const(n);
if (sparc_attr->immediate_value_entity) { if (sparc_attr->immediate_value_entity) {
......
...@@ -284,11 +284,13 @@ AddCC_t => { ...@@ -284,11 +284,13 @@ AddCC_t => {
ins => [ "left", "right" ], ins => [ "left", "right" ],
outs => [ "res", "flags" ], outs => [ "res", "flags" ],
attr_type => "", attr_type => "",
dump_node => "NULL",
}, },
AddX_t => { AddX_t => {
ins => [ "left", "right", "flags_input" ], ins => [ "left", "right", "flags_input" ],
attr_type => "", attr_type => "",
dump_node => "NULL",
}, },
Sub => { Sub => {
...@@ -316,11 +318,13 @@ SubCC_t => { ...@@ -316,11 +318,13 @@ SubCC_t => {
ins => [ "left", "right" ], ins => [ "left", "right" ],
outs => [ "res", "flags" ], outs => [ "res", "flags" ],
attr_type => "", attr_type => "",
dump_node => "NULL",
}, },
SubX_t => { SubX_t => {
ins => [ "left", "right", "flags_input" ], ins => [ "left", "right", "flags_input" ],
attr_type => "", attr_type => "",
dump_node => "NULL",
}, },
# Load / Store # Load / Store
......
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