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/sparc | |
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/sparc')
-rw-r--r-- | gcc/config/sparc/sparc-protos.h | 5 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 71 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.h | 25 |
3 files changed, 63 insertions, 38 deletions
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h index 78117f7..fe65829 100644 --- a/gcc/config/sparc/sparc-protos.h +++ b/gcc/config/sparc/sparc-protos.h @@ -50,14 +50,12 @@ extern enum direction function_arg_padding PARAMS ((enum machine_mode, tree)); #endif /* ARGS_SIZE_RTX */ #endif /* TREE_CODE */ -extern void ultrasparc_sched_init PARAMS ((FILE *, int)); extern void load_pic_register PARAMS ((void)); extern void order_regs_for_local_alloc PARAMS ((void)); extern int compute_frame_size PARAMS ((int, int)); extern int check_pic PARAMS ((int)); extern int short_branch PARAMS ((int, int)); extern int sparc_flat_epilogue_delay_slots PARAMS ((void)); -extern int sparc_issue_rate PARAMS ((void)); extern unsigned long sparc_flat_compute_frame_size PARAMS ((int)); extern void sparc_function_profiler PARAMS ((FILE *, int)); extern void sparc_function_block_profiler PARAMS ((FILE *, int)); @@ -81,8 +79,6 @@ extern int gen_v9_scc PARAMS ((enum rtx_code, rtx *)); extern void sparc_initialize_trampoline PARAMS ((rtx, rtx, rtx)); extern void sparc64_initialize_trampoline PARAMS ((rtx, rtx, rtx)); extern rtx legitimize_pic_address PARAMS ((rtx, enum machine_mode, rtx)); -extern void ultrasparc_sched_reorder PARAMS ((FILE *, int, rtx *, int)); -extern int ultrasparc_variable_issue PARAMS ((rtx)); extern void sparc_defer_case_vector PARAMS ((rtx, rtx, int)); extern void sparc_emit_set_const32 PARAMS ((rtx, rtx)); extern void sparc_emit_set_const64 PARAMS ((rtx, rtx)); @@ -115,7 +111,6 @@ extern int reg_unused_after PARAMS ((rtx, rtx)); extern int register_ok_for_ldd PARAMS ((rtx)); extern int registers_ok_for_ldd_peep PARAMS ((rtx, rtx)); extern int sparc_flat_eligible_for_epilogue_delay PARAMS ((rtx, int)); -extern int sparc_adjust_cost PARAMS ((rtx, rtx, rtx, int)); extern int v9_regcmp_p PARAMS ((enum rtx_code)); extern char *sparc_v8plus_shift PARAMS ((rtx *, rtx, const char *)); /* Function used for V8+ code generation. Returns 1 if the high diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index b0d9ade..216fc60 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -168,6 +168,16 @@ static void sparc_nonflat_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT, static void sparc_nonflat_function_prologue PARAMS ((FILE *, HOST_WIDE_INT, int)); static void sparc_elf_asm_named_section PARAMS ((const char *, unsigned int)); + +static void ultrasparc_sched_reorder PARAMS ((FILE *, int, rtx *, int)); +static int ultrasparc_variable_issue PARAMS ((rtx)); +static void ultrasparc_sched_init PARAMS ((void)); + +static int sparc_adjust_cost PARAMS ((rtx, rtx, rtx, int)); +static int sparc_issue_rate PARAMS ((void)); +static int sparc_variable_issue PARAMS ((FILE *, int, rtx, int)); +static void sparc_sched_init PARAMS ((FILE *, int, int)); +static int sparc_sched_reorder PARAMS ((FILE *, int, rtx *, int *, int)); /* Option handling. */ @@ -196,6 +206,17 @@ enum processor_type sparc_cpu; #undef TARGET_ASM_FUNCTION_EPILOGUE #define TARGET_ASM_FUNCTION_EPILOGUE sparc_output_function_epilogue +#undef TARGET_SCHED_ADJUST_COST +#define TARGET_SCHED_ADJUST_COST sparc_adjust_cost +#undef TARGET_SCHED_ISSUE_RATE +#define TARGET_SCHED_ISSUE_RATE sparc_issue_rate +#undef TARGET_SCHED_VARIABLE_ISSUE +#define TARGET_SCHED_VARIABLE_ISSUE sparc_variable_issue +#undef TARGET_SCHED_INIT +#define TARGET_SCHED_INIT sparc_sched_init +#undef TARGET_SCHED_REORDER +#define TARGET_SCHED_REORDER sparc_sched_reorder + struct gcc_target targetm = TARGET_INITIALIZER; /* Validate and override various options, and do some machine dependent @@ -7299,7 +7320,7 @@ ultrasparc_adjust_cost (insn, link, dep_insn, cost) #undef SLOW_FP } -int +static int sparc_adjust_cost(insn, link, dep, cost) rtx insn; rtx link; @@ -7680,10 +7701,8 @@ ultra_flush_pipeline () } /* Init our data structures for this current block. */ -void -ultrasparc_sched_init (dump, sched_verbose) - FILE *dump ATTRIBUTE_UNUSED; - int sched_verbose ATTRIBUTE_UNUSED; +static void +ultrasparc_sched_init () { memset ((char *) ultra_pipe_hist, 0, sizeof ultra_pipe_hist); ultra_cur_hist = 0; @@ -7691,10 +7710,20 @@ ultrasparc_sched_init (dump, sched_verbose) ultra_pipe.free_slot_mask = 0xf; } +static void +sparc_sched_init (dump, sched_verbose, max_ready) + FILE *dump ATTRIBUTE_UNUSED; + int sched_verbose ATTRIBUTE_UNUSED; + int max_ready ATTRIBUTE_UNUSED; +{ + if (sparc_cpu == PROCESSOR_ULTRASPARC) + ultrasparc_sched_init (); +} + /* INSN has been scheduled, update pipeline commit state and return how many instructions are still to be scheduled in this group. */ -int +static int ultrasparc_variable_issue (insn) rtx insn; { @@ -7718,6 +7747,19 @@ ultrasparc_variable_issue (insn) return left_to_fire; } +static int +sparc_variable_issue (dump, sched_verbose, insn, cim) + FILE *dump ATTRIBUTE_UNUSED; + int sched_verbose ATTRIBUTE_UNUSED; + rtx insn; + int cim; +{ + if (sparc_cpu == PROCESSOR_ULTRASPARC) + return ultrasparc_variable_issue (INSN); + else + return cim - 1; +} + /* In actual_hazard_this_instance, we may have yanked some instructions from the ready list due to conflict cost adjustments. If so, and such an insn was in our pipeline @@ -7767,7 +7809,7 @@ ultra_rescan_pipeline_state (ready, n_ready) } } -void +static void ultrasparc_sched_reorder (dump, sched_verbose, ready, n_ready) FILE *dump; int sched_verbose; @@ -8053,7 +8095,20 @@ ultrasparc_sched_reorder (dump, sched_verbose, ready, n_ready) } } -int +static int +sparc_sched_reorder (dump, sched_verbose, ready, n_readyp, clock) + FILE *dump; + int sched_verbose; + rtx *ready; + int *n_readyp; + int clock; +{ + if (sparc_cpu == PROCESSOR_ULTRASPARC) + ultrasparc_sched_reorder (dump, sched_verbose, ready, *n_readyp); + return sparc_issue_rate (); +} + +static int sparc_issue_rate () { switch (sparc_cpu) diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index e24b0f9..0e9e515 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -2865,31 +2865,6 @@ do { \ case FIX: \ return 19; -#define ISSUE_RATE sparc_issue_rate() - -/* Adjust the cost of dependencies. */ -#define ADJUST_COST(INSN,LINK,DEP,COST) \ - (COST) = sparc_adjust_cost(INSN, LINK, DEP, COST) - -#define MD_SCHED_INIT(DUMP, SCHED_VERBOSE, MAX_READY) \ - if (sparc_cpu == PROCESSOR_ULTRASPARC) \ - ultrasparc_sched_init (DUMP, SCHED_VERBOSE) - -#define MD_SCHED_REORDER(DUMP, SCHED_VERBOSE, READY, N_READY, CLOCK, CIM) \ -do { \ - if (sparc_cpu == PROCESSOR_ULTRASPARC) \ - ultrasparc_sched_reorder (DUMP, SCHED_VERBOSE, READY, N_READY); \ - CIM = issue_rate; \ -} while (0) - -#define MD_SCHED_VARIABLE_ISSUE(DUMP, SCHED_VERBOSE, INSN, CAN_ISSUE_MORE) \ -do { \ - if (sparc_cpu == PROCESSOR_ULTRASPARC) \ - (CAN_ISSUE_MORE) = ultrasparc_variable_issue (INSN); \ - else \ - (CAN_ISSUE_MORE)--; \ -} while (0) - /* Conditional branches with empty delay slots have a length of two. */ #define ADJUST_INSN_LENGTH(INSN, LENGTH) \ do { \ |