This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: -mtune=generic for i386 backend
On Wed, Jan 18, 2006 at 08:29:42PM +0100, Jan Hubicka wrote:
> > On Wed, Jan 18, 2006 at 08:35:12AM +0100, Jan Hubicka wrote:
> > > Perhaps I can add two "generic" entries in the first to keep numeric
> > > values in sync?
> >
> > Or just a comment, and we'll remember why the missing 32/64,
> > and skip a number later.
>
> If we would skip a number, we would get the string array out of sync.
> The TARGET_CPU_* and TARGET_CPU_DEFAULT_NAMES are really independent of
> PROCESSOR_* enumeration that needs to be in sync with "cpu" attribute.
>
> I am testing the attached patch with new comments and the dupliced entry
> with comment, but those enumerations are really out of sync already:
>
> enum processor_type
> {
> PROCESSOR_I386, /* 80386 */
> PROCESSOR_I486, /* 80486DX, 80486SX, 80486DX[24] */
> PROCESSOR_PENTIUM,
> PROCESSOR_PENTIUMPRO,
> PROCESSOR_K6,
> PROCESSOR_ATHLON,
> PROCESSOR_PENTIUM4,
> PROCESSOR_K8,
> PROCESSOR_NOCONA,
> PROCESSOR_GENERIC32,
> PROCESSOR_GENERIC64,
> PROCESSOR_max
> };
>
> wrt
>
> #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_k6 8
> #define TARGET_CPU_DEFAULT_k6_2 9
> #define TARGET_CPU_DEFAULT_k6_3 10
> #define TARGET_CPU_DEFAULT_athlon 11
> #define TARGET_CPU_DEFAULT_athlon_sse 12
> #define TARGET_CPU_DEFAULT_k8 13
> #define TARGET_CPU_DEFAULT_pentium_m 14
> #define TARGET_CPU_DEFAULT_prescott 15
> #define TARGET_CPU_DEFAULT_nocona 16
> #define TARGET_CPU_DEFAULT_generic 17
>
> One is enumerating internal names (that include two generics) other
> external names for config machinery, so perhaps we don't really need to
> worry here. I also added the comments as requested and fixed typos.
>
We have
#ifndef TARGET_CPU_DEFAULT
#ifdef TARGET_64BIT_DEFAULT
#define TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT_k8
#else
#define TARGET_CPU_DEFAULT 0
#endif
#endif
I'd like to chane it to
#define TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT_generic
H.J.