This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Updated --with-cpu patch, v12, part 3/3
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: zack at codesourcery dot com
- Date: Mon, 19 May 2003 18:33:05 -0400
- Subject: Re: Updated --with-cpu patch, v12, part 3/3
- References: <20030512225727.GA19286@nevyn.them.org>
On Mon, May 12, 2003 at 06:57:27PM -0400, Daniel Jacobowitz wrote:
> This is an update to the --with-cpu patch I posted some months ago. It's
> evolved and simplified quite a lot, and I think the result is much nicer
> than any previous version.
And the last part. I don't have anything to say about it that I
haven't already said. The config.gcc changes are still hairy, but much
more readable, in this version.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-05-19 Daniel Jacobowitz <drow@mvista.com>
* config.gcc: Reorganize --with-cpu logic. Set
configure_default_options according to the default CPU, --with-cpu,
--with-arch, --with-tune, --with-schedule, --with-abi, and
--with-float. Check for legal values of various options.
* configure.in: Define configure_default_options in configargs.h.
* configure: Regenerated.
* config/mips/mips.h (TARGET_DEFAULT_ARCH_P)
(TARGET_DEFAULT_FLOAT_P): New macros.
* gcc.c (do_option_spec): New function.
(struct default_spec, option_default_specs): New.
(main): Call do_option_spec.
* config/alpha/alpha.h, config/arm/arm.h, config/i386/i386.h,
config/mips/mips.h, config/pa/pa.h, config/rs6000/rs6000.h,
config/sparc/sparc.h (OPTION_DEFAULT_SPECS): Define.
* doc/install.texi: Update --with-cpu documentation. Mention
--with-arch, --with-schedule, --with-tune, --with-abi, and
--with-float.
* doc/tm.texi (Driver): Document OPTION_DEFAULT_SPECS.
Index: config.gcc
===================================================================
diff -u -p config.gcc
--- config.gcc 2003-05-19 15:10:01.000000000 -0400
+++ config.gcc 2003-05-19 16:38:03.000000000 -0400
@@ -160,6 +160,10 @@
# determines the underlying integral type for
# HOST_WIDE_INT cannot see the definition of
# MAX_LONG_TYPE_SIZE.)
+#
+# configure_default_options
+# Set to an initializer for configure_default_options
+# in configargs.h, based on --with-cpu et cetera.
# The following variables are used in each case-construct to build up the
# outgoing variables:
@@ -2219,41 +2223,99 @@ then
esac
fi
- # Optionally, validate the argument to --with-cpu.
- # This block sets nothing.
- case $machine in
+ # Validate and mark as valid any --with options supported
+ # by this target. In order to use a particular --with option
+ # you must list it in supported_defaults; validating the value
+ # is optional. This case statement should set nothing besides
+ # supported_defaults.
+
+ supported_defaults=
+ case "$machine" in
alpha*-*-*)
- case "x$with_cpu" in
+ supported_defaults="cpu tune"
+ for which in cpu tune; do
+ eval "val=\$with_$which"
+ case "x$val" in
+ x \
+ | xev4 | xev45 | x21064 | xev5 | x21164 | xev56 | x21164a \
+ | xpca56 | x21164PC | x21164pc | xev6 | x21264 | xev67 \
+ | x21264a)
+ ;;
+ *)
+ echo "Unknown CPU used in --with-$which=$val" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+
+ arm*-*-*)
+ supported_defaults="arch cpu float tune"
+ for which in cpu tune; do
+ eval "val=\$with_$which"
+ case "x$val" in
+ x \
+ | xarm[236789] | xarm250 | xarm[67][01]0 \
+ | xarm60 | xarm620 | xarm7d | xarm7di \
+ | xarm7m | xarm7dm | xarm7dmi | xarm[79]tdmi \
+ | xarm70 | xarm700i | xarm710t | xarm720 \
+ | xarm720t | xarm740t | xarm710c | xarm920 \
+ | xarm920t | xarm940t | xarm9e | xarm10tdmi \
+ | xarm7100 | xarm7500 | xarm7500fe | xarm810 \
+ | xarm1020t \
+ | xxscale \
+ | xep9312 \
+ | xstrongarm | xstrongarm110 | xstrongarm11[01]0)
+ # OK
+ ;;
+ *)
+ echo "Unknown CPU used in --with-$which=$val" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ case "x$with_arch" in
x \
- | xev5 | xev56 | xpca56 | xev6 | xev67)
+ | xarmv[2345] | xarmv2a | xarmv3m | xarmv4t | xarmv5t \
+ | xarmv5te | ep9312)
# OK
;;
*)
- echo "Unknown CPU used in --with-cpu=$with_cpu" 1>&2
+ echo "Unknown arch used in --with-arch=$with_arch" 1>&2
exit 1
;;
esac
- ;;
- arm*-*-*)
- case "x$with_cpu" in
+ case "x$with_float" in
x \
- | xarm[236789] | xarm250 | xarm[67][01]0 \
- | xarm7m | xarm7dm | xarm7dmi | xarm[79]tdmi \
- | xarm7100 | xarm7500 | xarm7500fe | xarm810 \
- | xxscale \
- | xep9312 \
- | xstrongarm | xstrongarm110 | xstrongarm1100)
+ | xsoft | xhard)
# OK
;;
*)
- echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
+ echo "Unknown floating point type used in --with-float=$with_float" 1>&2
exit 1
;;
esac
+
+ if test "x$with_arch" != x && test "x$with_cpu" != x; then
+ echo "Warning: --with-arch overrides --with-cpu" 1>&2
+ fi
;;
hppa*-*-* | parisc*-*-*)
+ supported_defaults="arch schedule"
+
+ case "x$with_arch" in
+ x | x1.0 | x1.1 | x2.0)
+ # OK
+ ;;
+ *)
+ echo "Unknown architecture used in --with-arch=$with_arch" 1>&2
+ exit 1
+ ;;
+ esac
+
case "x$with_schedule" in
x | x700 | x7100 | x7100LC | x7200 | x7300 | x8000)
# OK
@@ -2266,60 +2328,111 @@ then
;;
i[34567]86-*-* | x86_64-*-*)
- case x$with_cpu in
+ supported_defaults="arch cpu tune"
+ for which in arch cpu tune; do
+ eval "val=\$with_$which"
+ case "x$val" in
+ x \
+ | xi386 | xi486 \
+ | xi586 | xpentium | xpentium-mmx | xwinchip-c6 | xwinchip2 \
+ | xc3 | xc3-2 | xi686 | xpentiumpro | xpentium2 | xpentium3 \
+ | xpentium4 | xk6 | xk6-2 | xk6-3 | xathlon | xathlon-tbird \
+ | xathlon-4 | xathlon-xp | xathlon-mp | xk8)
+ # OK
+ ;;
+ *)
+ echo "Unknown CPU given in --with-$which=$val." 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+
+ mips*-*-*)
+ supported_defaults="abi arch float tune"
+
+ case "x$with_float" in
x \
- | xi486 \
- | xi586 | xk6 | xk6-2 | xk6-3 | xpentium-mmx | xpentium \
- | xpentiumpro | xpentium2 | xpentium3 | xpentium4 \
- | xathlon | xathlon-4 | xk8)
+ | xsoft | xhard)
# OK
;;
*)
- echo "Unknown CPU given in --with-cpu=$with_cpu." 1>&2
+ echo "Unknown floating point type used in --with-float=$with_float" 1>&2
exit 1
;;
esac
- ;;
- powerpc*-*-* | rs6000-*-*)
- case "x$with_cpu" in
+ case "x$with_abi" in
x \
- | xcommon \
- | xpower | xpower2 | xpower3 | xpower4 \
- | xpowerpc | xpowerpc64 \
- | xrios | xrios1 | xrios2 | xrsc | xrsc1 | xrs64a \
- | x401 | x403 | x405 | x405fp | x440 | x440fp | x505 \
- | x601 | x602 | x603 | x603e | xec603e | x604 \
- | x604e | x620 | x630 | x740 | x750 | x7400 | x7450 \
- | x8540 | x801 | x821 | x823 | x860)
+ | x32 | xo64 | xn32 | x64 | xeabi)
# OK
;;
*)
- echo "Unknown cpu used in --with-cpu=$with_cpu." 1>&2
+ echo "Unknown ABI used in --with-abi=$with_abi" 1>&2
exit 1
;;
esac
;;
+ powerpc*-*-* | rs6000-*-*)
+ supported_defaults="cpu float tune"
+
+ for which in cpu tune; do
+ eval "val=\$with_$which"
+ case "x$val" in
+ x \
+ | xcommon \
+ | xpower | xpower2 | xpower3 | xpower4 \
+ | xpowerpc | xpowerpc64 \
+ | xrios | xrios1 | xrios2 | xrsc | xrsc1 | xrs64a \
+ | x401 | x403 | x405 | x405fp | x440 | x440fp | x505 \
+ | x601 | x602 | x603 | x603e | xec603e | x604 \
+ | x604e | x620 | x630 | x740 | x750 | x7400 | x7450 \
+ | x8540 | x801 | x821 | x823 | x860)
+ # OK
+ ;;
+ *)
+ echo "Unknown cpu used in --with-$which=$val." 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+
sparc*-*-*)
- case x$with_cpu in
- x)
- echo "Should never happen - no default CPU for sparc target."
- exit 1
- ;;
+ supported_defaults="cpu float tune"
+
+ for which in cpu tune; do
+ eval "val=\$with_$which"
+ case x$val in
+ x \
+ | xsparc | xsparcv9 | xsparc86x \
+ | xv7 | xcypress | xv8 | xsupersparc | xsparclite | xf930 \
+ | xf934 | xhypersparc | xsparclite86x | xsparclet | tsc701 \
+ | xv9 | xultrasparc | xultrasparc3)
+ # OK
+ ;;
+ *)
+ echo "Unknown cpu used in --with-$which=$val" 1>&2
+ exit 1
+ ;;
+ esac
+ done
- xsparc | xsparc86x | xsparcv9 | xsparc64 \
- | xsupersparc | xhypersparc | xultrasparc | xv7 | xv8 | xv9)
+ case "x$with_float" in
+ x \
+ | xsoft | xhard)
# OK
;;
*)
- echo "Unknown cpu used in --with-$which=$val" 1>&2
+ echo "Unknown floating point type used in --with-float=$with_float" 1>&2
exit 1
;;
esac
;;
v850*-*-*)
+ supported_defaults=cpu
case "x$with_cpu" in
x | xv850e)
# OK
@@ -2332,38 +2445,13 @@ then
;;
esac
- # Now, for targets which support this, convert --with-cpu to
- # a setting of target_cpu_default2. This block also sets assorted
- # other configuration variables.
+ # Set some miscellaneous flags for particular targets.
target_cpu_default2=
case $machine in
alpha*-*-*)
- case $with_cpu in
- ev67)
- target_cpu_default2="MASK_CPU_EV6|MASK_BWX|MASK_MAX|MASK_FIX|MASK_CIX"
- ;;
- ev6)
- target_cpu_default2="MASK_CPU_EV6|MASK_BWX|MASK_MAX|MASK_FIX"
- ;;
- pca56)
- target_cpu_default2="MASK_CPU_EV5|MASK_BWX|MASK_MAX"
- ;;
- ev56)
- target_cpu_default2="MASK_CPU_EV5|MASK_BWX"
- ;;
- ev5)
- target_cpu_default2="MASK_CPU_EV5"
- ;;
- esac
-
if test x$gas = xyes
then
- if test "$target_cpu_default2" = ""
- then
- target_cpu_default2="MASK_GAS"
- else
- target_cpu_default2="${target_cpu_default2}|MASK_GAS"
- fi
+ target_cpu_default2="MASK_GAS"
fi
;;
@@ -2385,22 +2473,6 @@ then
then
target_cpu_default2="MASK_GAS|MASK_JUMP_IN_DELAY"
fi
- if test "x$with_schedule" != x
- then
- tm_defines="TARGET_SCHED_DEFAULT=\\\"$with_schedule\\\""
- ;;
- fi
- ;;
-
- i[34567]86-*-* | x86_64-*-*)
- case x$with_cpu in
- xathlon-4)
- target_cpu_default2=TARGET_CPU_DEFAULT_athlon_sse
- ;;
- *)
- target_cpu_default2=TARGET_CPU_DEFAULT_"`echo $with_cpu | sed s/-/_/`"
- ;;
- esac
;;
mips*-*-*)
@@ -2444,10 +2516,12 @@ then
;;
powerpc*-*-* | rs6000-*-*)
- if test x$enable_altivec = xyes
- then
- tm_file="$tm_file rs6000/altivec-defs.h"
- fi
+ if test x$enable_altivec = xyes
+ then
+ tm_file="$tm_file rs6000/altivec-defs.h"
+ fi
+ # FIXME: The PowerPC port uses the value set at compile time,
+ # although it's only cosmetic.
if test "x$with_cpu" != x
then
target_cpu_default2="\\\"$with_cpu\\\""
@@ -2459,10 +2533,25 @@ then
;;
sparc*-*-*)
+ # Some standard aliases.
+ case x$with_cpu in
+ xsparc)
+ with_cpu=v7
+ ;;
+ xsparc86x)
+ with_cpu=sparclite86x
+ ;;
+ xsparcv9 | xsparc64)
+ with_cpu=v9
+ ;;
+ esac
+
+ # The Sparc port checks this value at compile-time.
target_cpu_default2="TARGET_CPU_$with_cpu"
;;
-
v850*-*-*)
+ # FIXME: The v850 is "special" in that it does not support
+ # runtime CPU selection, only --with-cpu.
case "x$with_cpu" in
x)
;;
@@ -2473,6 +2562,36 @@ then
;;
esac
+ t=
+ all_defaults="abi cpu arch tune schedule float"
+ for option in $all_defaults
+ do
+ eval "val=\$with_$option"
+ if test -n "$val"; then
+ case " $supported_defaults " in
+ *" $option "*)
+ ;;
+ *)
+ echo "This target does not support --with-$option." 2>&1
+ exit 1
+ ;;
+ esac
+
+ if test "x$t" = x
+ then
+ t="{ \"$option\", \"$val\" }"
+ else
+ t="${t}, { \"$option\", \"$val\" }"
+ fi
+ fi
+ done
+ if test "x$t" = x
+ then
+ configure_default_options="{ { NULL, NULL} }"
+ else
+ configure_default_options="{ ${t} }"
+ fi
+
if test "$target_cpu_default2" != ""
then
if test "$target_cpu_default" != ""
Index: configure.in
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/configure.in,v
retrieving revision 1.668
diff -u -p -r1.668 configure.in
--- configure.in 12 May 2003 22:30:24 -0000 1.668
+++ configure.in 14 May 2003 14:10:26 -0000
@@ -1213,6 +1213,10 @@ cat > configargs.h <<EOF
/* Generated automatically. */
static const char configuration_arguments[] = "$gcc_config_arguments";
static const char thread_model[] = "$thread_file";
+
+static const struct {
+ const char *name, *value;
+} configure_default_options[] = $configure_default_options;
EOF
changequote([,])dnl
Index: gcc.c
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/gcc.c,v
retrieving revision 1.374
diff -u -p -r1.374 gcc.c
--- gcc.c 7 May 2003 06:10:49 -0000 1.374
+++ gcc.c 14 May 2003 15:08:07 -0000
@@ -325,6 +325,7 @@ static char *save_string PARAMS ((const
static void set_collect_gcc_options PARAMS ((void));
static int do_spec_1 PARAMS ((const char *, int, const char *));
static int do_spec_2 PARAMS ((const char *));
+static void do_option_spec PARAMS ((const char *, const char *));
static void do_self_spec PARAMS ((const char *));
static const char *find_file PARAMS ((const char *));
static int is_directory PARAMS ((const char *, const char *, int));
@@ -803,6 +804,19 @@ static const char *const multilib_defaul
static const char *const driver_self_specs[] = { DRIVER_SELF_SPECS };
+#ifndef OPTION_DEFAULT_SPECS
+#define OPTION_DEFAULT_SPECS { "", "" }
+#endif
+
+struct default_spec
+{
+ const char *name;
+ const char *spec;
+};
+
+static const struct default_spec
+ option_default_specs[] = { OPTION_DEFAULT_SPECS };
+
struct user_specs
{
struct user_specs *next;
@@ -4254,6 +4268,57 @@ do_spec_2 (spec)
of the switches/n_switches array. */
static void
+do_option_spec (name, spec)
+ const char *name;
+ const char *spec;
+{
+ unsigned int i, value_count, value_len;
+ const char *p, *q, *value;
+ char *tmp_spec, *tmp_spec_p;
+
+ if (configure_default_options[0].name == NULL)
+ return;
+
+ for (i = 0; i < ARRAY_SIZE (configure_default_options); i++)
+ if (strcmp (configure_default_options[i].name, name) == 0)
+ break;
+ if (i == ARRAY_SIZE (configure_default_options))
+ return;
+
+ value = configure_default_options[i].value;
+ value_len = strlen (value);
+
+ /* Compute the size of the final spec. */
+ value_count = 0;
+ p = spec;
+ while ((p = strstr (p, "%(VALUE)")) != NULL)
+ {
+ p ++;
+ value_count ++;
+ }
+
+ /* Replace each %(VALUE) by the specified value. */
+ tmp_spec = alloca (strlen (spec) + 1
+ + value_count * (value_len - strlen ("%(VALUE)")));
+ tmp_spec_p = tmp_spec;
+ q = spec;
+ while ((p = strstr (q, "%(VALUE)")) != NULL)
+ {
+ memcpy (tmp_spec_p, q, p - q);
+ tmp_spec_p = tmp_spec_p + (p - q);
+ memcpy (tmp_spec_p, value, value_len);
+ tmp_spec_p += value_len;
+ q = p + strlen ("%(VALUE)");
+ }
+ strcpy (tmp_spec_p, q);
+
+ do_self_spec (tmp_spec);
+}
+
+/* Process the given spec string and add any new options to the end
+ of the switches/n_switches array. */
+
+static void
do_self_spec (spec)
const char *spec;
{
@@ -6193,6 +6258,12 @@ main (argc, argv)
strcat (specs_file, "specs");
if (access (specs_file, R_OK) == 0)
read_specs (specs_file, TRUE);
+
+ /* Process any configure-time defaults specified for the command line
+ options, via OPTION_DEFAULT_SPECS. */
+ for (i = 0; i < ARRAY_SIZE (option_default_specs); i++)
+ do_option_spec (option_default_specs[i].name,
+ option_default_specs[i].spec);
/* Process DRIVER_SELF_SPECS, adding any new options to the end
of the command line. */
Index: config/alpha/alpha.h
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/config/alpha/alpha.h,v
retrieving revision 1.196
diff -u -p -r1.196 alpha.h
--- config/alpha/alpha.h 12 May 2003 09:51:19 -0000 1.196
+++ config/alpha/alpha.h 14 May 2003 14:26:27 -0000
@@ -365,6 +365,13 @@ extern const char *alpha_tls_size_string
N_("Specify bit size of immediate TLS offsets"), 0}, \
}
+/* Support for a compile-time default CPU, et cetera. The rules are:
+ --with-cpu is ignored if -mcpu is specified.
+ --with-tune is ignored if -mtune is specified. */
+#define OPTION_DEFAULT_SPECS \
+ {"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \
+ {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }
+
/* This macro defines names of additional specifications to put in the
specs that can be used in various specifications like CC1_SPEC. Its
definition is an initializer with a subgrouping for each command option.
Index: config/arm/arm.h
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.189
diff -u -p -r1.189 arm.h
--- config/arm/arm.h 23 Apr 2003 16:39:30 -0000 1.189
+++ config/arm/arm.h 14 May 2003 14:25:53 -0000
@@ -525,6 +525,20 @@ Unrecognized value in TARGET_CPU_DEFAULT
N_("Specify the register to be used for PIC addressing"), 0} \
}
+/* Support for a compile-time default CPU, et cetera. The rules are:
+ --with-arch is ignored if -march or -mcpu are specified.
+ --with-cpu is ignored if -march or -mcpu are specified, and is overridden
+ by --with-arch.
+ --with-tune is ignored if -mtune or -mcpu are specified (but not affected
+ by -march).
+ --with-float is ignored if -mhard-float or -msoft-float are
+ specified. */
+#define OPTION_DEFAULT_SPECS \
+ {"arch", "%{!march=*:%{!mcpu=*:-march=%(VALUE)}}" }, \
+ {"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
+ {"tune", "%{!mcpu=*:%{!mtune=*:-mtune=%(VALUE)}}" }, \
+ {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }
+
struct arm_cpu_select
{
const char * string;
Index: config/i386/i386.h
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.335
diff -u -p -r1.335 i386.h
--- config/i386/i386.h 10 May 2003 19:38:02 -0000 1.335
+++ config/i386/i386.h 14 May 2003 14:26:18 -0000
@@ -483,6 +483,12 @@ extern int x86_prefetch_sse;
#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \
optimization_options ((LEVEL), (SIZE))
+/* Support for configure-time defaults of some command line options. */
+#define OPTION_DEFAULT_SPECS \
+ {"arch", "%{!march=*:-march=%(VALUE)}"}, \
+ {"tune", "%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}" }, \
+ {"cpu", "%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}" }
+
/* Specs for the compiler proper */
#ifndef CC1_CPU_SPEC
Index: config/mips/mips.h
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/config/mips/mips.h,v
retrieving revision 1.249
diff -u -p -r1.249 mips.h
--- config/mips/mips.h 12 May 2003 13:59:14 -0000 1.249
+++ config/mips/mips.h 14 May 2003 14:25:45 -0000
@@ -807,6 +807,20 @@ extern void sbss_section PARAMS ((void)
/* This is meant to be redefined in the host dependent files. */
#define SUBTARGET_TARGET_OPTIONS
+/* Support for a compile-time default CPU, et cetera. The rules are:
+ --with-arch is ignored if -march is specified or a -mips is specified
+ (other than -mips16).
+ --with-tune is ignored if -mtune is specified.
+ --with-abi is ignored if -mabi is specified.
+ --with-float is ignored if -mhard-float or -msoft-float are
+ specified. */
+#define OPTION_DEFAULT_SPECS \
+ {"arch", "%{!march=*:%{mips16:-march=%(VALUE)}%{!mips*:-march=%(VALUE)}}" }, \
+ {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
+ {"abi", "%{!mabi=*:-mabi=%(VALUE)}" }, \
+ {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }
+
+
#define GENERATE_BRANCHLIKELY (TARGET_BRANCHLIKELY \
&& !TARGET_SR71K \
&& !TARGET_MIPS16)
Index: config/pa/pa.h
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/config/pa/pa.h,v
retrieving revision 1.190
diff -u -p -r1.190 pa.h
--- config/pa/pa.h 12 May 2003 09:51:33 -0000 1.190
+++ config/pa/pa.h 14 May 2003 14:26:10 -0000
@@ -312,6 +312,13 @@ extern int target_flags;
N_("Specify architecture for code generation. Values are 1.0, 1.1, and 2.0. 2.0 requires gas snapshot 19990413 or later."), 0}\
}
+/* Support for a compile-time default CPU, et cetera. The rules are:
+ --with-schedule is ignored if -mschedule is specified.
+ --with-arch is ignored if -march is specified. */
+#define OPTION_DEFAULT_SPECS \
+ {"arch", "%{!march=*:-march=%(VALUE)}" }, \
+ {"schedule", "%{!mschedule=*:-mschedule=%(VALUE)}" }
+
/* Specify the dialect of assembler to use. New mnemonics is dialect one
and the old mnemonics are dialect zero. */
#define ASSEMBLER_DIALECT (TARGET_PA_20 ? 1 : 0)
Index: config/rs6000/rs6000.h
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.272
diff -u -p -r1.272 rs6000.h
--- config/rs6000/rs6000.h 12 May 2003 22:30:30 -0000 1.272
+++ config/rs6000/rs6000.h 14 May 2003 14:25:33 -0000
@@ -405,6 +405,16 @@ extern enum processor_type rs6000_cpu;
SUBTARGET_OPTIONS \
}
+/* Support for a compile-time default CPU, et cetera. The rules are:
+ --with-cpu is ignored if -mcpu is specified.
+ --with-tune is ignored if -mtune is specified.
+ --with-float is ignored if -mhard-float or -msoft-float are
+ specified. */
+#define OPTION_DEFAULT_SPECS \
+ {"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \
+ {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
+ {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }
+
/* rs6000_select[0] is reserved for the default cpu defined via --with-cpu */
struct rs6000_cpu_select
{
Index: config/sparc/sparc.h
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/config/sparc/sparc.h,v
retrieving revision 1.223
diff -u -p -r1.223 sparc.h
--- config/sparc/sparc.h 12 May 2003 09:51:35 -0000 1.223
+++ config/sparc/sparc.h 14 May 2003 14:26:04 -0000
@@ -643,6 +643,16 @@ extern enum processor_type sparc_cpu;
/* This is meant to be redefined in target specific files. */
#define SUBTARGET_OPTIONS
+/* Support for a compile-time default CPU, et cetera. The rules are:
+ --with-cpu is ignored if -mcpu is specified.
+ --with-tune is ignored if -mtune is specified.
+ --with-float is ignored if -mhard-float, -msoft-float, -mfpu, or -mno-fpu
+ are specified. */
+#define OPTION_DEFAULT_SPECS \
+ {"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \
+ {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
+ {"float", "%{!msoft-float:%{!mhard-float:%{!fpu:%{!no-fpu:-m%(VALUE)-float}}}}" }
+
/* sparc_select[0] is reserved for the default cpu. */
struct sparc_cpu_select
{
Index: doc/install.texi
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/doc/install.texi,v
retrieving revision 1.189
diff -u -p -r1.189 install.texi
--- doc/install.texi 6 May 2003 23:17:59 -0000 1.189
+++ doc/install.texi 12 May 2003 22:43:22 -0000
@@ -721,12 +721,21 @@ Microsoft Win32 API thread support.
@end table
@item --with-cpu=@var{cpu}
-Specify which cpu variant the
-compiler should generate code for by default. This is currently
-only supported on 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
-@file{gcc/config.gcc} script for a complete list of supported models.
+Specify which cpu variant the compiler should generate code for by default.
+@var{cpu} will be used as the default value of the @option{-mcpu=} switch.
+This option is only supported on some targets, including ARM, i386, PowerPC,
+and SPARC@.
+
+@item --with-schedule=@var{cpu}
+@itemx --with-arch=@var{cpu}
+@itemx --with-tune=@var{cpu}
+@itemx --with-abi=@var{abi}
+@itemx --with-float=@var{type}
+These configure options provide default values for the @option{-mschedule=},
+@option{-march=}, @option{-mtune=}, and @option{-mabi=} options and for
+@option{-mhard-float} or @option{-msoft-float}. As with @option{--with-cpu},
+which switches will be accepted and acceptable values of the arguments depend
+on the target.
@item --enable-altivec
Specify that the target supports AltiVec vector enhancements. This
Index: doc/tm.texi
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/gcc/doc/tm.texi,v
retrieving revision 1.217
diff -u -p -r1.217 tm.texi
--- doc/tm.texi 10 May 2003 22:59:04 -0000 1.217
+++ doc/tm.texi 14 May 2003 14:34:10 -0000
@@ -181,6 +181,25 @@ that the other specs are easier to write
Do not define this macro if it does not need to do anything.
+@findex OPTION_DEFAULT_SPECS
+@item OPTION_DEFAULT_SPECS
+A list of specs used to support configure-time default options (i.e.@:
+@option{--with} options) in the driver. It should be a suitable initializer
+for an array of structures, each containing two strings, without the
+outermost pair of surrounding braces.
+
+The first item in the pair is the name of the default. This must match
+the code in @file{config.gcc} for the target. The second item is a spec
+to apply if a default with this name was specified. The string
+@samp{%(VALUE)} in the spec will be replaced by the value of the default
+everywhere it occurs.
+
+The driver will apply these specs to its own command line between loading
+default @file{specs} files and processing @code{DRIVER_SELF_SPECS}, using
+the same mechanism as @code{DRIVER_SELF_SPECS}.
+
+Do not define this macro if it does not need to do anything.
+
@findex CPP_SPEC
@item CPP_SPEC
A C string constant that tells the GCC driver program options to