From c2f17e192e10ad20e9b3a79e45d51de212cedfbb Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 14 Nov 2007 15:14:13 +0100 Subject: [PATCH] i386.h (TARGET_CPU_DEFAULT_*): Substitute with ... * config/i386/i386.h (TARGET_CPU_DEFAULT_*): Substitute with ... (enum target_cpu_default): ... this enum. (TARGET_CPU_DEFAULT_NAMES): Remove macro. Move initializer to ... * config/i386/i386.c (override_options): ... here. * config/i386/i386-interix.h (TARGET_CPU_DEFAULT): Use TARGET_CPU_DEFAULT_i486. From-SVN: r130177 --- gcc/ChangeLog | 9 ++++++ gcc/config/i386/i386-interix.h | 2 +- gcc/config/i386/i386.c | 28 +++++++++++++++-- gcc/config/i386/i386.h | 56 +++++++++++++++++----------------- 4 files changed, 64 insertions(+), 31 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f07274cf561..bff34b257eb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2007-11-14 Uros Bizjak + + * config/i386/i386.h (TARGET_CPU_DEFAULT_*): Substitute with ... + (enum target_cpu_default): ... this enum. + (TARGET_CPU_DEFAULT_NAMES): Remove macro. Move initializer to ... + * config/i386/i386.c (override_options): ... here. + * config/i386/i386-interix.h (TARGET_CPU_DEFAULT): Use + TARGET_CPU_DEFAULT_i486. + 2007-11-14 Rask Ingemann Lambertsen * global.c (rest_of_handle_global_alloc): Fix comment typos. diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h index 560c91dd3a2..701536049e3 100644 --- a/gcc/config/i386/i386-interix.h +++ b/gcc/config/i386/i386-interix.h @@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see MASK_ALIGN_DOUBLE | MASK_MS_BITFIELD_LAYOUT) #undef TARGET_CPU_DEFAULT -#define TARGET_CPU_DEFAULT 2 /* 486 */ +#define TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT_i486 #define WCHAR_TYPE_SIZE 16 #define WCHAR_TYPE "short unsigned int" diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 296266d1e8f..f3bbf72e6e3 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1963,7 +1963,31 @@ override_options (void) {&amdfam10_cost, 32, 24, 32, 7, 32} }; - static const char * const cpu_names[] = TARGET_CPU_DEFAULT_NAMES; + static const char *const cpu_names[TARGET_CPU_DEFAULT_max] = + { + "generic", + "i386", + "i486", + "pentium", + "pentium-mmx", + "pentiumpro", + "pentium2", + "pentium3", + "pentium4", + "pentium-m", + "prescott", + "nocona", + "core2", + "geode", + "k6", + "k6-2", + "k6-3", + "athlon", + "athlon-4", + "k8", + "amdfam10" + }; + enum pta_flags { PTA_SSE = 1 << 0, @@ -2138,7 +2162,7 @@ override_options (void) ix86_tune_string = ix86_arch_string; if (!ix86_tune_string) { - ix86_tune_string = cpu_names [TARGET_CPU_DEFAULT]; + ix86_tune_string = cpu_names[TARGET_CPU_DEFAULT]; ix86_tune_defaulted = 1; } diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index bc3e5f6dc9d..872425e4b5f 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -688,34 +688,34 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); } \ while (0) -#define TARGET_CPU_DEFAULT_i386 0 -#define TARGET_CPU_DEFAULT_i486 1 -#define TARGET_CPU_DEFAULT_pentium 2 -#define TARGET_CPU_DEFAULT_pentium_mmx 3 -#define TARGET_CPU_DEFAULT_pentiumpro 4 -#define TARGET_CPU_DEFAULT_pentium2 5 -#define TARGET_CPU_DEFAULT_pentium3 6 -#define TARGET_CPU_DEFAULT_pentium4 7 -#define TARGET_CPU_DEFAULT_geode 8 -#define TARGET_CPU_DEFAULT_k6 9 -#define TARGET_CPU_DEFAULT_k6_2 10 -#define TARGET_CPU_DEFAULT_k6_3 11 -#define TARGET_CPU_DEFAULT_athlon 12 -#define TARGET_CPU_DEFAULT_athlon_sse 13 -#define TARGET_CPU_DEFAULT_k8 14 -#define TARGET_CPU_DEFAULT_pentium_m 15 -#define TARGET_CPU_DEFAULT_prescott 16 -#define TARGET_CPU_DEFAULT_nocona 17 -#define TARGET_CPU_DEFAULT_core2 18 -#define TARGET_CPU_DEFAULT_generic 19 -#define TARGET_CPU_DEFAULT_amdfam10 20 - -#define TARGET_CPU_DEFAULT_NAMES {"i386", "i486", "pentium", "pentium-mmx",\ - "pentiumpro", "pentium2", "pentium3", \ - "pentium4", "geode", "k6", "k6-2", "k6-3", \ - "athlon", "athlon-4", "k8", \ - "pentium-m", "prescott", "nocona", \ - "core2", "generic", "amdfam10"} +enum target_cpu_default +{ + TARGET_CPU_DEFAULT_generic = 0, + + TARGET_CPU_DEFAULT_i386, + TARGET_CPU_DEFAULT_i486, + TARGET_CPU_DEFAULT_pentium, + TARGET_CPU_DEFAULT_pentium_mmx, + TARGET_CPU_DEFAULT_pentiumpro, + TARGET_CPU_DEFAULT_pentium2, + TARGET_CPU_DEFAULT_pentium3, + TARGET_CPU_DEFAULT_pentium4, + TARGET_CPU_DEFAULT_pentium_m, + TARGET_CPU_DEFAULT_prescott, + TARGET_CPU_DEFAULT_nocona, + TARGET_CPU_DEFAULT_core2, + + TARGET_CPU_DEFAULT_geode, + TARGET_CPU_DEFAULT_k6, + TARGET_CPU_DEFAULT_k6_2, + TARGET_CPU_DEFAULT_k6_3, + TARGET_CPU_DEFAULT_athlon, + TARGET_CPU_DEFAULT_athlon_sse, + TARGET_CPU_DEFAULT_k8, + TARGET_CPU_DEFAULT_amdfam10, + + TARGET_CPU_DEFAULT_max +}; #ifndef CC1_SPEC #define CC1_SPEC "%(cc1_cpu) " -- 2.30.2