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
780f491f
Commit
780f491f
authored
Mar 02, 1993
by
Torbjorn Granlund
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(pa_adjust_cost): New procudure.
From-SVN: r3597
parent
1150aa70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
96 additions
and
0 deletions
+96
-0
gcc/config/pa/pa.c
+96
-0
No files found.
gcc/config/pa/pa.c
View file @
780f491f
...
...
@@ -2061,6 +2061,102 @@ gen_cmp_fp (code, operand0, operand1)
gen_rtx
(
code
,
CCFPmode
,
operand0
,
operand1
));
}
/* Adjust the cost of a scheduling dependency. Return the new cost of
a dependency LINK or INSN on DEP_INSN. COST is the current cost. */
int
pa_adjust_cost
(
insn
,
link
,
dep_insn
,
cost
)
rtx
insn
;
rtx
link
;
rtx
dep_insn
;
int
cost
;
{
/* If the dependence is an anti-dependence, there is no cost. For an
output dependence, there is sometimes a cost, but it doesn't seem
worth handling those few cases. */
if
(
REG_NOTE_KIND
(
link
)
==
0
)
{
/* Data dependency; DEP_INSN writes a register that INSN reads some
cycles later. */
if
(
get_attr_type
(
insn
)
==
TYPE_FPSTORE
)
{
if
(
GET_CODE
(
PATTERN
(
insn
))
!=
SET
||
GET_CODE
(
PATTERN
(
dep_insn
))
!=
SET
)
/* If this happens, we have to extend this to schedule
optimally. */
abort
();
if
(
rtx_equal_p
(
SET_DEST
(
PATTERN
(
dep_insn
)),
SET_SRC
(
PATTERN
(
insn
))))
{
/* INSN is a fp store and DEP_INSN is writing to the register
being stored. */
switch
(
get_attr_type
(
dep_insn
))
{
case
TYPE_FPLOAD
:
/* This cost 3 cycles, not 2 as the md says. */
return
cost
+
1
;
case
TYPE_FPALU
:
case
TYPE_FPMUL
:
case
TYPE_FPDIVSGL
:
case
TYPE_FPDIVDBL
:
case
TYPE_FPSQRTSGL
:
case
TYPE_FPSQRTDBL
:
/* In these important cases, we save one cycle compared to
when flop instruction feed each other. */
return
cost
-
1
;
default
:
return
cost
;
}
}
}
/* For other data dependencies, the default cost specified in the
md is correct. */
return
cost
;
}
else
if
(
REG_NOTE_KIND
(
link
)
==
REG_DEP_ANTI
)
{
/* Anti dependency; DEP_INSN reads a register that INSN writes some
cycles later. */
if
(
get_attr_type
(
insn
)
==
TYPE_FPLOAD
)
{
if
(
GET_CODE
(
PATTERN
(
insn
))
!=
SET
||
GET_CODE
(
PATTERN
(
dep_insn
))
!=
SET
)
/* If this happens, we have to extend this to schedule
optimally. */
abort
();
if
(
rtx_equal_p
(
SET_SRC
(
PATTERN
(
dep_insn
)),
SET_DEST
(
PATTERN
(
insn
))))
{
switch
(
get_attr_type
(
dep_insn
))
{
case
TYPE_FPALU
:
case
TYPE_FPMUL
:
case
TYPE_FPDIVSGL
:
case
TYPE_FPDIVDBL
:
case
TYPE_FPSQRTSGL
:
case
TYPE_FPSQRTDBL
:
return
cost
-
1
;
default
:
return
0
;
}
}
}
/* For other anti dependencies, the cost is 0. */
return
0
;
}
/* For all other cases of anti dependency and all cases of output
dependence the md is correct enough for the PA7000. */
return
cost
;
}
/* Print operand X (an rtx) in assembler syntax to file FILE.
CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
...
...
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