Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
94df3d3b
Commit
94df3d3b
authored
Oct 11, 2016
by
Christoph Mallon
Browse files
arm: Just use be_upper_bits_clean().
This avoids code duplication and actually works correctly. This fixes opt/convs.c.
parent
6246b553
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/arm/arm_transform.c
View file @
94df3d3b
...
...
@@ -209,24 +209,6 @@ static ir_node *gen_extension(dbg_info *dbgi, ir_node *block, ir_node *op,
}
}
/**
* returns true if it is assured, that the upper bits of a node are "clean"
* which means for a 16 or 8 bit value, that the upper bits in the register
* are 0 for unsigned and a copy of the last significant bit for signed
* numbers.
*/
static
bool
upper_bits_clean
(
ir_node
*
transformed_node
,
ir_mode
*
mode
)
{
if
(
is_Proj
(
transformed_node
)
&&
get_Proj_num
(
transformed_node
)
==
pn_arm_Ldr_res
)
{
ir_node
*
const
ldr
=
get_Proj_pred
(
transformed_node
);
if
(
is_arm_Ldr
(
ldr
))
{
arm_load_store_attr_t
const
*
const
attr
=
get_arm_load_store_attr_const
(
ldr
);
return
get_mode_size_bits
(
attr
->
load_store_mode
)
<=
get_mode_size_bits
(
mode
);
}
}
return
false
;
}
/**
* Transforms a Conv node.
*
...
...
@@ -283,9 +265,8 @@ static ir_node *gen_Conv(ir_node *node)
min_mode
=
dst_mode
;
}
if
(
upper_bits_clean
(
new_
op
,
min_mode
))
{
if
(
be_
upper_bits_clean
(
op
,
min_mode
))
return
new_op
;
}
if
(
mode_is_signed
(
min_mode
))
{
return
gen_sign_extension
(
dbg
,
block
,
new_op
,
min_bits
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment