Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
3bd0255f
Commit
3bd0255f
authored
Jun 07, 2016
by
Christoph Mallon
Browse files
When making a 'Mulh', automatically infer its mode from its left operand.
parent
550c63db
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/ir/irarch.c
View file @
3bd0255f
...
...
@@ -832,7 +832,7 @@ static ir_node *replace_div_by_mulh(ir_node *div, ir_tarval *tv)
/* generate the Mulh instruction */
ir_node
*
c
=
new_r_Const
(
irg
,
mag
.
M
);
ir_node
*
q
=
new_rd_Mulh
(
dbg
,
block
,
n
,
c
,
mode
);
ir_node
*
q
=
new_rd_Mulh
(
dbg
,
block
,
n
,
c
);
/* do we need an Add or Sub */
if
(
mag
.
need_add
)
...
...
@@ -871,7 +871,7 @@ static ir_node *replace_div_by_mulh(ir_node *div, ir_tarval *tv)
/* generate the Mulh instruction */
ir_node
*
c
=
new_r_Const
(
irg
,
mafo
.
multiplier
);
ir_node
*
q
=
new_rd_Mulh
(
dbg
,
block
,
n
,
c
,
mode
);
ir_node
*
q
=
new_rd_Mulh
(
dbg
,
block
,
n
,
c
);
c
=
new_r_Const_long
(
irg
,
mode_Iu
,
get_mode_size_bits
(
get_tarval_mode
(
tv
)));
res
=
new_rd_Shr
(
dbg
,
block
,
q
,
c
,
mode
);
if
(
mafo
.
post_shift
>
0
)
{
...
...
scripts/ir_spec.py
View file @
3bd0255f
...
...
@@ -596,6 +596,7 @@ class Mul(Binop):
class
Mulh
(
Binop
):
"""returns the upper word of the product of its operands (the part which
would not fit into the result mode of a normal Mul anymore)"""
mode
=
"get_irn_mode(irn_left)"
flags
=
[
"commutative"
]
@
op
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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