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
4e97601f
Commit
4e97601f
authored
Nov 08, 1996
by
Stan Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(compare_for_stack_reg, subst_stack_regs_pat):
From-SVN: r13113
parent
7a976aea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
gcc/reg-stack.c
+66
-0
No files found.
gcc/reg-stack.c
View file @
4e97601f
...
...
@@ -2017,9 +2017,26 @@ compare_for_stack_reg (insn, regstack, pat)
{
rtx
*
src1
,
*
src2
;
rtx
src1_note
,
src2_note
;
rtx
cc0_user
;
src1
=
get_true_reg
(
&
XEXP
(
SET_SRC
(
pat
),
0
));
src2
=
get_true_reg
(
&
XEXP
(
SET_SRC
(
pat
),
1
));
cc0_user
=
next_cc0_user
(
insn
);
/* If the insn that uses cc0 is a conditional move, then the destination
must be the top of stack */
if
(
GET_CODE
(
PATTERN
(
cc0_user
))
==
SET
&&
SET_DEST
(
PATTERN
(
cc0_user
))
!=
pc_rtx
&&
GET_CODE
(
SET_SRC
(
PATTERN
(
cc0_user
)))
==
IF_THEN_ELSE
)
{
rtx
*
dest
,
src_note
;
dest
=
get_true_reg
(
&
SET_DEST
(
PATTERN
(
cc0_user
)));
if
(
REGNO
(
*
dest
)
!=
regstack
->
reg
[
regstack
->
top
])
{
emit_swap_insn
(
insn
,
regstack
,
*
dest
);
}
}
/* ??? If fxch turns out to be cheaper than fstp, give priority to
registers that die in this insn - move those to stack top first. */
...
...
@@ -2336,6 +2353,55 @@ subst_stack_regs_pat (insn, regstack, pat)
}
break
;
case
IF_THEN_ELSE
:
/* This insn requires the top of stack to be the destination. */
src1
=
get_true_reg
(
&
XEXP
(
SET_SRC
(
pat
),
1
));
src2
=
get_true_reg
(
&
XEXP
(
SET_SRC
(
pat
),
2
));
src1_note
=
find_regno_note
(
insn
,
REG_DEAD
,
REGNO
(
*
src1
));
src2_note
=
find_regno_note
(
insn
,
REG_DEAD
,
REGNO
(
*
src2
));
{
rtx
src_note
[]
=
{
0
,
src1_note
,
src2_note
};
int
i
;
if
(
STACK_REG_P
(
*
src1
))
replace_reg
(
src1
,
get_hard_regnum
(
regstack
,
*
src1
));
if
(
STACK_REG_P
(
*
src2
))
replace_reg
(
src2
,
get_hard_regnum
(
regstack
,
*
src2
));
for
(
i
=
1
;
i
<=
2
;
i
++
)
if
(
src_note
[
i
])
{
int
regno
=
get_hard_regnum
(
regstack
,
XEXP
(
src_note
[
i
],
0
));
/* If the register that dies is not at the top of stack, then
move the top of stack to the dead reg */
if
(
REGNO
(
XEXP
(
src_note
[
i
],
0
))
!=
regstack
->
reg
[
regstack
->
top
])
{
remove_regno_note
(
insn
,
REG_DEAD
,
REGNO
(
XEXP
(
src_note
[
i
],
0
)));
emit_pop_insn
(
insn
,
regstack
,
XEXP
(
src_note
[
i
],
0
),
emit_insn_after
);
}
else
{
CLEAR_HARD_REG_BIT
(
regstack
->
reg_set
,
REGNO
(
XEXP
(
src_note
[
i
],
0
)));
replace_reg
(
&
XEXP
(
src_note
[
i
],
0
),
FIRST_STACK_REG
);
regstack
->
top
--
;
}
}
SET_HARD_REG_BIT
(
regstack
->
reg_set
,
REGNO
(
*
dest
));
replace_reg
(
dest
,
FIRST_STACK_REG
);
}
break
;
default:
abort
();
}
...
...
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