diff options
Diffstat (limited to 'gcc/config/pa')
-rw-r--r-- | gcc/config/pa/pa-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/pa/pa.c | 66 | ||||
-rw-r--r-- | gcc/config/pa/pa.h | 43 |
3 files changed, 65 insertions, 45 deletions
diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h index d8430a7..03d4ee2 100644 --- a/gcc/config/pa/pa-protos.h +++ b/gcc/config/pa/pa-protos.h @@ -66,7 +66,6 @@ extern int arith11_operand PARAMS ((rtx, enum machine_mode)); extern int symbolic_expression_p PARAMS ((rtx)); extern int hppa_address_cost PARAMS ((rtx)); extern int symbolic_memory_operand PARAMS ((rtx, enum machine_mode)); -extern int pa_adjust_cost PARAMS ((rtx, rtx, rtx, int)); extern int pa_adjust_insn_length PARAMS ((rtx, int)); extern int int11_operand PARAMS ((rtx, enum machine_mode)); extern int reg_or_cint_move_operand PARAMS ((rtx, enum machine_mode)); diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 5517f99..85183ff 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -69,6 +69,9 @@ static rtx store_reg PARAMS ((int, int, int)); static rtx load_reg PARAMS ((int, int, int)); static rtx set_reg_plus_d PARAMS ((int, int, int)); static void pa_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT)); +static int pa_adjust_cost PARAMS ((rtx, rtx, rtx, int)); +static int pa_adjust_priority PARAMS ((rtx, int)); +static int pa_issue_rate PARAMS ((void)); /* Save the operands last given to a compare for use when we generate a scc or bcc insn. */ @@ -115,6 +118,13 @@ int n_deferred_plabels = 0; #undef TARGET_ASM_FUNCTION_EPILOGUE #define TARGET_ASM_FUNCTION_EPILOGUE pa_output_function_epilogue +#undef TARGET_SCHED_ADJUST_COST +#define TARGET_SCHED_ADJUST_COST pa_adjust_cost +#undef TARGET_SCHED_ADJUST_PRIORITY +#define TARGET_SCHED_ADJUST_PRIORITY pa_adjust_priority +#undef TARGET_SCHED_ISSUE_RATE +#define TARGET_SCHED_ISSUE_RATE pa_issue_rate + struct gcc_target targetm = TARGET_INITIALIZER; void @@ -3591,7 +3601,7 @@ gen_cmp_fp (code, 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 +static int pa_adjust_cost (insn, link, dep_insn, cost) rtx insn; rtx link; @@ -3829,6 +3839,60 @@ pa_adjust_cost (insn, link, dep_insn, cost) abort (); } +/* Adjust scheduling priorities. We use this to try and keep addil + and the next use of %r1 close together. */ +static int +pa_adjust_priority (insn, priority) + rtx insn; + int priority; +{ + rtx set = single_set (insn); + rtx src, dest; + if (set) + { + src = SET_SRC (set); + dest = SET_DEST (set); + if (GET_CODE (src) == LO_SUM + && symbolic_operand (XEXP (src, 1), VOIDmode) + && ! read_only_operand (XEXP (src, 1), VOIDmode)) + priority >>= 3; + + else if (GET_CODE (src) == MEM + && GET_CODE (XEXP (src, 0)) == LO_SUM + && symbolic_operand (XEXP (XEXP (src, 0), 1), VOIDmode) + && ! read_only_operand (XEXP (XEXP (src, 0), 1), VOIDmode)) + priority >>= 1; + + else if (GET_CODE (dest) == MEM + && GET_CODE (XEXP (dest, 0)) == LO_SUM + && symbolic_operand (XEXP (XEXP (dest, 0), 1), VOIDmode) + && ! read_only_operand (XEXP (XEXP (dest, 0), 1), VOIDmode)) + priority >>= 3; + } + return priority; +} + +/* The 700 can only issue a single insn at a time. + The 7XXX processors can issue two insns at a time. + The 8000 can issue 4 insns at a time. */ +static int +pa_issue_rate () +{ + switch (pa_cpu) + { + case PROCESSOR_700: return 1; + case PROCESSOR_7100: return 2; + case PROCESSOR_7100LC: return 2; + case PROCESSOR_7200: return 2; + case PROCESSOR_8000: return 4; + + default: + abort (); + } +} + + + /* Return any length adjustment needed by INSN which already has its length computed as LENGTH. Return zero if no adjustment is necessary. diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index fcceaa1..a6580b8 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -50,17 +50,6 @@ extern enum processor_type pa_cpu; #define pa_cpu_attr ((enum attr_cpu)pa_cpu) -/* The 700 can only issue a single insn at a time. - The 7XXX processors can issue two insns at a time. - The 8000 can issue 4 insns at a time. */ -#define ISSUE_RATE \ - (pa_cpu == PROCESSOR_700 ? 1 \ - : pa_cpu == PROCESSOR_7100 ? 2 \ - : pa_cpu == PROCESSOR_7100LC ? 2 \ - : pa_cpu == PROCESSOR_7200 ? 2 \ - : pa_cpu == PROCESSOR_8000 ? 4 \ - : 2) - /* Which architecture to generate code for. */ enum architecture_type @@ -1651,38 +1640,6 @@ while (0) /* Adjust the cost of branches. */ #define BRANCH_COST (pa_cpu == PROCESSOR_8000 ? 2 : 1) -/* Adjust the cost of dependencies. */ - -#define ADJUST_COST(INSN,LINK,DEP,COST) \ - (COST) = pa_adjust_cost (INSN, LINK, DEP, COST) - -/* Adjust scheduling priorities. We use this to try and keep addil - and the next use of %r1 close together. */ -#define ADJUST_PRIORITY(PREV) \ - { \ - rtx set = single_set (PREV); \ - rtx src, dest; \ - if (set) \ - { \ - src = SET_SRC (set); \ - dest = SET_DEST (set); \ - if (GET_CODE (src) == LO_SUM \ - && symbolic_operand (XEXP (src, 1), VOIDmode) \ - && ! read_only_operand (XEXP (src, 1), VOIDmode)) \ - INSN_PRIORITY (PREV) >>= 3; \ - else if (GET_CODE (src) == MEM \ - && GET_CODE (XEXP (src, 0)) == LO_SUM \ - && symbolic_operand (XEXP (XEXP (src, 0), 1), VOIDmode)\ - && ! read_only_operand (XEXP (XEXP (src, 0), 1), VOIDmode))\ - INSN_PRIORITY (PREV) >>= 1; \ - else if (GET_CODE (dest) == MEM \ - && GET_CODE (XEXP (dest, 0)) == LO_SUM \ - && symbolic_operand (XEXP (XEXP (dest, 0), 1), VOIDmode)\ - && ! read_only_operand (XEXP (XEXP (dest, 0), 1), VOIDmode))\ - INSN_PRIORITY (PREV) >>= 3; \ - } \ - } - /* Handling the special cases is going to get too complicated for a macro, just call `pa_adjust_insn_length' to do the real work. */ #define ADJUST_INSN_LENGTH(INSN, LENGTH) \ |