Mechanism to configure default scheduling model on PA

John David Anglin dave@hiauly1.hia.nrc.ca
Thu May 30 21:26:00 GMT 2002


The default scheduling model was changed recently from that for the 7100
processor to that for the 8000 processors.  This change was not particularly
suitable for older hardware.

This patch introduces a mechanism to configure the default scheduling
model.  The 700 model is used for pa1.0 targets, the 7100 model is
used for pa1.1 targets, and the 8000 model is used for all other
targets (ie., it's still the default).  The sophisticated user
can define TARGET_SCHED_DEFAULT in BOOT_CFLAGS if some other default
is desired.

The patch has been tested on hppa1.1-hp-hpux10.20, hppa2.0w-hp-hpux11.11
and hppa-linux.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2002-05-17  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* config.gcc (tm_file): Prefix pa/pa-700.h to tm_file list for PA1.0
	architecture and pa/pa-7100.h for PA1.1 architecture, respectively.
	* pa/pa.c (override_options): Use TARGET_SCHED_DEFAULT to select
	default scheduling model.
	* pa/pa.h (TARGET_SCHED_DEFAULT): Define if not defined to "8000".
	* pa/pa-700.h (TARGET_SCHED_DEFAULT): New file for "700" scheduling.
	* pa/pa-7100.h (TARGET_SCHED_DEFAULT): New file for "7100" scheduling.
	* doc/install.texi (hppa*-*-*): Document default scheduling.

Index: config.gcc
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.193
diff -u -3 -p -r1.193 config.gcc
--- config.gcc	11 May 2002 16:25:03 -0000	1.193
+++ config.gcc	15 May 2002 15:19:33 -0000
@@ -3597,6 +3597,14 @@ hppa*-*-* | parisc*-*-*)
 	then
 		target_cpu_default2="MASK_GAS|MASK_JUMP_IN_DELAY"
 	fi
+	case $machine in
+		hppa1.0* | parisc1.0*)
+			tm_file="pa/pa-700.h ${tm_file}"
+			;;
+		hppa1.1* | parisc1.1*)
+			tm_file="pa/pa-7100.h ${tm_file}"
+			;;
+	esac
 	;;
 
 mips*-*-ecoff* | mips*-*-elf*)
Index: config/pa/pa.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.158
diff -u -3 -p -r1.158 pa.c
--- config/pa/pa.c	15 May 2002 03:02:23 -0000	1.158
+++ config/pa/pa.c	15 May 2002 15:19:34 -0000
@@ -188,38 +188,39 @@ struct gcc_target targetm = TARGET_INITI
 void
 override_options ()
 {
-  /* Default to 8000 scheduling.  */
-  if (pa_cpu_string && ! strcmp (pa_cpu_string, "7100"))
+  if (pa_cpu_string == NULL)
+    pa_cpu_string = TARGET_SCHED_DEFAULT;
+
+  if (! strcmp (pa_cpu_string, "8000"))
+    {
+      pa_cpu_string = "8000";
+      pa_cpu = PROCESSOR_8000;
+    }
+  else if (! strcmp (pa_cpu_string, "7100"))
     {
       pa_cpu_string = "7100";
       pa_cpu = PROCESSOR_7100;
     }
-  else if (pa_cpu_string && ! strcmp (pa_cpu_string, "700"))
+  else if (! strcmp (pa_cpu_string, "700"))
     {
       pa_cpu_string = "700";
       pa_cpu = PROCESSOR_700;
     }
-  else if (pa_cpu_string && ! strcmp (pa_cpu_string, "7100LC"))
+  else if (! strcmp (pa_cpu_string, "7100LC"))
     {
       pa_cpu_string = "7100LC";
       pa_cpu = PROCESSOR_7100LC;
     }
-  else if (pa_cpu_string && ! strcmp (pa_cpu_string, "7200"))
+  else if (! strcmp (pa_cpu_string, "7200"))
     {
       pa_cpu_string = "7200";
       pa_cpu = PROCESSOR_7200;
     }
-  else if (pa_cpu_string && ! strcmp (pa_cpu_string, "7300"))
+  else if (! strcmp (pa_cpu_string, "7300"))
     {
       pa_cpu_string = "7300";
       pa_cpu = PROCESSOR_7300;
     }
-  else if (pa_cpu_string == NULL
-	   || ! strcmp (pa_cpu_string, "8000"))
-    {
-      pa_cpu_string = "8000";
-      pa_cpu = PROCESSOR_8000;
-    }
   else
     {
       warning ("unknown -mschedule= option (%s).\nValid options are 700, 7100, 7100LC, 7200, 7300, and 8000\n", pa_cpu_string);
Index: config/pa/pa.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/pa/pa.h,v
retrieving revision 1.152
diff -u -3 -p -r1.152 pa.h
--- config/pa/pa.h	8 May 2002 23:10:59 -0000	1.152
+++ config/pa/pa.h	15 May 2002 15:19:35 -0000
@@ -208,6 +208,10 @@ extern int target_flags;
 #define TARGET_CPU_DEFAULT 0
 #endif
 
+#ifndef TARGET_SCHED_DEFAULT
+#define TARGET_SCHED_DEFAULT "8000"
+#endif
+
 #define TARGET_OPTIONS			\
 {					\
   { "schedule=",	&pa_cpu_string, "Specify CPU for scheduling purposes" },\
--- /dev/null	Sun Jan  6 15:06:58 2002
+++ config/pa/pa-700.h	Wed May 15 07:28:17 2002
@@ -0,0 +1,24 @@
+/* Definitions of target machine for GNU compiler, for HPs using the
+   PA700 scheduling model.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#ifndef TARGET_SCHED_DEFAULT
+#define TARGET_SCHED_DEFAULT "700"
+#endif
--- /dev/null	Sun Jan  6 15:06:58 2002
+++ config/pa/pa-7100.h	Wed May 15 07:29:44 2002
@@ -0,0 +1,24 @@
+/* Definitions of target machine for GNU compiler, for HPs using the
+   PA7100 scheduling model.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#ifndef TARGET_SCHED_DEFAULT
+#define TARGET_SCHED_DEFAULT "7100"
+#endif
Index: doc/install.texi
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/doc/install.texi,v
retrieving revision 1.116
diff -u -3 -p -r1.116 install.texi
--- doc/install.texi	14 May 2002 10:38:46 -0000	1.116
+++ doc/install.texi	15 May 2002 17:15:33 -0000
@@ -2131,6 +2131,19 @@ If you wish to use pa-risc 2.0 architect
 the HP assembler, gas/binutils 2.11 or a recent
 @uref{ftp://sources.redhat.com/pub/binutils/snapshots,,snapshot of gas}.
 
+There are three default scheduling models for instructions.  They
+are PROCESSOR_700, PROCESSOR_7100 and PROCESSOR_8000.  They are selected
+based on the the pa-risc architecture specified for the target machine
+when configuring.  PROCESSOR_8000 is the default model.  PROCESSOR_700
+and PROCESSOR_7100 are selected by specifying either @samp{hppa1.0} or
+@samp{hppa1.1}, respectively.
+
+The PROCESSOR_8000 model is not well suited to older processors.  Thus,
+it is important to completely specify the machine architecture when
+configuring if you want a model other than PROCESSOR_8000.  The macro
+TARGET_SCHED_DEFAULT can be defined in BOOT_CFLAGS if a different
+default scheduling model is desired.
+
 More specific information to @samp{hppa*-hp-hpux*} targets follows.
 
 @html



More information about the Gcc-patches mailing list