This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: New approach to --with-cpu, take 6


On Fri, Aug 02, 2002 at 04:17:51PM -0400, Daniel Jacobowitz wrote:
> On Fri, Aug 02, 2002 at 12:19:43PM -0400, Daniel Jacobowitz wrote:
> > On Thu, Aug 01, 2002 at 04:58:06PM -0400, John David Anglin wrote:
> > > > OK?  More comments?
> > > 
> > > There are a couple of new warnings on the PA when no default scheduling
> > > model is specified:
> > > 
> > > gcc -DIN_GCC    -g  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  -DHAVE_CONFIG_H    -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/config -I../../gcc/gcc/../include \
> > >   -DSTANDARD_STARTFILE_PREFIX=\"../../../\" -DSTANDARD_EXEC_PREFIX=\"/home/dave/opt/gnu/lib/gcc-lib/\" -DDEFAULT_TARGET_VERSION=\"3.3\" -DDEFAULT_TARGET_MACHINE=\"hppa-linux\" -DSTANDARD_BINDIR_PREFIX=\"/home/dave/opt/gnu/bin/\" -DTOOLDIR_BASE_PREFIX=\"../../../../\" `test "X${SHLIB_LINK}" = "X" || test "yes" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` `test "X${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"` \
> > >   -c ../../gcc/gcc/gcc.c -o gcc.o)
> > > ../../gcc/gcc/gcc.c:671: warning: string length `536' is greater than the length `509' ISO C89 compilers are required to support
> > > ../../gcc/gcc/gcc.c: In function `process_command':
> > > ../../gcc/gcc/gcc.c:3822: warning: comparison between signed and unsigned
> > > ../../gcc/gcc/gcc.c:3957: warning: comparison between signed and unsigned
> > > ../../gcc/gcc/gcc.c: At top level:
> > > ../../gcc/gcc/gcc.c:1002: warning: `option_present' defined but not used
> > > ../../gcc/gcc/gcc.c:1028: warning: `add_option' defined but not used
> > 
> > What does one do with a static function that is only conditionally
> > called?  I suppose I could wrap it in all the conditions under which it
> > might be called, but that seems awkward.
> 
> One uses ATTRIBUTE_UNUSED.  Here's take five; the warnings are gone,
> the string concatenation is gone, and the MIPS code now behaves exactly
> the same as cc1 and comments on that.

Pounded on this patch for another week, and it worked everywhere except
for ARM canadian-cross builds; I forgot to allow no --with-cpu value
for that platform.  Here's a revision with that fixed.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2002-08-10  Daniel Jacobowitz  <drow@mvista.com>

	* Makefile.in (DRIVER_DEFINES): Add @target_default_options@
	* configure.in: Add @target_default_options@.  Document --with-cpu,
	--with-arch, --with-tune, --with-schedule, and --with-float.
	* config.gcc: Reorganize $with_cpu logic.  Set
	target_default_options according to the default CPU, $with_cpu,
	$with_arch, $with_tune, $with_schedule, and $with_float.
	Recognize legal scheduling models for HPPA.
	* config/mips/mips.h (TARGET_DEFAULT_ARCH_P)
	(TARGET_DEFAULT_FLOAT_P): New macros.
	* gcc.c (default_options, add_option, option_present)
	(last_option_present): New functions.
	(process_command): Call default_options.
	* doc/install.texi: Update --with-cpu documentation.  Mention
	--with-arch, --with-schedule, --with-tune, and --with-float.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.930
diff -u -p -r1.930 Makefile.in
--- Makefile.in	9 Aug 2002 08:51:27 -0000	1.930
+++ Makefile.in	10 Aug 2002 15:18:11 -0000
@@ -1262,6 +1262,7 @@ c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM
 # Language-independent files.
 
 DRIVER_DEFINES = \
+  @target_default_options@ \
   -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
   -DDEFAULT_TARGET_VERSION=\"$(version)\" \
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.237
diff -u -p -r1.237 config.gcc
--- config.gcc	6 Aug 2002 15:29:23 -0000	1.237
+++ config.gcc	10 Aug 2002 15:18:13 -0000
@@ -2754,173 +2754,190 @@ case $machine in
 	;;
 esac
 
-# Distinguish i[34567]86
-# Also, do not run mips-tfile on MIPS if using gas.
-# Process --with-cpu= for PowerPC/rs6000
-target_cpu_default2=
-case $machine in
-i486-*-*)
-	target_cpu_default2=TARGET_CPU_DEFAULT_i486
-	;;
-i586-*-*)
-	case $target_alias in
-		k6_2-*)
-			target_cpu_default2=TARGET_CPU_DEFAULT_k6_2
-			;;
-		k6_3-*)
-			target_cpu_default2=TARGET_CPU_DEFAULT_k6_3
-			;;
-		k6-*)
-			target_cpu_default2=TARGET_CPU_DEFAULT_k6
-			;;
-		pentium_mmx-*)
-			target_cpu_default2=TARGET_CPU_DEFAULT_pentium_mmx
-			;;
-		*)
-			target_cpu_default2=TARGET_CPU_DEFAULT_pentium
-			;;
-	esac
-	;;
-i686-*-* | i786-*-*)
-	case $target_alias in
-		athlon_xp-*|athlon_mp-*|athlon_4-*)
-			target_cpu_default2=TARGET_CPU_DEFAULT_athlon_sse
-			;;
-		athlon_tbird-*|athlon-*)
-			target_cpu_default2=TARGET_CPU_DEFAULT_athlon
-			;;
-		pentium2-*)
-			target_cpu_default2=TARGET_CPU_DEFAULT_pentium2
-			;;
-		pentium3-*)
-			target_cpu_default2=TARGET_CPU_DEFAULT_pentium3
-			;;
-		pentium4-*)
-			target_cpu_default2=TARGET_CPU_DEFAULT_pentium4
-			;;
-		*)
-			target_cpu_default2=TARGET_CPU_DEFAULT_pentiumpro
+if test x$pass2done = xyes
+then
+	case "x$with_cpu" in
+		xyes | xno)
+			echo "--with-cpu must be passed a value" 1>&2
+			exit 1
 			;;
 	esac
-	;;
-x86_64-*-*)
-	# We should have hammer chip here, but it does not exist yet and
-	# thus it is not supported.  Athlon_SSE is probably equivalent feature
-	# wise to hammer from our point of view except for 64bit mode.
-	target_cpu_default2=TARGET_CPU_DEFAULT_athlon_sse
-	;;
-alpha*-*-*)
-	case $machine in
-		alphaev6[78]*)
-			target_cpu_default2="MASK_CPU_EV6|MASK_BWX|MASK_MAX|MASK_FIX|MASK_CIX"
-			;;
-		alphaev6*)
-			target_cpu_default2="MASK_CPU_EV6|MASK_BWX|MASK_MAX|MASK_FIX"
-			;;
-		alphapca56*)
-			target_cpu_default2="MASK_CPU_EV5|MASK_BWX|MASK_MAX"
-			;;
-		alphaev56*)
-			target_cpu_default2="MASK_CPU_EV5|MASK_BWX"
+
+	# If there is no $with_cpu option, try to infer one from ${machine}.
+	if test x$with_cpu = x
+	then
+		case $machine in
+		i486-*-*)
+			with_cpu=i486
+			;;
+		i586-*-*)
+			case $target_alias in
+			k6_2-*)
+				with_cpu=k6-2
+				;;
+			k6_3-*)
+				with_cpu=k6-3
+				;;
+			k6-*)
+				with_cpu=k6
+				;;
+			pentium_mmx-*)
+				with_cpu=pentium-mmx
+				;;
+			*)
+				with_cpu=pentium
+				;;
+			esac
+			;;
+		i686-*-* | i786-*-*)
+			case $target_alias in
+			athlon_xp-*|athlon_mp-*|athlon_4-*)
+				with_cpu=athlon-4
+				;;
+			athlon_tbird-*|athlon-*)
+				with_cpu=athlon
+				;;
+			pentium2-*)
+				with_cpu=pentium2
+				;;
+			pentium3-*)
+				with_cpu=pentium3
+				;;
+			pentium4-*)
+				with_cpu=pentium4
+				;;
+			*)
+				with_cpu=pentiumpro
+				;;
+			esac
+			;;
+		x86_64-*-*)
+			# We should have hammer chip here, but it does not
+			# exist yet and thus it is not supported.  Athlon_SSE
+			# is probably equivalent feature wise to hammer from
+			# our point of view except for 64bit mode.
+			with_cpu=athlon-sse
+			;;
+		alpha*-*-*)
+			case $machine in
+			alphaev6[78]*)
+				with_cpu=ev67
+				;;
+			alphaev6*)
+				with_cpu=ev6
+				;;
+			alphapca56*)
+				with_cpu=pca56
+				;;
+			alphaev56*)
+				with_cpu=ev56
+				;;
+			alphaev5*)
+				with_cpu=ev5
+				;;
+			esac
 			;;
-		alphaev5*)
-			target_cpu_default2="MASK_CPU_EV5"
+		sparc*-*-*)
+			with_cpu="`echo $machine | sed 's/-.*$//'`"
 			;;
-	esac
+		esac
+	fi
 
-	if test x$gas = xyes
-	then
-		if test "$target_cpu_default2" = ""
+	case "$machine" in
+	alpha*-*-*)
+		if test x$gas = xyes
 		then
-			target_cpu_default2="MASK_GAS"
-		else
-			target_cpu_default2="${target_cpu_default2}|MASK_GAS"
+			if test "$target_cpu_default2" = ""
+			then
+				target_cpu_default2="MASK_GAS"
+			else
+				target_cpu_default2="${target_cpu_default2}|MASK_GAS"
+			fi
 		fi
-	fi
-	;;
-arm*-*-*)
-	case "x$with_cpu" in
-		x)
-			# The most generic
-			target_cpu_default2="TARGET_CPU_generic"
-			;;
-
+		;;
+	arm*-*-*)
+		# Start with the most generic.
+		target_cpu_default2="TARGET_CPU_generic"
 		# Distinguish cores, and major variants
 		# arm7m doesn't exist, but D & I don't affect code
-		xarm[236789] | xarm250 | xarm[67][01]0 \
+		case "x$with_cpu" in
+		x | xarm[236789] | xarm250 | xarm[67][01]0 \
 		| xarm7m | xarm7dm | xarm7dmi | xarm[79]tdmi \
 		| xarm7100 | xarm7500 | xarm7500fe | xarm810 \
 		| xxscale \
 		| xstrongarm | xstrongarm110 | xstrongarm1100)
-			target_cpu_default2="TARGET_CPU_$with_cpu"
+			# OK
 			;;
 
-		xyes | xno)
-			echo "--with-cpu must be passed a value" 1>&2
+		*)
+			echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
 			exit 1
 			;;
-
-		*)
-			if test x$pass2done = xyes
-			then
-				echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
+		esac
+		;;
+	hppa*-*-* | parisc*-*-*)
+		if test x$gas = xyes
+		then
+			target_cpu_default2="MASK_GAS|MASK_JUMP_IN_DELAY"
+		fi
+		case ".$with_schedule" in
+			.700 | .7100 | .7100LC | .7200 | .7300 | .8000)
+				;;
+			.)
+				case $machine in
+					hppa1* | parisc1*)
+						# Override default PA8000
+						# scheduling model.
+						with_schedule=7100LC
+						;;
+				esac
+				;;
+			*)
+				echo "Unknown cpu used with --with-schedule=$with_schedule" 1>&2
 				exit 1
+				;;
+		esac
+		;;
+	mips*-*-*)
+		case $machine in
+		mips*-*-ecoff* | mips*-*-elf*)
+			if test x$gas = xyes
+			then
+				if test x$gnu_ld = xyes
+				then
+					target_cpu_default2="MASK_GAS|MASK_SPLIT_ADDR"
+				else
+					target_cpu_default2="MASK_GAS"
+				fi
 			fi
 			;;
-	esac
-	;;
-
-hppa*-*-* | parisc*-*-*)
-	if test x$gas = xyes
-	then
-		target_cpu_default2="MASK_GAS|MASK_JUMP_IN_DELAY"
-	fi
-	case $machine in
-		hppa1* | parisc1*)
-			tm_defines="TARGET_SCHED_DEFAULT=\\\"7100LC\\\""
-			;;
-	esac
-	;;
-mips*-*-*)
-	case $machine in
-	mips*-*-ecoff* | mips*-*-elf*)
-		if test x$gas = xyes
-		then
-			if test x$gnu_ld = xyes
+		mips*-*-*)
+			if test x$gas = xyes
 			then
-				target_cpu_default2="MASK_GAS|MASK_SPLIT_ADDR"
-			else
 				target_cpu_default2="MASK_GAS"
 			fi
-		fi
-		;;
-	mips*-*-*)
-		if test x$gas = xyes
+			;;
+		esac
+		case $machine in
+			mips*el-*-*)
+				tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
+				;;
+		esac
+		if test "x$enable_gofast" = xyes
 		then
-			target_cpu_default2="MASK_GAS"
+			tm_defines="INIT_SUBTARGET_OPTABS=INIT_GOFAST_OPTABS $tm_defines"
+			tm_file="gofast.h $tm_file"
+			tmake_file="mips/t-gofast $tmake_file"
+		else
+			tmake_file="mips/t-mips $tmake_file"
 		fi
 		;;
-	esac
-	case $machine in
-		mips*el-*-*)
-			tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
-			;;
-	esac
-	if test "x$enable_gofast" = xyes
-	then
-		tm_defines="INIT_SUBTARGET_OPTABS=INIT_GOFAST_OPTABS $tm_defines"
-		tm_file="gofast.h $tm_file"
-		tmake_file="mips/t-gofast $tmake_file"
-	else
-		tmake_file="mips/t-mips $tmake_file"
-	fi
-	;;
-powerpc*-*-* | rs6000-*-*)
-        if test x$enable_altivec = xyes
-        then
-                tm_file="$tm_file rs6000/altivec-defs.h"
-        fi
-	case "x$with_cpu" in
+	powerpc*-*-* | rs6000-*-*)
+        	if test x$enable_altivec = xyes
+	        then
+        	        tm_file="$tm_file rs6000/altivec-defs.h"
+	        fi
+		case "x$with_cpu" in
 		x)
 			;;
 
@@ -2935,49 +2952,49 @@ powerpc*-*-* | rs6000-*-*)
 			target_cpu_default2="\\\"$with_cpu\\\""
 			;;
 
-		xyes | xno)
-			echo "--with-cpu must be passed a value" 1>&2
-			exit 1
-			;;
-
 		*)
-			if test x$pass2done = xyes
-			then
-				echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
-				exit 1
-			fi
-			;;
-	esac
-	c_target_objs="${c_target_objs} rs6000-c.o"
-	cxx_target_objs="${cxx_target_objs} rs6000-c.o"
-	tmake_file="${tmake_file} rs6000/t-rs6000-c-rule"
-	;;
-sparc*-*-*)
-	case ".$with_cpu" in
-		.)
-			target_cpu_default2=TARGET_CPU_"`echo $machine | sed 's/-.*$//'`"
+			echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
+			exit 1
 			;;
+		esac
+		c_target_objs="${c_target_objs} rs6000-c.o"
+		cxx_target_objs="${cxx_target_objs} rs6000-c.o"
+		tmake_file="${tmake_file} rs6000/t-rs6000-c-rule"
+		;;
+	sparc*-*-*)
+		# $with_cpu won't be empty; a default will be set above.
+		case .$with_cpu in
 		.supersparc | .hypersparc | .ultrasparc | .v7 | .v8 | .v9)
 			target_cpu_default2="TARGET_CPU_$with_cpu"
 			;;
 		*)
-			if test x$pass2done = xyes
-			then
-				echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
-				exit 1
-			fi
+			echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
+			exit 1
 			;;
+		esac
+		;;
 	esac
-	;;
-esac
 
-if test "$target_cpu_default2" != ""
-then
-	if test "$target_cpu_default" != ""
+	t=
+	for option in cpu arch tune schedule float
+	do
+		val=`eval 'echo $with_'$option`
+		if test -n "$val"; then
+			upper=`echo $option | tr '[a-z]' '[A-Z]'`
+			option="TARGET_DEFAULT_OPTION_$upper"
+			t="${t} -D${option}=\"\\\"${val}\\\"\""
+		fi
+	done
+	target_default_options="${t}"
+
+	if test "$target_cpu_default2" != ""
 	then
-		target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
-	else
-		target_cpu_default=$target_cpu_default2
+		if test "$target_cpu_default" != ""
+		then
+			target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
+		else
+			target_cpu_default=$target_cpu_default2
+		fi
 	fi
 fi
 
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.616
diff -u -p -r1.616 configure.in
--- configure.in	9 Aug 2002 08:51:26 -0000	1.616
+++ configure.in	10 Aug 2002 15:18:22 -0000
@@ -136,6 +136,20 @@ AC_ARG_WITH(elf,
 elf="$with_elf",
 elf=no)
 
+# With a particular CPU
+AC_ARG_WITH(cpu,
+[  --with-cpu              default to -mcpu=CPU],,)
+AC_ARG_WITH(arch,
+[  --with-arch             default to -march=CPU],,)
+AC_ARG_WITH(schedule,
+[  --with-schedule         default to -mschedule=CPU],,)
+AC_ARG_WITH(tune,
+[  --with-tune             default to -mtune=CPU],,)
+
+# Default floating-point setting
+AC_ARG_WITH(float,
+[  --with-float            default to the specified type of floating point],,)
+
 # Specify the local prefix
 local_prefix=
 AC_ARG_WITH(local-prefix,
@@ -2716,6 +2730,7 @@ AC_SUBST(target_alias)
 AC_SUBST(c_target_objs)
 AC_SUBST(cxx_target_objs)
 AC_SUBST(target_cpu_default)
+AC_SUBST(target_default_options)
 
 AC_SUBST_FILE(target_overrides)
 AC_SUBST_FILE(host_overrides)
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.335
diff -u -p -r1.335 gcc.c
--- gcc.c	9 Aug 2002 06:19:08 -0000	1.335
+++ gcc.c	10 Aug 2002 15:18:27 -0000
@@ -991,6 +991,139 @@ static const struct option_map option_ma
  };
 
 
+static const char *last_option_present PARAMS ((int, const char *const *,
+						const char *))
+  ATTRIBUTE_UNUSED;
+static int option_present PARAMS ((int, const char *const *, const char *))
+  ATTRIBUTE_UNUSED;
+static void add_option PARAMS ((int *, const char *const **, const char *))
+  ATTRIBUTE_UNUSED;
+static void default_options PARAMS ((int *, const char *const **));
+
+static const char *
+last_option_present (argc, argv, option)
+     int argc;
+     const char *const *argv;
+     const char *option;
+{
+  const char *const *cur_arg = &argv[argc - 1];
+
+  while (cur_arg != argv)
+    {
+      if (strncmp (*cur_arg, option, strlen (option)) == 0)
+	return *cur_arg;
+      cur_arg --;
+    }
+
+  return NULL;
+}
+
+static int
+option_present (argc, argv, option)
+     int argc;
+     const char *const *argv;
+     const char *option;
+{
+  int i;
+  int len;
+
+  len = strlen (option);
+
+  for (i = 0; i < argc; i++)
+    if (option[len - 1] == '=')
+      {
+	if (strncmp (argv[i], option, len) == 0)
+	  return 1;
+      }
+    else
+      {
+	if (strcmp (argv[i], option) == 0)
+	  return 1;
+      }
+
+  return 0;
+}
+
+static void
+add_option (argcp, argvp, option)
+     int *argcp;
+     const char *const **argvp;
+     const char *option;
+{
+  const char **newargv = (const char **) xmalloc ((*argcp + 2) * sizeof (char *));
+  int i;
+
+  newargv[0] = (*argvp)[0];
+  newargv[1] = option;
+  for (i = 1; i < *argcp; i++)
+    newargv[i + 1] = (*argvp)[i];
+  newargv[i + 1] = NULL;
+
+  *argvp = newargv;
+  (*argcp)++;
+}
+
+#ifndef TARGET_DEFAULT_ARCH_P
+#define TARGET_DEFAULT_ARCH_P() (! option_present (*argcp, *argvp, "-march="))
+#endif
+
+#ifndef TARGET_DEFAULT_CPU_P
+#define TARGET_DEFAULT_CPU_P() (! option_present (*argcp, *argvp, "-mcpu="))
+#endif
+
+#ifndef TARGET_DEFAULT_SCHEDULE_P
+#define TARGET_DEFAULT_SCHEDULE_P() (! option_present (*argcp, *argvp, \
+						       "-mschedule="))
+#endif
+
+#ifndef TARGET_DEFAULT_TUNE_P
+#define TARGET_DEFAULT_TUNE_P() (! option_present (*argcp, *argvp, "-mtune="))
+#endif
+
+#ifndef TARGET_DEFAULT_FLOAT_P
+#define TARGET_DEFAULT_FLOAT_P() (! option_present (*argcp, *argvp, \
+						    "-msoft-float") \
+				  && ! option_present (*argcp, *argvp, \
+						       "-mhard-float"))
+#endif
+
+static void
+default_options (argcp, argvp)
+     int *argcp ATTRIBUTE_UNUSED;
+     const char *const **argvp ATTRIBUTE_UNUSED;
+{
+#ifdef TARGET_DEFAULT_OPTION_ARCH
+  if (TARGET_DEFAULT_ARCH_P ())
+    add_option (argcp, argvp, concat ("-march=", TARGET_DEFAULT_OPTION_ARCH,
+				      NULL));
+#endif
+
+#ifdef TARGET_DEFAULT_OPTION_CPU
+  if (TARGET_DEFAULT_CPU_P ())
+    add_option (argcp, argvp, concat ("-mcpu=", TARGET_DEFAULT_OPTION_CPU,
+				      NULL));
+#endif
+
+#ifdef TARGET_DEFAULT_OPTION_SCHEDULE
+  if (TARGET_DEFAULT_SCHEDULE_P ())
+    add_option (argcp, argvp, concat ("-mschedule=",
+				      TARGET_DEFAULT_OPTION_SCHEDULE, NULL));
+#endif
+
+#ifdef TARGET_DEFAULT_OPTION_TUNE
+  if (TARGET_DEFAULT_TUNE_P ())
+    add_option (argcp, argvp, concat ("-mtune=", TARGET_DEFAULT_OPTION_TUNE,
+				      NULL));
+#endif
+
+#ifdef TARGET_DEFAULT_OPTION_FLOAT
+  if (TARGET_DEFAULT_FLOAT_P ())
+    add_option (argcp, argvp, concat ("-m", TARGET_DEFAULT_OPTION_FLOAT, "-float",
+				      NULL));
+#endif
+}
+
+
 #ifdef TARGET_OPTION_TRANSLATE_TABLE
 static const struct {
   const char *const option_found;
@@ -3375,6 +3508,9 @@ process_command (argc, argv)
 
   /* Convert new-style -- options to old-style.  */
   translate_options (&argc, &argv);
+
+  /* Add any default options.  */
+  default_options (&argc, &argv);
 
   /* Do language-specific adjustment/addition of flags.  */
   lang_specific_driver (&argc, &argv, &added_libraries);
Index: config/mips/mips.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.h,v
retrieving revision 1.211
diff -u -p -r1.211 mips.h
--- config/mips/mips.h	7 Aug 2002 02:57:53 -0000	1.211
+++ config/mips/mips.h	10 Aug 2002 15:18:34 -0000
@@ -746,6 +746,19 @@ extern void		sbss_section PARAMS ((void)
       N_("Specify cache flush function")},				\
 }
 
+/* This is not quite ideal.  The last -mips<N> option specified wins, even
+   though -mips16 is orthogonal to the other options.  Handle the current
+   status quo for now.  */
+#define TARGET_DEFAULT_ARCH_P() \
+  (! option_present (*argcp, *argvp, "-march=") \
+   && (! last_option_present (*argcp, *argvp, "-mips") \
+       || !strcmp (last_option_present (*argcp, *argvp, "-mips"), "-mips16")))
+
+#define TARGET_DEFAULT_FLOAT_P() \
+  (! option_present (*argcp, *argvp, "-msoft-float") \
+   && ! option_present (*argcp, *argvp, "-mhard-float") \
+   && ! option_present (*argcp, *argvp, "-msingle-float"))
+
 /* This is meant to be redefined in the host dependent files.  */
 #define SUBTARGET_TARGET_OPTIONS
 
Index: doc/install.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/install.texi,v
retrieving revision 1.131
diff -u -p -r1.131 install.texi
--- doc/install.texi	8 Aug 2002 09:10:39 -0000	1.131
+++ doc/install.texi	10 Aug 2002 15:18:38 -0000
@@ -667,11 +667,24 @@ Microsoft Win32 API thread support.
 
 @item --with-cpu=@var{cpu}
 Specify which cpu variant the
-compiler should generate code for by default.  This is currently
-only supported on the some ports, specifically arm, powerpc, and
-SPARC@.  If configure does not recognize the model name (e.g.@: arm700,
-603e, or ultrasparc) you provide, please check the configure script
-for a complete list of supported models.
+compiler should generate code for by default.  @var{cpu}
+will be used as the default value of the @code{-mcpu=} switch.
+This option is only supported on some ports, including arm, i386, powerpc,
+and SPARC@.
+
+@item --with-schedule=@var{cpu}
+@itemx --with-arch=@var{cpu}
+@itemx --with-tune=@var{cpu}
+These configure options provide default values for the @code{-mschedule=},
+@code{-march=}, and @code{-mtune=} options, respectively.  As with
+@code{--with-cpu} the legal values of @var{CPU} depend on the port; these
+options are not valid for all ports, only those which accept the respective
+options.
+
+@item --with-float=@var{type}
+Specify the default form of floating point.  The normal choices are ``hard''
+and ``soft''.  Which (if any) choices are recognized depends on the port;
+for instance, MIPS also recognizes ``single''.
 
 @item --enable-altivec
 Specify that the target supports AltiVec vector enhancements.  This


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]