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
c9dbaff0
Commit
c9dbaff0
authored
Oct 05, 2014
by
Christoph Mallon
Browse files
lower: Simplify and comment is_equality_cmp().
parent
53c149a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/lower/lower_dw.c
View file @
c9dbaff0
...
...
@@ -1078,9 +1078,8 @@ static void lower_Proj(ir_node *node, ir_mode *op_mode)
static
bool
is_equality_cmp
(
const
ir_node
*
node
)
{
ir_relation
relation
=
get_Cmp_relation
(
node
);
ir_node
*
left
=
get_Cmp_left
(
node
);
ir_node
*
right
=
get_Cmp_right
(
node
);
ir_mode
*
mode
=
get_irn_mode
(
lef
t
);
ir_mode
*
mode
=
get_irn_mode
(
righ
t
);
/* this probably makes no sense if unordered is involved */
assert
(
!
mode_is_float
(
mode
));
...
...
@@ -1088,13 +1087,11 @@ static bool is_equality_cmp(const ir_node *node)
if
(
relation
==
ir_relation_equal
||
relation
==
ir_relation_less_greater
)
return
true
;
if
(
!
is_Const
(
right
)
||
!
is_Const_null
(
right
))
return
false
;
if
(
mode_is_signed
(
mode
))
{
return
relation
==
ir_relation_less_greater
;
}
else
{
/* Unsigned x > 0 behaves like !=. */
if
(
is_Const
(
right
)
&&
is_Const_null
(
right
)
&&
!
mode_is_signed
(
mode
))
return
relation
==
ir_relation_greater
;
}
return
false
;
}
static
ir_node
*
get_cfop_destination
(
const
ir_node
*
cfop
)
...
...
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