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
fd6e5bdf
Commit
fd6e5bdf
authored
Aug 01, 2012
by
Christoph Mallon
Browse files
Factorise code to get the register projs of the SPARC start node.
parent
aadd375d
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/sparc/sparc_transform.c
View file @
fd6e5bdf
...
...
@@ -482,25 +482,26 @@ static ir_node *gen_helper_binopx(ir_node *node, match_flags_t match_flags,
}
static
ir_node
*
get_g
0
(
ir_graph
*
ir
g
)
static
ir_node
*
get_
re
g
(
ir_graph
*
const
irg
,
reg_info_t
*
const
re
g
)
{
if
(
start_g0
.
irn
==
NULL
)
{
if
(
!
reg
->
irn
)
{
/* this is already the transformed start node */
ir_node
*
const
start
=
get_irg_start
(
irg
);
assert
(
is_sparc_Start
(
start
));
start_g0
.
irn
=
new_r_Proj
(
start
,
mode_gp
,
start_g0
.
offset
);
arch_register_class_t
const
*
const
cls
=
arch_get_irn_register_req_out
(
start
,
reg
->
offset
)
->
cls
;
reg
->
irn
=
new_r_Proj
(
start
,
cls
?
cls
->
mode
:
mode_M
,
reg
->
offset
);
}
return
start_g0
.
irn
;
return
reg
->
irn
;
}
static
ir_node
*
get_g0
(
ir_graph
*
irg
)
{
return
get_reg
(
irg
,
&
start_g0
);
}
static
ir_node
*
get_g7
(
ir_graph
*
irg
)
{
if
(
start_g7
.
irn
==
NULL
)
{
ir_node
*
start
=
get_irg_start
(
irg
);
assert
(
is_sparc_Start
(
start
));
start_g7
.
irn
=
new_r_Proj
(
start
,
mode_gp
,
start_g7
.
offset
);
}
return
start_g7
.
irn
;
return
get_reg
(
irg
,
&
start_g7
);
}
static
ir_node
*
make_tls_offset
(
dbg_info
*
dbgi
,
ir_node
*
block
,
...
...
@@ -1604,29 +1605,17 @@ static ir_node *gen_Start(ir_node *node)
static
ir_node
*
get_initial_sp
(
ir_graph
*
irg
)
{
if
(
start_sp
.
irn
==
NULL
)
{
ir_node
*
start
=
get_irg_start
(
irg
);
start_sp
.
irn
=
new_r_Proj
(
start
,
mode_gp
,
start_sp
.
offset
);
}
return
start_sp
.
irn
;
return
get_reg
(
irg
,
&
start_sp
);
}
static
ir_node
*
get_initial_fp
(
ir_graph
*
irg
)
{
if
(
start_fp
.
irn
==
NULL
)
{
ir_node
*
start
=
get_irg_start
(
irg
);
start_fp
.
irn
=
new_r_Proj
(
start
,
mode_gp
,
start_fp
.
offset
);
}
return
start_fp
.
irn
;
return
get_reg
(
irg
,
&
start_fp
);
}
static
ir_node
*
get_initial_mem
(
ir_graph
*
irg
)
{
if
(
start_mem
.
irn
==
NULL
)
{
ir_node
*
start
=
get_irg_start
(
irg
);
start_mem
.
irn
=
new_r_Proj
(
start
,
mode_M
,
start_mem
.
offset
);
}
return
start_mem
.
irn
;
return
get_reg
(
irg
,
&
start_mem
);
}
static
ir_node
*
get_stack_pointer_for
(
ir_node
*
node
)
...
...
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