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
9df748c0
Commit
9df748c0
authored
Jul 02, 2009
by
Anthony Green
Committed by
Anthony Green
Jul 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak moxie prologue and epilogue code.
From-SVN: r149163
parent
b0f0c817
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
27 deletions
+46
-27
gcc/ChangeLog
+9
-0
gcc/config/moxie/moxie.c
+34
-24
gcc/config/moxie/moxie.md
+3
-3
No files found.
gcc/ChangeLog
View file @
9df748c0
2009-07-01 Anthony Green <green@moxielogic.com>
* config/moxie/moxie.c (moxie_expand_prologue): Use dec
instruction when possible.
(moxie_expand_prologue): Ditto. Also, save an instruction and
some complexity by popping off of $r12 instead of $sp.
* config/moxie/moxie.md (movsi_pop): Don't assume $sp. Take two
operands.
2009-07-01 Richard Henderson <rth@redhat.com>
PR bootstrap/40347
...
...
gcc/config/moxie/moxie.c
View file @
9df748c0
...
...
@@ -273,14 +273,25 @@ moxie_expand_prologue (void)
if
(
cfun
->
machine
->
size_for_adjusting_sp
>
0
)
{
insn
=
emit_insn
(
gen_movsi
(
gen_rtx_REG
(
Pmode
,
MOXIE_R12
),
GEN_INT
(
-
cfun
->
machine
->
size_for_adjusting_sp
)));
RTX_FRAME_RELATED_P
(
insn
)
=
1
;
insn
=
emit_insn
(
gen_addsi3
(
stack_pointer_rtx
,
stack_pointer_rtx
,
gen_rtx_REG
(
Pmode
,
MOXIE_R12
)));
RTX_FRAME_RELATED_P
(
insn
)
=
1
;
if
(
cfun
->
machine
->
size_for_adjusting_sp
<=
255
)
{
insn
=
emit_insn
(
gen_subsi3
(
stack_pointer_rtx
,
stack_pointer_rtx
,
GEN_INT
(
cfun
->
machine
->
size_for_adjusting_sp
)));
RTX_FRAME_RELATED_P
(
insn
)
=
1
;
}
else
{
insn
=
emit_insn
(
gen_movsi
(
gen_rtx_REG
(
Pmode
,
MOXIE_R12
),
GEN_INT
(
-
cfun
->
machine
->
size_for_adjusting_sp
)));
RTX_FRAME_RELATED_P
(
insn
)
=
1
;
insn
=
emit_insn
(
gen_addsi3
(
stack_pointer_rtx
,
stack_pointer_rtx
,
gen_rtx_REG
(
Pmode
,
MOXIE_R12
)));
RTX_FRAME_RELATED_P
(
insn
)
=
1
;
}
}
}
...
...
@@ -293,26 +304,25 @@ moxie_expand_epilogue (void)
if
(
cfun
->
machine
->
callee_saved_reg_size
!=
0
)
{
reg
=
gen_rtx_REG
(
Pmode
,
MOXIE_R12
);
emit_move_insn
(
reg
,
GEN_INT
(
-
cfun
->
machine
->
callee_saved_reg_size
));
emit_insn
(
gen_addsi3
(
reg
,
reg
,
hard_frame_pointer_rtx
));
insn
=
emit_move_insn
(
stack_pointer_rtx
,
reg
);
RTX_FRAME_RELATED_P
(
insn
)
=
1
;
add_reg_note
(
insn
,
REG_CFA_DEF_CFA
,
plus_constant
(
stack_pointer_rtx
,
cfun
->
machine
->
callee_saved_reg_size
));
if
(
cfun
->
machine
->
callee_saved_reg_size
<=
255
)
{
emit_move_insn
(
reg
,
hard_frame_pointer_rtx
);
emit_insn
(
gen_subsi3
(
reg
,
reg
,
GEN_INT
(
cfun
->
machine
->
callee_saved_reg_size
)));
}
else
{
emit_move_insn
(
reg
,
GEN_INT
(
-
cfun
->
machine
->
callee_saved_reg_size
));
emit_insn
(
gen_addsi3
(
reg
,
reg
,
hard_frame_pointer_rtx
));
}
for
(
regno
=
FIRST_PSEUDO_REGISTER
;
regno
--
>
0
;
)
if
(
!
fixed_regs
[
regno
]
&&
!
call_used_regs
[
regno
]
&&
df_regs_ever_live_p
(
regno
))
{
reg
=
gen_rtx_REG
(
Pmode
,
regno
);
insn
=
emit_insn
(
gen_movsi_pop
(
reg
));
RTX_FRAME_RELATED_P
(
insn
)
=
1
;
add_reg_note
(
insn
,
REG_CFA_ADJUST_CFA
,
gen_rtx_SET
(
VOIDmode
,
stack_pointer_rtx
,
plus_constant
(
stack_pointer_rtx
,
UNITS_PER_WORD
)));
add_reg_note
(
insn
,
REG_CFA_RESTORE
,
reg
);
rtx
preg
=
gen_rtx_REG
(
Pmode
,
regno
);
insn
=
emit_insn
(
gen_movsi_pop
(
reg
,
preg
));
}
}
...
...
gcc/config/moxie/moxie.md
View file @
9df748c0
...
...
@@ -195,10 +195,10 @@
;; Pop a register from the stack
(define_insn "movsi_pop"
[
(set:SI (match_operand:SI
0
"register_operand" "=r")
(mem:SI (post_inc:SI (
reg:SI 1
))))]
[
(set:SI (match_operand:SI
1
"register_operand" "=r")
(mem:SI (post_inc:SI (
match_operand:SI 0 "register_operand" "r"
))))]
""
"pop
$sp, %0
")
"pop
%0, %1
")
(define_expand "movsi"
[
(set (match_operand:SI 0 "general_operand" "")
...
...
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