summaryrefslogtreecommitdiffhomepage
path: root/ir/be/betranshlp.c
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-27 21:52:04 +0200
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-28 10:36:31 +0200
commit9a6b8525e9916f0b0448468defd150413814ecfe (patch)
tree8560176b7b598b84c47f88efd0f6dbaff2cb5679 /ir/be/betranshlp.c
parent6a3abbe420b99019efd3e8a51bfce4e3cf713d5b (diff)
be: Add and use be_new_Proj().
It is like new_r_Proj(), but the mode is determined automatically from the out requirement of the predecessor. This probably resolves some mode mismatches in untested code paths -- AMD64 backend and SPARC hard float, I'm looking at you!
Diffstat (limited to 'ir/be/betranshlp.c')
-rw-r--r--ir/be/betranshlp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ir/be/betranshlp.c b/ir/be/betranshlp.c
index 1cc1859..23ef733 100644
--- a/ir/be/betranshlp.c
+++ b/ir/be/betranshlp.c
@@ -143,6 +143,17 @@ static ir_node *transform_proj(ir_node *node)
return proj_transform(node);
}
+static ir_node *transform_Proj_ASM(ir_node *const node)
+{
+ ir_node *const pred = get_Proj_pred(node);
+ ir_node *const new_pred = be_transform_node(pred);
+ ir_mode *const mode = get_irn_mode(node);
+ unsigned const num = mode == mode_M ?
+ arch_get_irn_n_outs(new_pred) - 1 :
+ get_Proj_num(node);
+ return be_new_Proj(new_pred, num);
+}
+
ir_node *be_duplicate_node(ir_node *const node)
{
int const arity = get_irn_arity(node);
@@ -425,6 +436,8 @@ void be_start_transform_setup(void)
be_set_transform_function(op_Proj, transform_proj);
be_set_transform_function(op_Sync, be_duplicate_node);
+ be_set_transform_proj_function(op_ASM, transform_Proj_ASM);
+
be_set_upper_bits_clean_function(op_And, and_upper_bits_clean);
be_set_upper_bits_clean_function(op_Const, const_upper_bits_clean);
be_set_upper_bits_clean_function(op_Conv, conv_upper_bits_clean);