diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2001-08-18 20:25:54 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2001-08-18 20:25:54 +0000 |
commit | c237e94a5f573ec6b80c4b37ea49b8ab24e68c0d (patch) | |
tree | aaae6cbc02ac7bffabdd0d787362314965ff9d55 /gcc/config/convex | |
parent | ef89d648b84b126fe6c15be5b09105bf705aa60a (diff) | |
download | gcc-c237e94a5f573ec6b80c4b37ea49b8ab24e68c0d.zip gcc-c237e94a5f573ec6b80c4b37ea49b8ab24e68c0d.tar.gz gcc-c237e94a5f573ec6b80c4b37ea49b8ab24e68c0d.tar.bz2 |
haifa-sched.c: Convert to target hooks.
* haifa-sched.c: Convert to target hooks. Macros replaced
are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT,
MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE,
MD_SCHED_FINISH, and HAVE_cycle_display.
* target-def.h (TARGET_SCHED_ADJUST_COST,
TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE,
TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT,
TARGET_SCHED_FINISH, TARGET_SCHED_REORDER,
TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY):
New hook #defines to be overridden.
(TARGET_SCHED): Bring them all together.
(TARGET_INITIALIZER): Update.
* target.h: Don't forward declare struct rtx_def. Use 'rtx'
instead of 'struct rtx_def *' throughout.
(struct sched): New set of hooks for the scheduler.
* Makefile.in (haifa-sched.o): Depend on target.h.
* doc/tm.texi: Document the new scheduler hooks, together in
their own section, instead of scattered around.
Fix a bunch of underfull/overfull hboxes.
* a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h,
ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h,
sparc.h: Don't define any of the old scheduler macros.
* a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c,
ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c,
sparc.c: Create hook functions from code extracted from
corresponding target header, or make existing hooks static, as
appropriate. Set the appropriate entries in targetm.
* alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h,
i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h,
rs6000-protos.h, s390-protos.h, sparc-protos.h:
Remove prototypes for functions which are now static.
* d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and
related gunk; the Haifa scheduler is now the only choice.
From-SVN: r45009
Diffstat (limited to 'gcc/config/convex')
-rw-r--r-- | gcc/config/convex/convex.c | 40 | ||||
-rw-r--r-- | gcc/config/convex/convex.h | 29 |
2 files changed, 40 insertions, 29 deletions
diff --git a/gcc/config/convex/convex.c b/gcc/config/convex/convex.c index dcf3669..6f965a2 100644 --- a/gcc/config/convex/convex.c +++ b/gcc/config/convex/convex.c @@ -66,12 +66,15 @@ static rtx convert_arg_pushes (); static void expand_movstr_call PARAMS ((rtx *)); static void convex_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT)); static void convex_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); +static int convex_adjust_cost PARAMS ((rtx, rtx, rtx, int)); /* Initialize the GCC target structure. */ #undef TARGET_ASM_FUNCTION_PROLOGUE #define TARGET_ASM_FUNCTION_PROLOGUE convex_output_function_prologue #undef TARGET_ASM_FUNCTION_EPILOGUE #define TARGET_ASM_FUNCTION_EPILOGUE convex_output_function_epilogue +#undef TARGET_SCHED_ADJUST_COST +#define TARGET_SCHED_ADJUST_COST convex_adjust_cost struct gcc_target targetm = TARGET_INITIALIZER; @@ -111,6 +114,43 @@ convex_output_function_epilogue (file, size) fprintf (file, "\tds.h 0\n"); } +/* Adjust the cost of dependences. */ +static int +convex_adjust_cost (insn, link, dep, cost) + rtx insn; + rtx link; + rtx dep; + int cost; +{ + /* Antidependencies don't block issue. */ + if (REG_NOTE_KIND (link) != 0) + cost = 0; + /* C38 situations where delay depends on context */ + else if (TARGET_C38 + && GET_CODE (PATTERN (insn)) == SET + && GET_CODE (PATTERN (dep)) == SET) + { + enum attr_type insn_type = get_attr_type (insn); + enum attr_type dep_type = get_attr_type (dep); + /* index register must be ready one cycle early */ + if (insn_type == TYPE_MLDW || insn_type == TYPE_MLDL + || (insn_type == TYPE_MST + && reg_mentioned_p (SET_DEST (PATTERN (dep)), + SET_SRC (PATTERN (insn))))) + cost += 1; + /* alu forwarding off alu takes two */ + if (dep_type == TYPE_ALU + && insn_type != TYPE_ALU + && ! (insn_type == TYPE_MST + && SET_DEST (PATTERN (dep)) == SET_SRC (PATTERN (insn)))) + cost += 1; + } + + return cost; +} + + + /* Here from OVERRIDE_OPTIONS at startup. Initialize constant tables. */ void diff --git a/gcc/config/convex/convex.h b/gcc/config/convex/convex.h index c0615e4..8d11c63 100644 --- a/gcc/config/convex/convex.h +++ b/gcc/config/convex/convex.h @@ -1115,35 +1115,6 @@ enum reg_class { #define BRANCH_COST 0 -/* Adjust the cost of dependences. */ - -#define ADJUST_COST(INSN,LINK,DEP,COST) \ -{ \ - /* Antidependencies don't block issue. */ \ - if (REG_NOTE_KIND (LINK) != 0) \ - (COST) = 0; \ - /* C38 situations where delay depends on context */ \ - else if (TARGET_C38 \ - && GET_CODE (PATTERN (INSN)) == SET \ - && GET_CODE (PATTERN (DEP)) == SET) \ - { \ - enum attr_type insn_type = get_attr_type (INSN); \ - enum attr_type dep_type = get_attr_type (DEP); \ - /* index register must be ready one cycle early */ \ - if (insn_type == TYPE_MLDW || insn_type == TYPE_MLDL \ - || (insn_type == TYPE_MST \ - && reg_mentioned_p (SET_DEST (PATTERN (DEP)), \ - SET_SRC (PATTERN (INSN))))) \ - (COST) += 1; \ - /* alu forwarding off alu takes two */ \ - if (dep_type == TYPE_ALU \ - && insn_type != TYPE_ALU \ - && ! (insn_type == TYPE_MST \ - && SET_DEST (PATTERN (DEP)) == SET_SRC (PATTERN (INSN)))) \ - (COST) += 1; \ - } \ -} - /* Convex uses VAX or IEEE floats. Follow the host format. */ #define TARGET_FLOAT_FORMAT HOST_FLOAT_FORMAT |