Commit 8c9e9566 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

be: Introduce a constraint for execution outputs.

parent 6b240a34
......@@ -177,7 +177,7 @@ Jmp => {
state => "pinned",
op_flags => [ "cfopcode" ],
irn_flags => [ "simple_jump" ],
out_reqs => [ "none" ],
out_reqs => [ "exec" ],
mode => "mode_X",
},
......@@ -193,7 +193,7 @@ Return => {
state => "pinned",
op_flags => [ "cfopcode" ],
in_reqs => "...",
out_reqs => [ "none" ],
out_reqs => [ "exec" ],
ins => [ "mem", "stack", "first_result" ],
outs => [ "X" ],
mode => "mode_X",
......
......@@ -139,7 +139,7 @@ static void init_amd64_switch_attributes(ir_node *node,
attr->table_entity = table_entity;
be_foreach_out(node, o) {
arch_set_irn_register_req_out(node, o, arch_no_register_req);
arch_set_irn_register_req_out(node, o, arch_exec_req);
}
}
......
......@@ -375,7 +375,7 @@ ijmp => {
state => "pinned",
op_flags => [ "cfopcode", "unknown_jump" ],
in_reqs => "...",
out_reqs => [ "none", "none", "mem" ],
out_reqs => [ "exec", "none", "mem" ],
outs => [ "X", "unused", "M" ],
attr_type => "amd64_addr_attr_t",
attr => "amd64_insn_mode_t insn_mode, amd64_op_mode_t op_mode, amd64_addr_t addr",
......@@ -385,7 +385,7 @@ ijmp => {
jmp => {
state => "pinned",
op_flags => [ "cfopcode" ],
out_reqs => [ "none" ],
out_reqs => [ "exec" ],
fixed => "amd64_op_mode_t op_mode = AMD64_OP_IMM32;",
mode => "mode_X",
},
......@@ -417,7 +417,7 @@ jcc => {
state => "pinned",
op_flags => [ "cfopcode", "forking" ],
in_reqs => [ "eflags" ],
out_reqs => [ "none", "none" ],
out_reqs => [ "exec", "exec" ],
ins => [ "eflags" ],
outs => [ "false", "true" ],
attr_type => "amd64_cc_attr_t",
......@@ -472,7 +472,7 @@ ret => {
state => "pinned",
op_flags => [ "cfopcode" ],
in_reqs => "...",
out_reqs => [ "none" ],
out_reqs => [ "exec" ],
ins => [ "mem", "stack", "first_result" ],
fixed => "amd64_op_mode_t op_mode = AMD64_OP_NONE;\n",
mode => "mode_X",
......
......@@ -334,7 +334,7 @@ static void init_arm_SwitchJmp_attributes(ir_node *res,
attr->table = table;
be_foreach_out(res, o) {
arch_set_irn_register_req_out(res, o, arch_no_register_req);
arch_set_irn_register_req_out(res, o, arch_exec_req);
}
}
......
......@@ -488,7 +488,7 @@ B => {
state => "pinned",
mode => "mode_T",
in_reqs => [ "flags" ],
out_reqs => [ "none", "none" ],
out_reqs => [ "exec", "exec" ],
ins => [ "flags" ],
attr => "ir_relation relation",
attr_type => "arm_CondJmp_attr_t",
......@@ -499,7 +499,7 @@ Jmp => {
state => "pinned",
op_flags => [ "cfopcode" ],
irn_flags => [ "simple_jump" ],
out_reqs => [ "none" ],
out_reqs => [ "exec" ],
mode => "mode_X",
},
......@@ -648,7 +648,7 @@ Return => {
in_reqs => "...",
ins => [ "mem", "sp", "first_result" ],
mode => "mode_X",
out_reqs => [ "none" ],
out_reqs => [ "exec" ],
emit => "bx lr",
},
......
......@@ -20,6 +20,20 @@
#include "raw_bitset.h"
#include "util.h"
static arch_register_class_t arch_exec_cls = {
.name = "exec",
.mode = NULL, /* Filled in at initialization. */
.regs = NULL,
.class_req = arch_exec_req,
.index = (unsigned)-1,
.n_regs = 0,
.manual_ra = true,
};
arch_register_req_t const arch_exec_requirement = {
.cls = &arch_exec_cls,
};
static arch_register_class_t arch_memory_cls = {
.name = "memory",
.mode = NULL, /* Filled in at initialization. */
......@@ -174,5 +188,6 @@ void arch_copy_irn_out_info(ir_node *const dst, unsigned const dst_pos, ir_node
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch)
void be_init_arch(void)
{
arch_exec_cls.mode = mode_X;
arch_memory_cls.mode = mode_M;
}
......@@ -20,6 +20,9 @@
#include "beinfo.h"
#include "be.h"
extern arch_register_req_t const arch_exec_requirement;
#define arch_exec_req (&arch_exec_requirement)
extern arch_register_req_t const arch_memory_requirement;
#define arch_memory_req (&arch_memory_requirement)
......
......@@ -744,7 +744,7 @@ static void init_ia32_switch_attributes(ir_node *node,
attr->table = table;
be_foreach_out(node, o) {
arch_set_irn_register_req_out(node, o, arch_no_register_req);
arch_set_irn_register_req_out(node, o, arch_exec_req);
}
}
......
......@@ -205,7 +205,7 @@ my $divop = {
irn_flags => [ "modify_flags" ],
state => "exc_pinned",
in_reqs => [ "gp", "gp", "mem", "gp", "eax", "edx" ],
out_reqs => [ "eax", "flags", "mem", "edx", "none", "none" ],
out_reqs => [ "eax", "flags", "mem", "edx", "exec", "exec" ],
ins => [ "base", "index", "mem", "divisor", "dividend_low", "dividend_high" ],
outs => [ "div_res", "flags", "M", "mod_res", "X_regular", "X_except" ],
am => "source,unary",
......@@ -820,7 +820,7 @@ Jcc => {
state => "pinned",
op_flags => [ "cfopcode", "forking" ],
in_reqs => [ "eflags" ],
out_reqs => [ "none", "none" ],
out_reqs => [ "exec", "exec" ],
ins => [ "eflags" ],
outs => [ "false", "true" ],
attr_type => "ia32_condcode_attr_t",
......@@ -843,7 +843,7 @@ Jmp => {
state => "pinned",
irn_flags => [ "simple_jump" ],
op_flags => [ "cfopcode" ],
out_reqs => [ "none" ],
out_reqs => [ "exec" ],
latency => 1,
mode => "mode_X",
},
......@@ -852,7 +852,7 @@ IJmp => {
state => "pinned",
op_flags => [ "cfopcode", "unknown_jump" ],
in_reqs => [ "gp", "gp", "mem", "gp" ],
out_reqs => [ "none", "none", "mem" ],
out_reqs => [ "exec", "none", "mem" ],
ins => [ "base", "index", "mem", "target" ],
outs => [ "jmp", "none", "M" ],
am => "source,unary",
......@@ -972,7 +972,7 @@ Load => {
op_flags => [ "uses_memory", "fragile" ],
state => "exc_pinned",
in_reqs => [ "gp", "gp", "mem" ],
out_reqs => [ "gp", "none", "mem", "none", "none" ],
out_reqs => [ "gp", "none", "mem", "exec", "exec" ],
ins => [ "base", "index", "mem" ],
outs => [ "res", "unused", "M", "X_regular", "X_except" ],
latency => 0,
......@@ -986,7 +986,7 @@ Store => {
"" => { in_reqs => [ "gp", "gp", "mem", "gp" ] },
"8bit" => { in_reqs => [ "gp", "gp", "mem", "eax ebx ecx edx" ] }
},
out_reqs => [ "mem", "none", "none" ],
out_reqs => [ "mem", "exec", "exec" ],
ins => [ "base", "index", "mem", "val" ],
outs => [ "M", "X_regular", "X_except" ],
emit => "mov%M %#S3, %AM",
......@@ -1166,7 +1166,7 @@ Return => {
state => "pinned",
op_flags => [ "cfopcode" ],
in_reqs => "...",
out_reqs => [ "none" ],
out_reqs => [ "exec" ],
ins => [ "mem", "stack", "first_result" ],
mode => "mode_X",
attr_type => "ia32_return_attr_t",
......@@ -1472,7 +1472,7 @@ xLoad => {
op_flags => [ "uses_memory", "fragile" ],
state => "exc_pinned",
in_reqs => [ "gp", "gp", "mem" ],
out_reqs => [ "xmm", "none", "mem", "none", "none" ],
out_reqs => [ "xmm", "none", "mem", "exec", "exec" ],
ins => [ "base", "index", "mem" ],
outs => [ "res", "unused", "M", "X_regular", "X_except" ],
emit => "movs%FX %AM, %D0",
......@@ -1485,7 +1485,7 @@ xStore => {
op_flags => [ "uses_memory", "fragile" ],
state => "exc_pinned",
in_reqs => [ "gp", "gp", "mem", "xmm" ],
out_reqs => [ "mem", "none", "none" ],
out_reqs => [ "mem", "exec", "exec" ],
ins => [ "base", "index", "mem", "val" ],
outs => [ "M", "X_regular", "X_except" ],
emit => "movs%FX %S3, %AM",
......@@ -1558,7 +1558,7 @@ Conv_I2I => {
"" => { in_reqs => [ "gp", "gp", "mem", "gp" ] },
"8bit" => { in_reqs => [ "gp", "gp", "mem", "eax ebx ecx edx" ] }
},
out_reqs => [ "gp", "none", "mem", "none", "none" ],
out_reqs => [ "gp", "none", "mem", "exec", "exec" ],
ins => [ "base", "index", "mem", "val" ],
outs => [ "res", "unused", "M", "X_regular", "X_except" ],
emit => "mov%#Ml %#AS3, %D0",
......@@ -1650,7 +1650,7 @@ fld => {
op_flags => [ "uses_memory", "fragile" ],
state => "exc_pinned",
in_reqs => [ "gp", "gp", "mem" ],
out_reqs => [ "fp", "none", "mem", "none", "none" ],
out_reqs => [ "fp", "none", "mem", "exec", "exec" ],
ins => [ "base", "index", "mem" ],
outs => [ "res", "unused", "M", "X_regular", "X_except" ],
emit => "fld%FM %AM",
......@@ -1665,7 +1665,7 @@ fst => {
op_flags => [ "uses_memory", "fragile" ],
state => "exc_pinned",
in_reqs => [ "gp", "gp", "mem", "fp" ],
out_reqs => [ "mem", "none", "none" ],
out_reqs => [ "mem", "exec", "exec" ],
ins => [ "base", "index", "mem", "val" ],
outs => [ "M", "X_regular", "X_except" ],
emit => "fst%FP%FM %AM",
......@@ -1690,7 +1690,7 @@ fist => {
op_flags => [ "uses_memory", "fragile" ],
state => "exc_pinned",
in_reqs => [ "gp", "gp", "mem", "fp", "fpcw" ],
out_reqs => [ "mem", "none", "none" ],
out_reqs => [ "mem", "exec", "exec" ],
ins => [ "base", "index", "mem", "val", "fpcw" ],
outs => [ "M", "X_regular", "X_except" ],
emit => "fist%FP%FM %AM",
......@@ -1703,7 +1703,7 @@ fisttp => {
op_flags => [ "uses_memory", "fragile" ],
state => "exc_pinned",
in_reqs => [ "gp", "gp", "mem", "fp" ],
out_reqs => [ "mem", "none", "none", "in_r4" ],
out_reqs => [ "mem", "exec", "exec", "in_r4" ],
ins => [ "base", "index", "mem", "val" ],
outs => [ "M", "X_regular", "X_except", "res" ],
emit => "fisttp%FM %AM",
......@@ -1890,7 +1890,7 @@ xxLoad => {
op_flags => [ "uses_memory", "fragile" ],
state => "exc_pinned",
in_reqs => [ "gp", "gp", "mem" ],
out_reqs => [ "xmm", "mem", "none", "none" ],
out_reqs => [ "xmm", "mem", "exec", "exec" ],
emit => "movdqu %D0, %AM",
ins => [ "base", "index", "mem" ],
outs => [ "res", "M", "X_regular", "X_except" ],
......@@ -1901,7 +1901,7 @@ xxStore => {
op_flags => [ "uses_memory", "fragile" ],
state => "exc_pinned",
in_reqs => [ "gp", "gp", "mem", "xmm" ],
out_reqs => [ "mem", "none", "none" ],
out_reqs => [ "mem", "exec", "exec" ],
ins => [ "base", "index", "mem", "val" ],
outs => [ "M", "X_regular", "X_except" ],
emit => "movdqu %S3, %AM",
......
......@@ -1029,7 +1029,9 @@ sub generate_requirements {
}
my $class;
if ($reqs eq "mem") {
if ($reqs eq "exec") {
return "arch_exec_requirement";
} elsif ($reqs eq "mem") {
return "arch_memory_requirement";
} elsif ($reqs eq "none") {
return "arch_no_requirement";
......
......@@ -252,7 +252,7 @@ static void init_sparc_switch_jmp_attributes(ir_node *node,
attr->table_entity = table_entity;
be_foreach_out(node, o) {
arch_set_irn_register_req_out(node, o, arch_no_register_req);
arch_set_irn_register_req_out(node, o, arch_exec_req);
}
}
......
......@@ -275,7 +275,7 @@ my $branchcc = {
my $xop = {
state => "pinned",
op_flags => [ "cfopcode" ],
out_reqs => [ "none" ],
out_reqs => [ "exec" ],
mode => "mode_X",
};
......@@ -497,7 +497,7 @@ Bicc => {
attr => "ir_relation relation, bool is_unsigned",
init_attr => "\tinit_sparc_jmp_cond_attr(res, relation, is_unsigned);",
in_reqs => [ "flags" ],
out_reqs => [ "none", "none" ],
out_reqs => [ "exec", "exec" ],
},
fbfcc => {
......@@ -505,7 +505,7 @@ fbfcc => {
attr => "ir_relation relation",
init_attr => "\tinit_sparc_jmp_cond_attr(res, relation, false);",
in_reqs => [ "fpflags" ],
out_reqs => [ "none", "none" ],
out_reqs => [ "exec", "exec" ],
},
Ba => {
......
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