summaryrefslogtreecommitdiffhomepage
path: root/ir/be/betranshlp.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-09-18 17:02:53 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2016-09-18 22:49:58 +0200
commit9efd8c48a59864ceccaf96587f5992080111cbf3 (patch)
tree7a03f0db08adce723ae3fb1a4f63c2e2eefeb42a /ir/be/betranshlp.c
parenta4c2839c9c204f3784a753b74cb1d6141a7f5b43 (diff)
be: Add and use 'be_mode_needs_gp_reg()'.
Diffstat (limited to 'ir/be/betranshlp.c')
-rw-r--r--ir/be/betranshlp.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/ir/be/betranshlp.c b/ir/be/betranshlp.c
index be2b686..1b951da 100644
--- a/ir/be/betranshlp.c
+++ b/ir/be/betranshlp.c
@@ -821,14 +821,9 @@ uint32_t be_get_tv_bits32(ir_tarval *const tv, unsigned const offset)
return val;
}
-static bool mode_needs_gp_reg(ir_mode *const mode)
-{
- return get_mode_arithmetic(mode) == irma_twos_complement;
-}
-
ir_node *be_skip_downconv(ir_node *node, bool const single_user)
{
- assert(mode_needs_gp_reg(get_irn_mode(node)));
+ assert(be_mode_needs_gp_reg(get_irn_mode(node)));
for (;;) {
if (single_user && get_irn_n_edges(node) > 1) {
/* we only want to skip the conv when we're the only user
@@ -838,7 +833,7 @@ ir_node *be_skip_downconv(ir_node *node, bool const single_user)
} else if (is_Conv(node)) {
ir_node *const op = get_Conv_op(node);
ir_mode *const src_mode = get_irn_mode(op);
- if (!mode_needs_gp_reg(src_mode) || get_mode_size_bits(get_irn_mode(node)) > get_mode_size_bits(src_mode))
+ if (!be_mode_needs_gp_reg(src_mode) || get_mode_size_bits(get_irn_mode(node)) > get_mode_size_bits(src_mode))
break;
node = op;
} else {
@@ -850,7 +845,7 @@ ir_node *be_skip_downconv(ir_node *node, bool const single_user)
ir_node *be_skip_sameconv(ir_node *node)
{
- assert(mode_needs_gp_reg(get_irn_mode(node)));
+ assert(be_mode_needs_gp_reg(get_irn_mode(node)));
for (;;) {
if (get_irn_n_edges(node) > 1) {
/* we only want to skip the conv when we're the only user
@@ -860,7 +855,7 @@ ir_node *be_skip_sameconv(ir_node *node)
} else if (is_Conv(node)) {
ir_node *const op = get_Conv_op(node);
ir_mode *const src_mode = get_irn_mode(op);
- if (!mode_needs_gp_reg(src_mode) || get_mode_size_bits(get_irn_mode(node)) != get_mode_size_bits(src_mode))
+ if (!be_mode_needs_gp_reg(src_mode) || get_mode_size_bits(get_irn_mode(node)) != get_mode_size_bits(src_mode))
break;
node = op;
} else {