2010-11-18 Dzianis Kahanovich PR target/45359 * config/i386/driver-i386.c (vendor_signatures) Add SIG_VIA. (host_detect_local_cpu): Detect VIA CPUs. diff -pruN a/gcc/config/i386/driver-i386.c c/gcc/config/i386/driver-i386.c --- a/gcc/config/i386/driver-i386.c 2010-11-17 14:29:55.000000000 +0200 +++ c/gcc/config/i386/driver-i386.c 2010-11-18 14:52:03.000000000 +0200 @@ -351,7 +351,8 @@ detect_caches_intel (bool xeon_mp, unsig enum vendor_signatures { SIG_INTEL = 0x756e6547 /* Genu */, - SIG_AMD = 0x68747541 /* Auth */ + SIG_AMD = 0x68747541 /* Auth */, + SIG_VIA = 0x746e6543 /* Cent */ }; enum processor_signatures @@ -477,7 +478,8 @@ const char *host_detect_local_cpu (int a if (!arch) { - if (vendor == SIG_AMD) + if (vendor == SIG_AMD || vendor == SIG_VIA) + /* FIXME: + transmeta + cyrix fam5/mod5 */ cache = detect_caches_amd (ext_level); else if (vendor == SIG_INTEL) { @@ -512,6 +514,24 @@ const char *host_detect_local_cpu (int a else processor = PROCESSOR_PENTIUM; } + else if (vendor == SIG_VIA) + if (family == 6) + if (has_longmode) + cpu = "core2"; + else if (model > 9) + cpu = arch ? "prescott" : "core2"; + else if (model == 9) + cpu = arch ? "c3-2" : "generic32"; + else if (model >= 6) + cpu = arch ? "c3" : "generic32"; + else + processor = PROCESSOR_GENERIC32; + else if (has_3dnow) + cpu = arch ? "winchip2" : "generic32"; + else if (has_mmx) + cpu = arch ? "winchip2-c6" : "generic32"; + else + processor = PROCESSOR_GENERIC32; else { switch (family)