From 2da05a5bb89789c27a0babe8693a2561937217f6 Mon Sep 17 00:00:00 2001 From: Jeffrey A Law Date: Tue, 19 Aug 1997 21:09:22 +0000 Subject: [PATCH] configure.in: Turn on haifa by default for the PA. * configure.in: Turn on haifa by default for the PA. * configure: Rebuilt. * pa.c (override_options): Accept -mschedule=7200 option. (pa_adjust_cost): No longer need to scale costs for newer processors. * pa.h (enum processor_type): Add PROCESSOR_7200. * pa.md: Revamp scheduling parameters to work better with haifa. Add scheduling parameters for the 7200. From-SVN: r14850 --- gcc/ChangeLog | 9 ++++++ gcc/config/pa/pa.c | 21 ++++++++----- gcc/config/pa/pa.h | 1 + gcc/config/pa/pa.md | 72 ++++++++++++++++++++++++++------------------- gcc/configure | 54 ++++++++++++++++++++++++++++++++++ gcc/configure.in | 54 ++++++++++++++++++++++++++++++++++ 6 files changed, 172 insertions(+), 39 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 43483983794..cb3b086572f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ Tue Aug 19 09:34:57 1997 Jeffrey A Law (law@cygnus.com) + * configure.in: Turn on haifa by default for the PA. + * configure: Rebuilt. + * pa.c (override_options): Accept -mschedule=7200 option. + (pa_adjust_cost): No longer need to scale costs for newer + processors. + * pa.h (enum processor_type): Add PROCESSOR_7200. + * pa.md: Revamp scheduling parameters to work better with + haifa. Add scheduling parameters for the 7200. + * haifa-sched.c (move_insn): Reemit notes for SCHED_GROUP_P insns too. (schedule_block): When adjusting basic_block_{head,end}, account diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index a9288fc1ff6..93f7c1d21be 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -99,9 +99,14 @@ override_options () pa_cpu_string = "7100LC"; pa_cpu = PROCESSOR_7100LC; } + else if (! strcmp (pa_cpu_string, "7200")) + { + pa_cpu_string = "7200"; + pa_cpu = PROCESSOR_7200; + } else { - warning ("Unknown -mschedule= option (%s).\nValid options are 700, 7100 and 7100LC\n", pa_cpu_string); + warning ("Unknown -mschedule= option (%s).\nValid options are 700, 7100 and 7100LC and 7200\n", pa_cpu_string); } if (flag_pic && TARGET_PORTABLE_RUNTIME) @@ -3260,8 +3265,8 @@ pa_adjust_cost (insn, link, dep_insn, cost) { case TYPE_FPLOAD: /* This cost 3 cycles, not 2 as the md says for the - 700 and 7100. Note scaling of cost for 7100. */ - return cost + (pa_cpu == PROCESSOR_700) ? 1 : 2; + 700 and 7100. */ + return cost + 1; case TYPE_FPALU: case TYPE_FPMULSGL: @@ -3272,7 +3277,7 @@ pa_adjust_cost (insn, link, dep_insn, cost) case TYPE_FPSQRTDBL: /* In these important cases, we save one cycle compared to when flop instruction feed each other. */ - return cost - (pa_cpu == PROCESSOR_700) ? 1 : 2; + return cost - 1; default: return cost; @@ -3320,7 +3325,7 @@ pa_adjust_cost (insn, link, dep_insn, cost) preceding arithmetic operation has finished if the target of the fpload is any of the sources (or destination) of the arithmetic operation. */ - return cost - (pa_cpu == PROCESSOR_700) ? 1 : 2; + return cost - 1; default: return 0; @@ -3355,7 +3360,7 @@ pa_adjust_cost (insn, link, dep_insn, cost) preceding divide or sqrt operation has finished if the target of the ALU flop is any of the sources (or destination) of the divide or sqrt operation. */ - return cost - (pa_cpu == PROCESSOR_700) ? 2 : 4; + return cost - 2; default: return 0; @@ -3401,7 +3406,7 @@ pa_adjust_cost (insn, link, dep_insn, cost) preceding arithmetic operation has finished if the target of the fpload is the destination of the arithmetic operation. */ - return cost - (pa_cpu == PROCESSOR_700) ? 1 : 2; + return cost - 1; default: return 0; @@ -3436,7 +3441,7 @@ pa_adjust_cost (insn, link, dep_insn, cost) preceding divide or sqrt operation has finished if the target of the ALU flop is also the target of of the divide or sqrt operation. */ - return cost - (pa_cpu == PROCESSOR_700) ? 2 : 4; + return cost - 2; default: return 0; diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index daf63c7e24d..1f5e900907f 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -39,6 +39,7 @@ enum processor_type PROCESSOR_700, PROCESSOR_7100, PROCESSOR_7100LC, + PROCESSOR_7200 }; #define pa_cpu_attr ((enum attr_cpu)pa_cpu) diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 848567a5175..df71400502d 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -44,7 +44,7 @@ ;; ;; FIXME: Add 800 scheduling for completeness? -(define_attr "cpu" "700,7100,7100LC" (const (symbol_ref "pa_cpu_attr"))) +(define_attr "cpu" "700,7100,7100LC,7200" (const (symbol_ref "pa_cpu_attr"))) ;; Length (in # of insns). (define_attr "length" "" @@ -213,9 +213,6 @@ ;; floating point computations with non-floating point computations (fp loads ;; and stores are not fp computations). ;; -;; As with the alpha we multiply the ready delay by two to encourage -;; schedules which will allow the 7100/7150 to dual issue as many instructions -;; as possible. ;; Memory. Disregarding Cache misses, memory loads take two cycles; stores also ;; take two cycles, during which no Dcache operations should be scheduled. @@ -223,10 +220,10 @@ ;; all have the same memory characteristics if one disregards cache misses. (define_function_unit "pa7100memory" 1 0 (and (eq_attr "type" "load,fpload") - (eq_attr "cpu" "7100,7100LC")) 4 0) + (eq_attr "cpu" "7100,7100LC")) 2 0) (define_function_unit "pa7100memory" 1 0 (and (eq_attr "type" "store,fpstore") - (eq_attr "cpu" "7100,7100LC")) 4 4) + (eq_attr "cpu" "7100,7100LC")) 2 2) ;; The 7100/7150 has three floating-point units: ALU, MUL, and DIV. ;; Timings: @@ -249,16 +246,16 @@ (define_function_unit "pa7100fp_alu" 1 0 (and (eq_attr "type" "fpcc,fpalu") - (eq_attr "cpu" "7100")) 4 2) + (eq_attr "cpu" "7100")) 2 1) (define_function_unit "pa7100fp_mpy" 1 0 (and (eq_attr "type" "fpmulsgl,fpmuldbl") - (eq_attr "cpu" "7100")) 4 2) + (eq_attr "cpu" "7100")) 2 1) (define_function_unit "pa7100fp_div" 1 0 (and (eq_attr "type" "fpdivsgl,fpsqrtsgl") - (eq_attr "cpu" "7100")) 16 16) + (eq_attr "cpu" "7100")) 8 8) (define_function_unit "pa7100fp_div" 1 0 (and (eq_attr "type" "fpdivdbl,fpsqrtdbl") - (eq_attr "cpu" "7100")) 30 30) + (eq_attr "cpu" "7100")) 15 15) ;; To encourage dual issue we define function units corresponding to ;; the instructions which can be dual issued. This is a rather crude @@ -266,12 +263,12 @@ (define_function_unit "pa7100flop" 1 1 (and (eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl") - (eq_attr "cpu" "7100,7100LC")) 2 2) + (eq_attr "cpu" "7100")) 1 1) (define_function_unit "pa7100nonflop" 1 1 (and (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl") - (eq_attr "cpu" "7100")) 2 2) + (eq_attr "cpu" "7100")) 1 1) ;; Memory subsystem works just like 7100/7150 (except for cache miss times which @@ -305,41 +302,54 @@ (define_function_unit "pa7100LCfp_alu" 1 0 (and (eq_attr "type" "fpcc,fpalu") - (eq_attr "cpu" "7100LC")) 4 2) + (eq_attr "cpu" "7100LC,7200")) 2 1) (define_function_unit "pa7100LCfp_mpy" 1 0 (and (eq_attr "type" "fpmulsgl") - (eq_attr "cpu" "7100LC")) 4 2) + (eq_attr "cpu" "7100LC,7200")) 2 1) (define_function_unit "pa7100LCfp_mpy" 1 0 (and (eq_attr "type" "fpmuldbl") - (eq_attr "cpu" "7100LC")) 6 4) + (eq_attr "cpu" "7100LC,7200")) 3 2) (define_function_unit "pa7100LCfp_div" 1 0 (and (eq_attr "type" "fpdivsgl,fpsqrtsgl") - (eq_attr "cpu" "7100LC")) 16 16) + (eq_attr "cpu" "7100LC,7200")) 8 8) (define_function_unit "pa7100LCfp_div" 1 0 (and (eq_attr "type" "fpdivdbl,fpsqrtdbl") - (eq_attr "cpu" "7100LC")) 30 30) + (eq_attr "cpu" "7100LC,7200")) 15 15) ;; Define the various functional units for dual-issue. -;; The 7100LC shares the generic "flop" unit specification with the 7100/7150. -;; The 7100LC has two basic integer which allow dual issue of most integer -;; instructions. This needs further refinement to deal with the nullify, -;; carry/borrow possible the ldw/ldw stw/stw special dual issue cases, and -;; of course it needs to know about hte 2nd alu. -(define_function_unit "pa7100LCnonflop" 1 1 +;; There's only one floating point unit. +(define_function_unit "pa7100LCflop" 1 1 (and - (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl,load,fpload,store,fpstore,shift,nullshift") - (eq_attr "cpu" "7100LC")) 2 2) + (eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl") + (eq_attr "cpu" "7100LC,7200")) 1 1) -(define_function_unit "pa7100LCshifter" 1 1 +;; Shifts and memory ops actually execute in one of the integer +;; ALUs, but we can't really model that. +(define_function_unit "pa7100LCshiftmem" 1 1 (and - (eq_attr "type" "shift,nullshift") - (eq_attr "cpu" "7100LC")) 2 2) + (eq_attr "type" "shift,nullshift,load,fpload,store,fpstore") + (eq_attr "cpu" "7100LC,7200")) 1 1) -(define_function_unit "pa7100LCmem" 1 1 +;; We have two basic ALUs. +(define_function_unit "pa7100LCalu" 2 2 (and - (eq_attr "type" "load,fpload,store,fpstore") - (eq_attr "cpu" "7100LC")) 2 2) + (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl,load,fpload,store,fpstore,shift,nullshift") + (eq_attr "cpu" "7100LC,7200")) 1 1) + +;; I don't have complete information on the PA7200; however, most of +;; what I've heard makes it look like a 7100LC without the store-store +;; penalty. So that's how we'll model it. + +;; Memory. Disregarding Cache misses, memory loads and stores take +;; two cycles. Any special cases are handled in pa_adjust_cost. +(define_function_unit "pa7200memory" 1 0 + (and (eq_attr "type" "load,fpload,store,fpstore") + (eq_attr "cpu" "7200")) 2 0) + +;; I don't have detailed information on the PA7200 FP pipeline, so I +;; treat it just like the 7100LC pipeline. +;; Similarly for the multi-issue fake units. ;; Compare instructions. diff --git a/gcc/configure b/gcc/configure index 0db313f2d55..95ec01ef129 100755 --- a/gcc/configure +++ b/gcc/configure @@ -1790,36 +1790,57 @@ for machine in $build $host $target; do float_format=i32 ;; hppa1.1-*-pro*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi tm_file="pa/pa-pro.h ${tm_file} pa/pa-pro-end.h libgloss.h" xm_file=pa/xm-papro.h tmake_file=pa/t-pro ;; hppa1.1-*-osf*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-osf.h" use_collect2=yes fixincludes=Makefile.in ;; hppa1.1-*-rtems*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi tm_file="pa/pa-pro.h ${tm_file} pa/pa-pro-end.h libgloss.h pa/rtems.h" xm_file=pa/xm-papro.h tmake_file=pa/t-pro ;; hppa1.0-*-osf*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-osf.h" use_collect2=yes fixincludes=Makefile.in ;; hppa1.1-*-bsd*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi target_cpu_default=1 use_collect2=yes fixincludes=Makefile.in ;; hppa1.0-*-bsd*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi use_collect2=yes fixincludes=Makefile.in ;; hppa1.0-*-hpux7*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi tm_file="pa/pa-oldas.h ${tm_file} pa/pa-hpux7.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -1831,6 +1852,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.0-*-hpux8.0[0-2]*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-hpux.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -1844,6 +1868,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.1-*-hpux8.0[0-2]*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-hpux.h" xm_file=pa/xm-pahpux.h @@ -1858,6 +1885,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.1-*-hpux8*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-hpux.h" xm_file=pa/xm-pahpux.h @@ -1870,6 +1900,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.0-*-hpux8*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-hpux.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -1881,6 +1914,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.1-*-hpux10*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux10.h" xm_file=pa/xm-pahpux.h @@ -1893,6 +1929,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.0-*-hpux10*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux10.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -1904,6 +1943,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.1-*-hpux*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h" xm_file=pa/xm-pahpux.h @@ -1916,6 +1958,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.0-*-hpux*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -1927,6 +1972,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.1-*-hiux*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h" xm_file=pa/xm-pahpux.h @@ -1939,6 +1987,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.0-*-hiux*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -1950,6 +2001,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa*-*-lites*) + if [ x$enable_haifa != xno ]; then + enable_haifa=yes + fi target_cpu_default=1 use_collect2=yes fixincludes=Makefile.in diff --git a/gcc/configure.in b/gcc/configure.in index 562d3e48bc6..e906ae90b30 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -456,36 +456,57 @@ for machine in $build $host $target; do float_format=i32 ;; hppa1.1-*-pro*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi tm_file="pa/pa-pro.h ${tm_file} pa/pa-pro-end.h libgloss.h" xm_file=pa/xm-papro.h tmake_file=pa/t-pro ;; hppa1.1-*-osf*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-osf.h" use_collect2=yes fixincludes=Makefile.in ;; hppa1.1-*-rtems*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi tm_file="pa/pa-pro.h ${tm_file} pa/pa-pro-end.h libgloss.h pa/rtems.h" xm_file=pa/xm-papro.h tmake_file=pa/t-pro ;; hppa1.0-*-osf*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-osf.h" use_collect2=yes fixincludes=Makefile.in ;; hppa1.1-*-bsd*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi target_cpu_default=1 use_collect2=yes fixincludes=Makefile.in ;; hppa1.0-*-bsd*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi use_collect2=yes fixincludes=Makefile.in ;; hppa1.0-*-hpux7*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi tm_file="pa/pa-oldas.h ${tm_file} pa/pa-hpux7.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -497,6 +518,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.0-*-hpux8.0[[0-2]]*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-hpux.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -510,6 +534,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.1-*-hpux8.0[[0-2]]*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-hpux.h" xm_file=pa/xm-pahpux.h @@ -524,6 +551,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.1-*-hpux8*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-hpux.h" xm_file=pa/xm-pahpux.h @@ -536,6 +566,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.0-*-hpux8*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-hpux.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -547,6 +580,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.1-*-hpux10*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux10.h" xm_file=pa/xm-pahpux.h @@ -559,6 +595,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.0-*-hpux10*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux10.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -570,6 +609,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.1-*-hpux*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h" xm_file=pa/xm-pahpux.h @@ -582,6 +624,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.0-*-hpux*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -593,6 +638,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.1-*-hiux*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi target_cpu_default=1 tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h" xm_file=pa/xm-pahpux.h @@ -605,6 +653,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa1.0-*-hiux*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h" xm_file=pa/xm-pahpux.h xmake_file=pa/x-pa-hpux @@ -616,6 +667,9 @@ for machine in $build $host $target; do use_collect2=yes ;; hppa*-*-lites*) + if [[ x$enable_haifa != xno ]]; then + enable_haifa=yes + fi target_cpu_default=1 use_collect2=yes fixincludes=Makefile.in -- 2.30.2