This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, i386] Add native detection for VIA C7 and Eden CPUs
- From: "J. Mayer" <l_indien at magic dot fr>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Uros Bizjak <ubizjak at gmail dot com>
- Date: Thu, 23 Jun 2016 10:26:19 +0200
- Subject: [PATCH, i386] Add native detection for VIA C7 and Eden CPUs
- Authentication-results: sourceware.org; auth=none
The following patch adds native detection for C7, Eden "Esther" and
Eden "Nehemiah" VIA CPUs.
Please CC me to any comment / review / change request.
---
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 14b8030..55afd8b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2016-06-21 Jocelyn Mayer <l_indien@magic.fr>
+
+ * config/i386/driver-i386.c (host_detect_local_cpu): Set
+ PROCESSOR_PENTIUMPRO for signature_CENTAUR_ebx family >= 9.
+ <case PROCESSOR_PENTIMUMPRO>: Pass c7 or nehemiah for
+ signature_CENTAUR_ebx.
+
2016-06-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71588
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-
i386.c
index 9f44ee8..22a8f28 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -653,10 +653,7 @@ const char *host_detect_local_cpu (int argc, const
char **argv)
case 6:
if (has_longmode)
processor = PROCESSOR_K8;
- else if (model > 9)
- /* Use the default detection procedure. */
- ;
- else if (model == 9)
+ else if (model >= 9)
processor = PROCESSOR_PENTIUMPRO;
else if (model >= 6)
processor = PROCESSOR_I486;
@@ -818,15 +815,27 @@ const char *host_detect_local_cpu (int argc,
const char **argv)
as all the CPUs below are 32-bit only. */
cpu = "x86-64";
else if (has_sse3)
- /* It is Core Duo. */
- cpu = "pentium-m";
+ {
+ if (vendor == signature_CENTAUR_ebx)
+ /* C7 / Eden "Esther" */
+ cpu = "c7";
+ else
+ /* It is Core Duo. */
+ cpu = "pentium-m";
+ }
else if (has_sse2)
/* It is Pentium M. */
cpu = "pentium-m";
else if (has_sse)
{
if (vendor == signature_CENTAUR_ebx)
- cpu = "c3-2";
+ {
+ if (model >= 9)
+ /* Eden "Nehemiah" */
+ cpu = "nehemiah";
+ else
+ cpu = "c3-2";
+ }
else
/* It is Pentium III. */
cpu = "pentium3";