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
cac1add2
Commit
cac1add2
authored
Oct 28, 2016
by
Christoph Mallon
Browse files
sparc: Factor out code to check for a 'restore'.
parent
5a6f1ada
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/sparc/sparc_emitter.c
View file @
cac1add2
...
...
@@ -340,6 +340,11 @@ static bool can_move_down_into_delayslot(const ir_node *node, const ir_node *to)
}
}
static
bool
is_restore
(
ir_node
const
*
const
node
)
{
return
is_sparc_Restore
(
node
)
||
is_sparc_RestoreZero
(
node
);
}
static
bool
can_move_up_into_delayslot
(
const
ir_node
*
node
,
const
ir_node
*
to
)
{
if
(
!
be_can_move_up
(
heights
,
node
,
to
))
...
...
@@ -354,7 +359,7 @@ static bool can_move_up_into_delayslot(const ir_node *node, const ir_node *to)
/* register window cycling effects at Restore aren't correctly represented
* in the graph yet so we need this exception here */
if
(
is_
sparc_Restore
(
node
)
||
is_sparc_RestoreZero
(
node
))
{
if
(
is_
restore
(
node
))
{
return
false
;
}
else
if
(
is_sparc_Call
(
to
))
{
/* node must not overwrite any of the inputs of the call,
...
...
@@ -495,8 +500,7 @@ static ir_node *pick_delay_slot_for(ir_node *node)
continue
;
/* restore doesn't model register window switching correctly,
* so it appears like we could move it, which is not true */
if
(
is_sparc_Restore
(
schedpoint
)
||
is_sparc_RestoreZero
(
schedpoint
))
if
(
is_restore
(
schedpoint
))
continue
;
if
(
tries
++
>=
PICK_DELAY_SLOT_MAX_DISTANCE
)
break
;
...
...
@@ -1042,8 +1046,7 @@ static void emit_sparc_Return(const ir_node *node)
/* hack: we don't explicitely model register changes because of the
* restore node. So we have to do it manually here */
const
ir_node
*
delay_slot
=
pmap_get
(
ir_node
,
delay_slots
,
node
);
if
(
delay_slot
!=
NULL
&&
(
is_sparc_Restore
(
delay_slot
)
||
is_sparc_RestoreZero
(
delay_slot
)))
{
if
(
delay_slot
&&
is_restore
(
delay_slot
))
{
destreg
=
"%i7"
;
}
char
const
*
const
offset
=
get_method_calling_convention
(
type
)
&
cc_compound_ret
?
"12"
:
"8"
;
...
...
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