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
bf4c1752
Commit
bf4c1752
authored
Nov 14, 2012
by
Christoph Mallon
Browse files
x87: Simplify the case when both operands are dead in sim_binop().
parent
f4e3942b
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_x87.c
View file @
bf4c1752
...
...
@@ -802,39 +802,16 @@ static int sim_binop(x87_state *const state, ir_node *const n, ir_op *const op)
/* now do fxxxr (tos = op X tos) */
out_idx
=
0
;
}
else
{
/* Both operands are dead here, pop them from the stack. */
if
(
op2_idx
==
0
)
{
if
(
op1_idx
==
0
)
{
/* Both are identically and on tos, no pop needed. */
/* here fxxx (tos = tos X tos) */
out_idx
=
0
;
}
else
{
/* now do fxxxp (op = op X tos, pop) */
out_idx
=
op1_idx
;
pop
=
true
;
}
}
else
if
(
op1_idx
==
0
)
{
assert
(
op1_idx
!=
op2_idx
);
/* now do fxxxrp (op = tos X op, pop) */
out_idx
=
op2_idx
;
pop
=
true
;
}
else
{
/* Bring the second on top. */
x87_create_fxch
(
state
,
n
,
op2_idx
);
if
(
op1_idx
==
op2_idx
)
{
/* Both are identically and on tos now, no pop needed. */
op1_idx
=
0
;
op2_idx
=
0
;
/* use fxxx (tos = tos X tos) */
out_idx
=
0
;
}
else
{
/* op2 is on tos now */
op2_idx
=
0
;
/* use fxxxp (op = op X tos, pop) */
out_idx
=
op1_idx
;
pop
=
true
;
}
/* Both operands are dead. */
if
(
op1_idx
!=
0
&&
op2_idx
!=
0
)
{
/* Bring one operand to tos. */
x87_create_fxch
(
state
,
n
,
op1_idx
);
if
(
op2_idx
==
op1_idx
)
op2_idx
=
0
;
op1_idx
=
0
;
}
out_idx
=
op1_idx
!=
0
?
op1_idx
:
op2_idx
;
/* Only pop if the operands are differnt. */
pop
=
op1_idx
!=
op2_idx
;
}
}
}
else
{
...
...
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