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
79fc960b
Commit
79fc960b
authored
Mar 18, 2006
by
Michael Beck
Browse files
Handle Cmp(And(x,y) != 0) ==> Test(x,y)
parent
a572558d
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_transform.c
View file @
79fc960b
...
...
@@ -1275,9 +1275,25 @@ static ir_node *gen_Cond(ia32_transform_env_t *env) {
if
(
mode_is_int
(
get_irn_mode
(
expr
)))
{
if
(
classify_tarval
(
get_ia32_Immop_tarval
(
cnst
))
==
TV_CLASSIFY_NULL
)
{
/* a Cmp A, 0 */
res
=
new_rd_ia32_TestJmp
(
dbg
,
irg
,
block
,
expr
,
expr
,
mode_T
);
ir_node
*
op1
=
expr
;
ir_node
*
op2
=
expr
;
ir_node
*
and
=
skip_Proj
(
expr
);
char
*
cnst
=
NULL
;
/* check, if expr is an only once used And operation */
if
(
get_irn_n_edges
(
expr
)
==
1
&&
is_ia32_And
(
and
))
{
op1
=
get_irn_n
(
and
,
2
);
op2
=
get_irn_n
(
and
,
3
);
cnst
=
get_ia32_cnst
(
and
);
}
res
=
new_rd_ia32_TestJmp
(
dbg
,
irg
,
block
,
op1
,
op2
,
mode_T
);
set_ia32_pncode
(
res
,
get_Proj_proj
(
sel
));
if
(
cnst
)
{
copy_ia32_Immop_attr
(
res
,
and
);
}
SET_IA32_ORIG_NODE
(
res
,
get_old_node_name
(
env
));
return
res
;
}
...
...
Write
Preview
Markdown
is supported
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