summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonas Haag <jonas@lophus.org>2015-12-21 14:32:55 +0100
committerPhilipp Serrer <philipp@serrer.de>2018-01-18 17:59:01 +0100
commitc32169b19b54adb3ec7cfcc6792f0bf98cfc3b1b (patch)
treedfab9d7e643669b0d86a37c7057d7bb196dd174c
parentc26b6b4d99b10b920168c47b8db1ae80fe467870 (diff)
amd64 call: Add X_regular and X_except outs
-rw-r--r--ir/be/amd64/amd64_bearch.c10
-rw-r--r--ir/be/amd64/amd64_emitter.c1
-rw-r--r--ir/be/amd64/amd64_spec.pl3
-rw-r--r--ir/be/amd64/amd64_transform.c5
4 files changed, 14 insertions, 5 deletions
diff --git a/ir/be/amd64/amd64_bearch.c b/ir/be/amd64/amd64_bearch.c
index d58310f..3174697 100644
--- a/ir/be/amd64/amd64_bearch.c
+++ b/ir/be/amd64/amd64_bearch.c
@@ -513,9 +513,13 @@ static void introduce_prologue(ir_graph *const irg, bool omit_fp)
static void introduce_prologue_epilogue(ir_graph *irg, bool omit_fp)
{
/* introduce epilogue for every return node */
- foreach_irn_in(get_irg_end_block(irg), i, ret) {
- assert(is_amd64_ret(ret));
- introduce_epilogue(ret, omit_fp);
+ foreach_irn_in(get_irg_end_block(irg), i, pred) {
+ if (is_x_except_branch(pred)) {
+ /* Don't generate any code for X_except ins */
+ } else {
+ assert(is_amd64_ret(pred));
+ introduce_epilogue(pred, omit_fp);
+ }
}
introduce_prologue(irg, omit_fp);
diff --git a/ir/be/amd64/amd64_emitter.c b/ir/be/amd64/amd64_emitter.c
index 5bfa295..bc082a5 100644
--- a/ir/be/amd64/amd64_emitter.c
+++ b/ir/be/amd64/amd64_emitter.c
@@ -820,6 +820,7 @@ static void amd64_register_emitters(void)
be_set_emitter(op_amd64_jcc, emit_amd64_jcc);
be_set_emitter(op_amd64_jmp, emit_amd64_jmp);
be_set_emitter(op_amd64_jmp_switch, emit_amd64_jmp_switch);
+ be_set_emitter(op_amd64_call, emit_amd64_call);
be_set_emitter(op_amd64_mov_gp, emit_amd64_mov_gp);
be_set_emitter(op_amd64_copyB, emit_amd64_copyB);
be_set_emitter(op_amd64_copyB_i, emit_amd64_copyB_i);
diff --git a/ir/be/amd64/amd64_spec.pl b/ir/be/amd64/amd64_spec.pl
index a30a457..e675fb1 100644
--- a/ir/be/amd64/amd64_spec.pl
+++ b/ir/be/amd64/amd64_spec.pl
@@ -545,10 +545,9 @@ call => {
in_reqs => "...",
out_reqs => "...",
ins => [ "mem", "stack" ],
- outs => [ "mem", "stack", "flags", "first_result" ],
+ outs => [ "mem", "stack", "flags", "X_regular", "X_except", "first_result" ],
attr_type => "amd64_call_addr_attr_t",
attr => "const amd64_call_addr_attr_t *attr_init",
- emit => "call %*AM",
},
ret => {
diff --git a/ir/be/amd64/amd64_transform.c b/ir/be/amd64/amd64_transform.c
index 8bb93aa..6433f94 100644
--- a/ir/be/amd64/amd64_transform.c
+++ b/ir/be/amd64/amd64_transform.c
@@ -1982,11 +1982,14 @@ no_call_mem:;
/* create call node */
ir_node *const call = new_bd_amd64_call(dbgi, new_block, in_arity, in, in_req, out_arity, &call_attr);
+ ir_set_throws_exception(call, ir_throws_exception(node));
fix_node_mem_proj(call, mem_proj);
/* create output register reqs */
arch_set_irn_register_req_out(call, pn_amd64_call_mem, arch_memory_req);
arch_copy_irn_out_info(call, pn_amd64_call_stack, callframe);
+ arch_set_irn_register_req_out(call, pn_amd64_call_X_regular, arch_exec_req);
+ arch_set_irn_register_req_out(call, pn_amd64_call_X_except, arch_exec_req);
arch_register_class_t const *const flags = &amd64_reg_classes[CLASS_amd64_flags];
arch_set_irn_register_req_out(call, pn_amd64_call_flags, flags->class_req);
@@ -2033,7 +2036,9 @@ static ir_node *gen_Proj_Call(ir_node *const node)
case pn_Call_M:
return be_new_Proj(new_call, pn_amd64_call_mem);
case pn_Call_X_regular:
+ return be_new_Proj(new_call, pn_amd64_call_X_regular);
case pn_Call_X_except:
+ return be_new_Proj(new_call, pn_amd64_call_X_except);
case pn_Call_T_result:
break;
}