* [PATCH, i386]: Handle VIA/Centaur processors with -march=native
@ 2013-05-16 20:14 Uros Bizjak
0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2013-05-16 20:14 UTC (permalink / raw)
To: gcc-patches; +Cc: Dzianis Kahanovich
[-- Attachment #1: Type: text/plain, Size: 837 bytes --]
Hello!
Attached patch introduces handling of VIA/Centaur processors with
-march=native compile directive. Comparing to original patch in
PR45359, attached patch handles detection of "unknown" processors via
default detection procedure. I also choose to use generic tuning for
all detected processors.
2013-05-16 Uros Bizjak <ubizjak@gmail.com>
Dzianis Kahanovich <mahatma@eu.by>
PR target/45359
PR target/46396
* config/i386/driver-i386.c (host_detect_local_cpu): Detect
VIA/Centaur processors and determine their cache parameters
using detect_caches_amd.
The patch was (compile) tested on x86_64-pc-linux-gnu and committed to
mainline SVN.
According to the PR45359, some other fix regressed the detection of
VIA/Centaur processors in 4.5, so I plan to backport the patch to
release branches.
Uros.
[-- Attachment #2: s.diff.txt --]
[-- Type: text/plain, Size: 1193 bytes --]
Index: driver-i386.c
===================================================================
--- driver-i386.c (revision 198977)
+++ driver-i386.c (working copy)
@@ -517,7 +517,8 @@ const char *host_detect_local_cpu (int argc, const
if (!arch)
{
- if (vendor == signature_AMD_ebx)
+ if (vendor == signature_AMD_ebx
+ || vendor == signature_CENTAUR_ebx)
cache = detect_caches_amd (ext_level);
else if (vendor == signature_INTEL_ebx)
{
@@ -560,6 +561,32 @@ const char *host_detect_local_cpu (int argc, const
else
processor = PROCESSOR_PENTIUM;
}
+ else if (vendor == signature_CENTAUR_ebx)
+ {
+ if (arch)
+ {
+ if (family == 6)
+ {
+ if (model > 9)
+ /* Use the default detection procedure. */
+ processor = PROCESSOR_GENERIC32;
+ else if (model == 9)
+ cpu = "c3-2";
+ else if (model >= 6)
+ cpu = "c3";
+ else
+ /* We have no idea. */
+ processor = PROCESSOR_GENERIC32;
+ }
+ else if (has_3dnow)
+ cpu = "winchip2";
+ else if (has_mmx)
+ cpu = "winchip2-c6";
+ else
+ /* We have no idea. */
+ processor = PROCESSOR_GENERIC32;
+ }
+ }
else
{
switch (family)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-05-16 20:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-16 20:14 [PATCH, i386]: Handle VIA/Centaur processors with -march=native Uros Bizjak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).