aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@mvista.com>2003-06-04 17:50:44 +0000
committerDaniel Jacobowitz <drow@gcc.gnu.org>2003-06-04 17:50:44 +0000
commit7816bea0e23b878016e30c39f132826a5275ecc1 (patch)
tree0761aad7dc475440590406dcf0a0052331286e05 /gcc/config
parent83079d893cac8e85e0d9a5f7531cccae64f7665f (diff)
downloadgcc-7816bea0e23b878016e30c39f132826a5275ecc1.zip
gcc-7816bea0e23b878016e30c39f132826a5275ecc1.tar.gz
gcc-7816bea0e23b878016e30c39f132826a5275ecc1.tar.bz2
config.gcc: Reorganize --with-cpu logic.
* 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. From-SVN: r67457
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/alpha.h7
-rw-r--r--gcc/config/arm/arm.h14
-rw-r--r--gcc/config/i386/i386.h6
-rw-r--r--gcc/config/mips/mips.h14
-rw-r--r--gcc/config/pa/pa.h7
-rw-r--r--gcc/config/rs6000/rs6000.h10
-rw-r--r--gcc/config/sparc/sparc.h10
7 files changed, 68 insertions, 0 deletions
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 6b887a1..f9fa2f0 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -365,6 +365,13 @@ extern const char *alpha_tls_size_string; /* For -mtls-size= */
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.
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index cf6b91f..a6f0b90c 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -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;
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 6941f3e..fe47b03 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -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
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index bda524f..6f55005 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -785,6 +785,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)
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 1db28cf..3936d8c 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -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)
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 3edf959..ffc8c93 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -407,6 +407,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
{
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 49f9a38..7c19b2a 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -656,6 +656,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
{