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
52a59fbe
Commit
52a59fbe
authored
Oct 14, 2011
by
Matthias Braun
Browse files
sparc: use AddCC, SubCC, MulCC
parent
52e0c37f
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/be/sparc/sparc_spec.pl
View file @
52a59fbe
...
...
@@ -269,12 +269,19 @@ Add => {
},
AddCC
=>
{
irn_flags
=>
[
"
rematerializable
"
],
irn_flags
=>
[
"
rematerializable
"
,
"
modifies_flags
"
],
emit
=>
'
. addcc %S0, %R1I, %D0
',
outs
=>
[
"
res
",
"
flags
"
],
constructors
=>
\
%binopcc_operand_constructors
,
},
AddCCZero
=>
{
irn_flags
=>
[
"
rematerializable
",
"
modifies_flags
"
],
emit
=>
'
. addcc %S0, %R1I, %%g0
',
mode
=>
$mode_flags
,
constructors
=>
\
%binopcczero_operand_constructors
,
},
AddX
=>
{
# At the moment not rematerializable because of assert in beflags.c/
# (it claims that spiller can't rematerialize flag stuff correctly)
...
...
@@ -305,12 +312,19 @@ Sub => {
},
SubCC
=>
{
irn_flags
=>
[
"
rematerializable
"
],
irn_flags
=>
[
"
rematerializable
"
,
"
modifies_flags
"
],
emit
=>
'
. subcc %S0, %R1I, %D0
',
outs
=>
[
"
res
",
"
flags
"
],
constructors
=>
\
%binopcc_operand_constructors
,
},
SubCCZero
=>
{
irn_flags
=>
[
"
rematerializable
",
"
modifies_flags
"
],
emit
=>
'
. subcc %S0, %R1I, %%g0
',
mode
=>
$mode_flags
,
constructors
=>
\
%binopcczero_operand_constructors
,
},
SubX
=>
{
# Not rematerializable (see AddX)
emit
=>
'
. subx %S0, %R1I, %D0
',
...
...
@@ -677,6 +691,13 @@ Mul => {
constructors
=>
\
%binop_operand_constructors
,
},
MulCCZero
=>
{
irn_flags
=>
[
"
rematerializable
",
"
modifies_flags
"
],
emit
=>
'
. smulcc %S0, %R1I, %%g0
',
mode
=>
$mode_flags
,
constructors
=>
\
%binopcczero_operand_constructors
,
},
SMulh
=>
{
irn_flags
=>
[
"
rematerializable
"
],
outs
=>
[
"
low
",
"
high
"
],
...
...
ir/be/sparc/sparc_transform.c
View file @
52a59fbe
...
...
@@ -1287,6 +1287,18 @@ static ir_node *gen_Cmp(ir_node *node)
new_bd_sparc_XNorCCZero_reg
,
new_bd_sparc_XNorCCZero_imm
,
MATCH_NONE
);
}
else
if
(
is_Add
(
op1
))
{
return
gen_helper_binop
(
op1
,
MATCH_COMMUTATIVE
,
new_bd_sparc_AddCCZero_reg
,
new_bd_sparc_AddCCZero_imm
);
}
else
if
(
is_Sub
(
op1
))
{
return
gen_helper_binop
(
op1
,
MATCH_NONE
,
new_bd_sparc_SubCCZero_reg
,
new_bd_sparc_SubCCZero_imm
);
}
else
if
(
is_Mul
(
op1
))
{
return
gen_helper_binop
(
op1
,
MATCH_COMMUTATIVE
,
new_bd_sparc_MulCCZero_reg
,
new_bd_sparc_MulCCZero_imm
);
}
}
...
...
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