Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
1c960e02
Commit
1c960e02
authored
Jun 05, 2014
by
Marcus Shawcroft
Committed by
Marcus Shawcroft
Jun 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AArch64] Add frame_size and hard_fp_offset to machine.frame
From-SVN: r211275
parent
95cc0a1a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
53 deletions
+59
-53
gcc/ChangeLog
+12
-0
gcc/config/aarch64/aarch64.c
+36
-53
gcc/config/aarch64/aarch64.h
+11
-0
No files found.
gcc/ChangeLog
View file @
1c960e02
...
@@ -4,6 +4,18 @@
...
@@ -4,6 +4,18 @@
before accessing it.
before accessing it.
2014-06-05 Marcus Shawcroft <marcus.shawcroft@arm.com>
2014-06-05 Marcus Shawcroft <marcus.shawcroft@arm.com>
* config/aarch64/aarch64.h (aarch64_frame): Add hard_fp_offset and
frame_size.
* config/aarch64/aarch64.c (aarch64_layout_frame): Initialize
aarch64_frame hard_fp_offset and frame_size.
(aarch64_expand_prologue): Use aarch64_frame hard_fp_offset and
frame_size; remove original_frame_size.
(aarch64_expand_epilogue, aarch64_final_eh_return_addr): Likewise.
(aarch64_initial_elimination_offset): Remove frame_size and
offset. Use aarch64_frame frame_size.
2014-06-05 Marcus Shawcroft <marcus.shawcroft@arm.com>
Jiong Wang <jiong.wang@arm.com>
Jiong Wang <jiong.wang@arm.com>
* config/aarch64/aarch64.c (aarch64_layout_frame): Correct
* config/aarch64/aarch64.c (aarch64_layout_frame): Correct
...
...
gcc/config/aarch64/aarch64.c
View file @
1c960e02
...
@@ -1868,6 +1868,18 @@ aarch64_layout_frame (void)
...
@@ -1868,6 +1868,18 @@ aarch64_layout_frame (void)
offset
=
AARCH64_ROUND_UP
(
offset
,
STACK_BOUNDARY
/
BITS_PER_UNIT
);
offset
=
AARCH64_ROUND_UP
(
offset
,
STACK_BOUNDARY
/
BITS_PER_UNIT
);
cfun
->
machine
->
frame
.
saved_regs_size
=
offset
;
cfun
->
machine
->
frame
.
saved_regs_size
=
offset
;
cfun
->
machine
->
frame
.
hard_fp_offset
=
AARCH64_ROUND_UP
(
cfun
->
machine
->
frame
.
saved_varargs_size
+
get_frame_size
()
+
cfun
->
machine
->
frame
.
saved_regs_size
,
STACK_BOUNDARY
/
BITS_PER_UNIT
);
cfun
->
machine
->
frame
.
frame_size
=
AARCH64_ROUND_UP
(
cfun
->
machine
->
frame
.
hard_fp_offset
+
crtl
->
outgoing_args_size
,
STACK_BOUNDARY
/
BITS_PER_UNIT
);
cfun
->
machine
->
frame
.
laid_out
=
true
;
cfun
->
machine
->
frame
.
laid_out
=
true
;
}
}
...
@@ -2118,26 +2130,20 @@ aarch64_expand_prologue (void)
...
@@ -2118,26 +2130,20 @@ aarch64_expand_prologue (void)
sub sp, sp, <final_adjustment_if_any>
sub sp, sp, <final_adjustment_if_any>
*/
*/
HOST_WIDE_INT
original_frame_size
;
/* local variables + vararg save */
HOST_WIDE_INT
frame_size
,
offset
;
HOST_WIDE_INT
frame_size
,
offset
;
HOST_WIDE_INT
fp_offset
;
/*
FP offset from SP
*/
HOST_WIDE_INT
fp_offset
;
/*
Offset from hard FP to SP.
*/
rtx
insn
;
rtx
insn
;
aarch64_layout_frame
();
aarch64_layout_frame
();
original_frame_size
=
get_frame_size
()
+
cfun
->
machine
->
frame
.
saved_varargs_size
;
gcc_assert
((
!
cfun
->
machine
->
frame
.
saved_varargs_size
||
cfun
->
stdarg
)
&&
(
cfun
->
stdarg
||
!
cfun
->
machine
->
frame
.
saved_varargs_size
));
frame_size
=
(
original_frame_size
+
cfun
->
machine
->
frame
.
saved_regs_size
+
crtl
->
outgoing_args_size
);
offset
=
frame_size
=
AARCH64_ROUND_UP
(
frame_size
,
STACK_BOUNDARY
/
BITS_PER_UNIT
);
if
(
flag_stack_usage_info
)
if
(
flag_stack_usage_info
)
current_function_static_stack_size
=
frame_size
;
current_function_static_stack_size
=
cfun
->
machine
->
frame
.
frame_size
;
frame_size
=
cfun
->
machine
->
frame
.
frame_size
;
offset
=
cfun
->
machine
->
frame
.
frame_size
;
fp_offset
=
(
offset
fp_offset
=
cfun
->
machine
->
frame
.
frame_size
-
original_frame_size
-
cfun
->
machine
->
frame
.
hard_fp_offset
;
-
cfun
->
machine
->
frame
.
saved_regs_size
);
/* Store pairs and load pairs have a range only -512 to 504. */
/* Store pairs and load pairs have a range only -512 to 504. */
if
(
offset
>=
512
)
if
(
offset
>=
512
)
...
@@ -2148,7 +2154,7 @@ aarch64_expand_prologue (void)
...
@@ -2148,7 +2154,7 @@ aarch64_expand_prologue (void)
register area. This will allow the pre-index write-back
register area. This will allow the pre-index write-back
store pair instructions to be used for setting up the stack frame
store pair instructions to be used for setting up the stack frame
efficiently. */
efficiently. */
offset
=
original_frame_size
+
cfun
->
machine
->
frame
.
saved_regs_size
;
offset
=
cfun
->
machine
->
frame
.
hard_fp_offset
;
if
(
offset
>=
512
)
if
(
offset
>=
512
)
offset
=
cfun
->
machine
->
frame
.
saved_regs_size
;
offset
=
cfun
->
machine
->
frame
.
saved_regs_size
;
...
@@ -2284,28 +2290,23 @@ aarch64_expand_prologue (void)
...
@@ -2284,28 +2290,23 @@ aarch64_expand_prologue (void)
void
void
aarch64_expand_epilogue
(
bool
for_sibcall
)
aarch64_expand_epilogue
(
bool
for_sibcall
)
{
{
HOST_WIDE_INT
original_frame_size
,
frame_size
,
offset
;
HOST_WIDE_INT
frame_size
,
offset
;
HOST_WIDE_INT
fp_offset
;
HOST_WIDE_INT
fp_offset
;
rtx
insn
;
rtx
insn
;
rtx
cfa_reg
;
rtx
cfa_reg
;
aarch64_layout_frame
();
aarch64_layout_frame
();
original_frame_size
=
get_frame_size
()
+
cfun
->
machine
->
frame
.
saved_varargs_size
;
frame_size
=
(
original_frame_size
+
cfun
->
machine
->
frame
.
saved_regs_size
+
crtl
->
outgoing_args_size
);
offset
=
frame_size
=
AARCH64_ROUND_UP
(
frame_size
,
STACK_BOUNDARY
/
BITS_PER_UNIT
);
fp_offset
=
(
offset
offset
=
frame_size
=
cfun
->
machine
->
frame
.
frame_size
;
-
original_
frame_size
fp_offset
=
cfun
->
machine
->
frame
.
frame_size
-
cfun
->
machine
->
frame
.
saved_regs_size
)
;
-
cfun
->
machine
->
frame
.
hard_fp_offset
;
cfa_reg
=
frame_pointer_needed
?
hard_frame_pointer_rtx
:
stack_pointer_rtx
;
cfa_reg
=
frame_pointer_needed
?
hard_frame_pointer_rtx
:
stack_pointer_rtx
;
/* Store pairs and load pairs have a range only -512 to 504. */
/* Store pairs and load pairs have a range only -512 to 504. */
if
(
offset
>=
512
)
if
(
offset
>=
512
)
{
{
offset
=
original_frame_size
+
cfun
->
machine
->
frame
.
saved_regs_size
;
offset
=
cfun
->
machine
->
frame
.
hard_fp_offset
;
if
(
offset
>=
512
)
if
(
offset
>=
512
)
offset
=
cfun
->
machine
->
frame
.
saved_regs_size
;
offset
=
cfun
->
machine
->
frame
.
saved_regs_size
;
...
@@ -2487,16 +2488,12 @@ aarch64_expand_epilogue (bool for_sibcall)
...
@@ -2487,16 +2488,12 @@ aarch64_expand_epilogue (bool for_sibcall)
rtx
rtx
aarch64_final_eh_return_addr
(
void
)
aarch64_final_eh_return_addr
(
void
)
{
{
HOST_WIDE_INT
original_frame_size
,
frame_size
,
offset
,
fp_offset
;
HOST_WIDE_INT
fp_offset
;
aarch64_layout_frame
();
aarch64_layout_frame
();
original_frame_size
=
get_frame_size
()
+
cfun
->
machine
->
frame
.
saved_varargs_size
;
frame_size
=
(
original_frame_size
+
cfun
->
machine
->
frame
.
saved_regs_size
fp_offset
=
cfun
->
machine
->
frame
.
frame_size
+
crtl
->
outgoing_args_size
);
-
cfun
->
machine
->
frame
.
hard_fp_offset
;
offset
=
frame_size
=
AARCH64_ROUND_UP
(
frame_size
,
STACK_BOUNDARY
/
BITS_PER_UNIT
);
fp_offset
=
offset
-
original_frame_size
-
cfun
->
machine
->
frame
.
saved_regs_size
;
if
(
cfun
->
machine
->
frame
.
reg_offset
[
LR_REGNUM
]
<
0
)
if
(
cfun
->
machine
->
frame
.
reg_offset
[
LR_REGNUM
]
<
0
)
return
gen_rtx_REG
(
DImode
,
LR_REGNUM
);
return
gen_rtx_REG
(
DImode
,
LR_REGNUM
);
...
@@ -4246,42 +4243,28 @@ aarch64_can_eliminate (const int from, const int to)
...
@@ -4246,42 +4243,28 @@ aarch64_can_eliminate (const int from, const int to)
HOST_WIDE_INT
HOST_WIDE_INT
aarch64_initial_elimination_offset
(
unsigned
from
,
unsigned
to
)
aarch64_initial_elimination_offset
(
unsigned
from
,
unsigned
to
)
{
{
HOST_WIDE_INT
frame_size
;
HOST_WIDE_INT
offset
;
aarch64_layout_frame
();
aarch64_layout_frame
();
frame_size
=
(
get_frame_size
()
+
cfun
->
machine
->
frame
.
saved_regs_size
+
crtl
->
outgoing_args_size
+
cfun
->
machine
->
frame
.
saved_varargs_size
);
frame_size
=
AARCH64_ROUND_UP
(
frame_size
,
STACK_BOUNDARY
/
BITS_PER_UNIT
);
offset
=
frame_size
;
if
(
to
==
HARD_FRAME_POINTER_REGNUM
)
if
(
to
==
HARD_FRAME_POINTER_REGNUM
)
{
{
if
(
from
==
ARG_POINTER_REGNUM
)
if
(
from
==
ARG_POINTER_REGNUM
)
return
offset
-
crtl
->
outgoing_args_size
;
return
cfun
->
machine
->
frame
.
frame_size
-
crtl
->
outgoing_args_size
;
if
(
from
==
FRAME_POINTER_REGNUM
)
if
(
from
==
FRAME_POINTER_REGNUM
)
return
cfun
->
machine
->
frame
.
saved_regs_size
+
get_frame_size
();
return
(
cfun
->
machine
->
frame
.
hard_fp_offset
-
cfun
->
machine
->
frame
.
saved_varargs_size
);
}
}
if
(
to
==
STACK_POINTER_REGNUM
)
if
(
to
==
STACK_POINTER_REGNUM
)
{
{
if
(
from
==
FRAME_POINTER_REGNUM
)
if
(
from
==
FRAME_POINTER_REGNUM
)
{
return
(
cfun
->
machine
->
frame
.
frame_size
HOST_WIDE_INT
elim
=
crtl
->
outgoing_args_size
-
cfun
->
machine
->
frame
.
saved_varargs_size
);
+
cfun
->
machine
->
frame
.
saved_regs_size
+
get_frame_size
();
elim
=
AARCH64_ROUND_UP
(
elim
,
STACK_BOUNDARY
/
BITS_PER_UNIT
);
return
elim
;
}
}
}
return
offset
;
return
cfun
->
machine
->
frame
.
frame_size
;
}
}
/* Implement RETURN_ADDR_RTX. We do not support moving back to a
/* Implement RETURN_ADDR_RTX. We do not support moving back to a
previous frame. */
previous frame. */
...
...
gcc/config/aarch64/aarch64.h
View file @
1c960e02
...
@@ -527,6 +527,17 @@ struct GTY (()) aarch64_frame
...
@@ -527,6 +527,17 @@ struct GTY (()) aarch64_frame
HOST_WIDE_INT
padding0
;
HOST_WIDE_INT
padding0
;
HOST_WIDE_INT
hardfp_offset
;
/* HARD_FRAME_POINTER_REGNUM */
HOST_WIDE_INT
hardfp_offset
;
/* HARD_FRAME_POINTER_REGNUM */
/* Offset from the base of the frame (incomming SP) to the
hard_frame_pointer. This value is always a multiple of
STACK_BOUNDARY. */
HOST_WIDE_INT
hard_fp_offset
;
/* The size of the frame. This value is the offset from base of the
* frame (incomming SP) to the stack_pointer. This value is always
* a multiple of STACK_BOUNDARY. */
HOST_WIDE_INT
frame_size
;
bool
laid_out
;
bool
laid_out
;
};
};
...
...
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