From 64e1e4c4a7825964b7853402053ad5daf95487b3 Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Fri, 18 Jun 2004 14:27:25 +0000 Subject: [PATCH] s390.md: Remove the generic pipeline description. * config/s390/s390.md: Remove the generic pipeline description. * config/s390/2064.md: Make all insn reservations apply to the z900, g5 and g6. * config/s390/s390.c (s390_use_dfa_pipeline_interface): Remove. (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1. (s390_adjust_cost): Cleanup. Don't check address dependency here. (s390_first_cycle_multipass_dfa_lookahead): Co-Authored-By: Ulrich Weigand From-SVN: r83350 --- gcc/ChangeLog | 12 +++++ gcc/config/s390/2064.md | 20 ++++---- gcc/config/s390/s390.c | 56 ++++----------------- gcc/config/s390/s390.md | 108 +++------------------------------------- 4 files changed, 40 insertions(+), 156 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aa0a6dd1d4e..82865ebb72b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2004-06-18 Steven Bosscher + Ulrich Weigand + + * config/s390/s390.md: Remove the generic pipeline description. + * config/s390/2064.md: Make all insn reservations apply to + the z900, g5 and g6. + * config/s390/s390.c (s390_use_dfa_pipeline_interface): Remove. + (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): + Define to hook_int_void_1. + (s390_adjust_cost): Cleanup. Don't check address dependency here. + (s390_first_cycle_multipass_dfa_lookahead): Always return 4. + 2004-06-18 Daniel Berlin Diego Novillo diff --git a/gcc/config/s390/2064.md b/gcc/config/s390/2064.md index 143cd1b9ca2..a1a6d1394ec 100644 --- a/gcc/config/s390/2064.md +++ b/gcc/config/s390/2064.md @@ -40,43 +40,45 @@ ;; | ;; wr +;; This scheduler description is also used for the g5 and g6. + (define_automaton "z_ipu") (define_cpu_unit "z_e1" "z_ipu") (define_cpu_unit "z_wr" "z_ipu") (define_insn_reservation "z_la" 1 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "la")) "z_e1,z_wr") (define_insn_reservation "z_larl" 1 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "larl")) "z_e1,z_wr") (define_insn_reservation "z_load" 1 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "load")) "z_e1,z_wr") (define_insn_reservation "z_store" 1 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "store")) "z_e1,z_wr") (define_insn_reservation "z_call" 5 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "jsr")) "z_e1*5,z_wr") (define_insn_reservation "z_o2" 2 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "o2")) "z_e1*2,z_wr") (define_insn_reservation "z_o3" 3 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "type" "o3")) "z_e1*3,z_wr") @@ -86,12 +88,12 @@ ; (define_insn_reservation "z_int" 1 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "atype" "reg")) "z_e1,z_wr") (define_insn_reservation "z_agen" 1 - (and (eq_attr "cpu" "z900") + (and (eq_attr "cpu" "z900,g5,g6") (eq_attr "atype" "agen")) "z_e1,z_wr") diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index d922e94a499..3e2ad5a43a6 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -72,7 +72,6 @@ static enum attr_type s390_safe_attr_type (rtx); static int s390_adjust_cost (rtx, rtx, rtx, int); static int s390_adjust_priority (rtx, int); static int s390_issue_rate (void); -static int s390_use_dfa_pipeline_interface (void); static int s390_first_cycle_multipass_dfa_lookahead (void); static bool s390_rtx_costs (rtx, int, int, int *); static int s390_address_cost (rtx); @@ -132,7 +131,7 @@ static bool s390_call_saved_register_used (tree); #undef TARGET_SCHED_ISSUE_RATE #define TARGET_SCHED_ISSUE_RATE s390_issue_rate #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE -#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE s390_use_dfa_pipeline_interface +#define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE hook_int_void_1 #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD s390_first_cycle_multipass_dfa_lookahead @@ -3902,9 +3901,6 @@ s390_agen_dep_p (rtx dep_insn, rtx insn) static int s390_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) { - rtx dep_rtx; - int i; - /* 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. */ @@ -3916,35 +3912,16 @@ s390_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0) return cost; - /* DFA based scheduling checks address dependency in md file. */ - if (s390_use_dfa_pipeline_interface ()) - { - /* Operand forward in case of lr, load and la. */ - if (s390_tune == PROCESSOR_2084_Z990 - && cost == 1 - && (s390_safe_attr_type (dep_insn) == TYPE_LA - || s390_safe_attr_type (dep_insn) == TYPE_LR - || s390_safe_attr_type (dep_insn) == TYPE_LOAD)) - return 0; - return cost; - } - - dep_rtx = PATTERN (dep_insn); - - if (GET_CODE (dep_rtx) == SET - && addr_generation_dependency_p (dep_rtx, insn)) - cost += (s390_safe_attr_type (dep_insn) == TYPE_LA) ? 1 : 4; - else if (GET_CODE (dep_rtx) == PARALLEL) - { - for (i = 0; i < XVECLEN (dep_rtx, 0); i++) - { - if (addr_generation_dependency_p (XVECEXP (dep_rtx, 0, i), insn)) - cost += (s390_safe_attr_type (dep_insn) == TYPE_LA) ? 1 : 4; - } - } - + /* Operand forward in case of lr, load and la. */ + if (s390_tune == PROCESSOR_2084_Z990 + && cost == 1 + && (s390_safe_attr_type (dep_insn) == TYPE_LA + || s390_safe_attr_type (dep_insn) == TYPE_LR + || s390_safe_attr_type (dep_insn) == TYPE_LOAD)) + return 0; return cost; } + /* A C statement (sans semicolon) to update the integer scheduling priority INSN_PRIORITY (INSN). Increase the priority to execute the INSN earlier, reduce the priority to execute INSN later. Do not define this macro if @@ -3987,23 +3964,10 @@ s390_issue_rate (void) return 1; } -/* If the following function returns TRUE, we will use the the DFA - insn scheduler. */ - -static int -s390_use_dfa_pipeline_interface (void) -{ - if (s390_tune == PROCESSOR_2064_Z900 - || s390_tune == PROCESSOR_2084_Z990) - return 1; - - return 0; -} - static int s390_first_cycle_multipass_dfa_lookahead (void) { - return s390_use_dfa_pipeline_interface () ? 4 : 0; + return 4; } diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 8c3708769a6..b6ec023ed5f 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -135,7 +135,9 @@ ;; Processor type. This attribute must exactly match the processor_type -;; enumeration in s390.h. +;; enumeration in s390.h. The current machine description does not +;; distinguish between g5 and g6, but there are differences between the two +;; CPUs could in theory be modeled. (define_attr "cpu" "g5,g6,z900,z990" (const (symbol_ref "s390_tune"))) @@ -182,107 +184,11 @@ (eq_attr "op_type" "SIY") (const_string "agen")] (const_string "reg"))) -;; Generic pipeline function unit. - -(define_function_unit "integer" 1 0 - (eq_attr "type" "none") 0 0) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "integer") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fsimpd") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fsimps") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "load") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "floadd") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "floads") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "la") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "larl") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "lr") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "branch") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "store") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fstored") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fstores") 1 1) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "lm") 2 2) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "stm") 2 2) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "cs") 5 5) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "vs") 30 30) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "jsr") 5 5) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "imul") 7 7) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fmuld") 6 6) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fmuls") 6 6) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "idiv") 33 33) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fdivd") 33 33) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fdivs") 33 33) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fsqrtd") 30 30) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "fsqrts") 30 30) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "ftoi") 2 2) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "itof") 2 2) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "o2") 2 2) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "o3") 3 3) - -(define_function_unit "integer" 1 0 - (eq_attr "type" "other") 5 5) - -;; Pipeline description for z900 - +;; Pipeline description for z900. For lack of anything better, +;; this description is also used for the g5 and g6. (include "2064.md") + +;; Pipeline description for z990. (include "2084.md") ;; Length in bytes. -- 2.30.2