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
954a5693
Commit
954a5693
authored
May 17, 1997
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(notreg_cost): New function, extracted from COST macro.
(COST): Use notreg_cost. From-SVN: r14075
parent
50196afa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
gcc/cse.c
+24
-13
No files found.
gcc/cse.c
View file @
954a5693
...
@@ -483,19 +483,7 @@ struct table_elt
...
@@ -483,19 +483,7 @@ struct table_elt
? (CHEAP_REG (X) ? 0 \
? (CHEAP_REG (X) ? 0 \
: REGNO (X) >= FIRST_PSEUDO_REGISTER ? 1 \
: REGNO (X) >= FIRST_PSEUDO_REGISTER ? 1 \
: 2) \
: 2) \
: ((GET_CODE (X) == SUBREG \
: notreg_cost(X))
&& GET_CODE (SUBREG_REG (X)) == REG \
&& GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \
&& GET_MODE_CLASS (GET_MODE (SUBREG_REG (X))) == MODE_INT \
&& (GET_MODE_SIZE (GET_MODE (X)) \
< GET_MODE_SIZE (GET_MODE (SUBREG_REG (X)))) \
&& subreg_lowpart_p (X) \
&& TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (GET_MODE (X)), \
GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (X))))) \
? (CHEAP_REG (SUBREG_REG (X)) ? 0 \
: REGNO (SUBREG_REG (X)) >= FIRST_PSEUDO_REGISTER ? 1 \
: 2) \
: rtx_cost (X, SET) * 2))
/* Determine if the quantity number for register X represents a valid index
/* Determine if the quantity number for register X represents a valid index
into the `qty_...' variables. */
into the `qty_...' variables. */
...
@@ -620,6 +608,7 @@ struct cse_basic_block_data {
...
@@ -620,6 +608,7 @@ struct cse_basic_block_data {
|| XEXP (X, 0) == virtual_stack_dynamic_rtx \
|| XEXP (X, 0) == virtual_stack_dynamic_rtx \
|| XEXP (X, 0) == virtual_outgoing_args_rtx)))
|| XEXP (X, 0) == virtual_outgoing_args_rtx)))
static
int
notreg_cost
PROTO
((
rtx
));
static
void
new_basic_block
PROTO
((
void
));
static
void
new_basic_block
PROTO
((
void
));
static
void
make_new_qty
PROTO
((
int
));
static
void
make_new_qty
PROTO
((
int
));
static
void
make_regs_eqv
PROTO
((
int
,
int
));
static
void
make_regs_eqv
PROTO
((
int
,
int
));
...
@@ -685,6 +674,28 @@ extern int rtx_equal_function_value_matters;
...
@@ -685,6 +674,28 @@ extern int rtx_equal_function_value_matters;
Another is in rtl generation, to pick the cheapest way to multiply.
Another is in rtl generation, to pick the cheapest way to multiply.
Other uses like the latter are expected in the future. */
Other uses like the latter are expected in the future. */
/* Internal function, to compute cost when X is not a register; called
from COST macro to keep it simple. */
static
int
notreg_cost
(
x
)
rtx
x
;
{
return
((
GET_CODE
(
x
)
==
SUBREG
&&
GET_CODE
(
SUBREG_REG
(
x
))
==
REG
&&
GET_MODE_CLASS
(
GET_MODE
(
x
))
==
MODE_INT
&&
GET_MODE_CLASS
(
GET_MODE
(
SUBREG_REG
(
x
)))
==
MODE_INT
&&
(
GET_MODE_SIZE
(
GET_MODE
(
x
))
<
GET_MODE_SIZE
(
GET_MODE
(
SUBREG_REG
(
x
))))
&&
subreg_lowpart_p
(
x
)
&&
TRULY_NOOP_TRUNCATION
(
GET_MODE_BITSIZE
(
GET_MODE
(
x
)),
GET_MODE_BITSIZE
(
GET_MODE
(
SUBREG_REG
(
x
)))))
?
(
CHEAP_REG
(
SUBREG_REG
(
x
))
?
0
:
(
REGNO
(
SUBREG_REG
(
x
))
>=
FIRST_PSEUDO_REGISTER
?
1
:
2
))
:
rtx_cost
(
x
,
SET
)
*
2
);
}
/* Return the right cost to give to an operation
/* Return the right cost to give to an operation
to make the cost of the corresponding register-to-register instruction
to make the cost of the corresponding register-to-register instruction
N times that of a fast register-to-register instruction. */
N times that of a fast register-to-register instruction. */
...
...
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