aboutsummaryrefslogtreecommitdiff
path: root/gcc/target.def
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim@codesourcery.com>2010-11-02 16:02:09 +0000
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>2010-11-02 16:02:09 +0000
commit894fd6f204ea6f67eccacc0f3ee969ac48f56b3e (patch)
tree577fec572602f5e9c38ef19c8798360503bcb808 /gcc/target.def
parent7350a36115f9752910ec4829f25e2d45a684d91e (diff)
downloadgcc-894fd6f204ea6f67eccacc0f3ee969ac48f56b3e.zip
gcc-894fd6f204ea6f67eccacc0f3ee969ac48f56b3e.tar.gz
gcc-894fd6f204ea6f67eccacc0f3ee969ac48f56b3e.tar.bz2
Model decoder of Core 2/i7 for multipass scheduling.
* config/i386/i386-protos.h (struct ix86_first_cycle_multipass_data_): New type to hold target-specific data for multipass scheduling. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. * config/i386/i386.c (ia32_multipass_dfa_lookahead): Update for Core 2/i7. (core2i7_secondary_decoder_max_insn_size,) (core2i7_secondary_ifetch_block_size, core2i7_ifetch_block_max_insns): New static variables. ([const_]ix86_first_cycle_multipass_data_t): New typedefs. ([_]ix86_first_cycle_multipass_data): New static variable. (core2i7_first_cycle_multipass_init, core2i7_dfa_poast_advance_cycle): Implement targetm.sched hooks. (core2i7_first_cycle_multipass_filter_ready_try): New static subroutine of ... (core2i7_first_cycle_multipass_{begin, issue, backtrack, end, fini}): Implement new targetm.sched hooks. (ix86_sched_init_global, TARGET_SCHED_INIT_GLOBAL): Define targetm.sched hook to install multipass scheduling hooks on demand. * doc/tm.texi.in: Document new targetm.sched hooks. * doc/tm.texi: Regenerate. * haifa-sched.c (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. (first_cycle_multipass_data_t): New typedef. (struct choice_entry: target_data): New field. (max_issue): Add first_cycle_insn_p parameter. Call new target hooks to allow target model restrictions not represented in DFA. (choose_ready, schedule_block): Update. (sched_extend_ready_list, sched_finish_ready_list): Call new target hooks to initialize target-specific data for multipass scheduling. * sched-int.h (max_issue): Update declaration. * sel-sched.c (choose_best_insn): Update. * target.def (first_cycle_multipass_{begin, issue, backtrack},) (first_cycle_multipass_{init, fini}): Define and document new targetm.sched hooks. From-SVN: r166196
Diffstat (limited to 'gcc/target.def')
-rw-r--r--gcc/target.def78
1 files changed, 78 insertions, 0 deletions
diff --git a/gcc/target.def b/gcc/target.def
index 98cea58..37ba3bc 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -650,6 +650,84 @@ DEFHOOK
"",
int, (rtx insn), NULL)
+/* This hook prepares the target for a new round of multipass
+ scheduling.
+ DATA is a pointer to target-specific data used for multipass scheduling.
+ READY_TRY and N_READY represent the current state of search in the
+ optimization space. The target can filter out instructions that
+ should not be tried during current round by setting corresponding
+ elements in READY_TRY to non-zero.
+ FIRST_CYCLE_INSN_P is true if this is the first round of multipass
+ scheduling on current cycle. */
+DEFHOOK
+(first_cycle_multipass_begin,
+ "",
+ void, (void *data, char *ready_try, int n_ready, bool first_cycle_insn_p),
+ NULL)
+
+/* This hook is called when multipass scheduling evaluates instruction INSN.
+ DATA is a pointer to target-specific data that can be used to record effects
+ of INSN on CPU that are not described in DFA.
+ READY_TRY and N_READY represent the current state of search in the
+ optimization space. The target can filter out instructions that
+ should not be tried after issueing INSN by setting corresponding
+ elements in READY_TRY to non-zero.
+ INSN is the instruction being evaluated.
+ PREV_DATA is a pointer to target-specific data corresponding
+ to a state before issueing INSN. */
+DEFHOOK
+(first_cycle_multipass_issue,
+ "",
+ void, (void *data, char *ready_try, int n_ready, rtx insn,
+ const void *prev_data), NULL)
+
+/* This hook is called when multipass scheduling backtracks from evaluation of
+ instruction corresponding to DATA.
+ DATA is a pointer to target-specific data that stores the effects
+ of instruction from which the algorithm backtracks on CPU that are not
+ described in DFA.
+ READY_TRY and N_READY represent the current state of search in the
+ optimization space. The target can filter out instructions that
+ should not be tried after issueing INSN by setting corresponding
+ elements in READY_TRY to non-zero. */
+DEFHOOK
+(first_cycle_multipass_backtrack,
+ "",
+ void, (const void *data, char *ready_try, int n_ready), NULL)
+
+/* This hook notifies the target about the result of the concluded current
+ round of multipass scheduling.
+ DATA is a pointer.
+ If DATA is non-NULL it points to target-specific data used for multipass
+ scheduling which corresponds to instruction at the start of the chain of
+ the winning solution. DATA is NULL when multipass scheduling cannot find
+ a good enough solution on current cycle and decides to retry later,
+ usually after advancing the cycle count. */
+DEFHOOK
+(first_cycle_multipass_end,
+ "",
+ void, (const void *data), NULL)
+
+/* This hook is called to initialize target-specific data for multipass
+ scheduling after it has been allocated.
+ DATA is a pointer to target-specific data that stores the effects
+ of instruction from which the algorithm backtracks on CPU that are not
+ described in DFA. */
+DEFHOOK
+(first_cycle_multipass_init,
+ "",
+ void, (void *data), NULL)
+
+/* This hook is called to finalize target-specific data for multipass
+ scheduling before it is deallocated.
+ DATA is a pointer to target-specific data that stores the effects
+ of instruction from which the algorithm backtracks on CPU that are not
+ described in DFA. */
+DEFHOOK
+(first_cycle_multipass_fini,
+ "",
+ void, (void *data), NULL)
+
/* The following member value is pointer to a function called by
the insn scheduler before issuing insn passed as the third
parameter on given cycle. If the hook returns nonzero, the