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
e6a5a50a
Commit
e6a5a50a
authored
Aug 19, 2011
by
yb9976
Browse files
Bugfix: Added special case for x mod 1.
parent
88f356d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/irarch.c
View file @
e6a5a50a
...
...
@@ -1051,7 +1051,13 @@ ir_node *arch_dep_replace_mod_by_const(ir_node *irn)
k
=
tv_ld2
(
tv
,
n
);
}
if
(
k
>=
0
)
{
/* k == 0 i.e. modulo by 1 */
if
(
k
==
0
)
{
ir_graph
*
irg
=
get_irn_irg
(
irn
);
res
=
new_r_Const
(
irg
,
get_mode_null
(
mode
));
}
else
if
(
k
>
0
)
{
ir_graph
*
irg
=
get_irn_irg
(
irn
);
/* division by 2^k or -2^k:
* we use "modulus" here, so x % y == x % -y that's why is no difference between the case 2^k and -2^k
...
...
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