Commit 4bdf739d by Uros Bizjak Committed by Uros Bizjak

re PR target/67310 ([PATCH] gcc 4.8.4 fails to compile with -march=native on VIA nano CPU)

	PR target/67310
	* config/i386/driver-i386.c (host_detect_local_cpu): Correctly
	detect processor family for signature_CENTAUR_ebx.
	<case PROCESSOR_I486>: Pass c3, winchip2 or winchip-c6 for
	signature_CENTAUR_ebx.
	<case PROCESSOR _PENTIUMPRO>: Pass c3-2 for signature_CENTAUR_ebx.
	<default>: Pass x86-64 for has_longmode.


Co-Authored-By: Jocelyn Mayer <l_indien@magic.fr>

From-SVN: r236991
parent 721547cd
2016-06-01 Uros Bizjak <ubizjak@gmail.com>
Jocelyn Mayer <l_indien@magic.fr>
PR target/67310
* config/i386/driver-i386.c (host_detect_local_cpu): Correctly
detect processor family for signature_CENTAUR_ebx.
<case PROCESSOR_I486>: Pass c3, winchip2 or winchip-c6 for
signature_CENTAUR_ebx.
<case PROCESSOR _PENTIUMPRO>: Pass c3-2 for signature_CENTAUR_ebx.
<default>: Pass x86-64 for has_longmode.
2016-06-01 Nathan Sidwell <nathan@acm.org> 2016-06-01 Nathan Sidwell <nathan@acm.org>
* config/nvptx/nvptx.c (nvptx_assemble_undefined_decl): Reject * config/nvptx/nvptx.c (nvptx_assemble_undefined_decl): Reject
......
...@@ -637,33 +637,27 @@ const char *host_detect_local_cpu (int argc, const char **argv) ...@@ -637,33 +637,27 @@ const char *host_detect_local_cpu (int argc, const char **argv)
} }
else if (vendor == signature_CENTAUR_ebx) else if (vendor == signature_CENTAUR_ebx)
{ {
if (arch) processor = PROCESSOR_GENERIC;
switch (family)
{ {
switch (family) default:
{ /* We have no idea. */
case 6: break;
if (model > 9)
/* Use the default detection procedure. */ case 5:
processor = PROCESSOR_GENERIC; if (has_3dnow || has_mmx)
else if (model == 9) processor = PROCESSOR_I486;
cpu = "c3-2"; break;
else if (model >= 6)
cpu = "c3"; case 6:
else if (model > 9 || has_longmode)
processor = PROCESSOR_GENERIC; /* Use the default detection procedure. */
break; ;
case 5: else if (model == 9)
if (has_3dnow) processor = PROCESSOR_PENTIUMPRO;
cpu = "winchip2"; else if (model >= 6)
else if (has_mmx) processor = PROCESSOR_I486;
cpu = "winchip2-c6";
else
processor = PROCESSOR_GENERIC;
break;
default:
/* We have no idea. */
processor = PROCESSOR_GENERIC;
}
} }
} }
else else
...@@ -694,7 +688,18 @@ const char *host_detect_local_cpu (int argc, const char **argv) ...@@ -694,7 +688,18 @@ const char *host_detect_local_cpu (int argc, const char **argv)
/* Default. */ /* Default. */
break; break;
case PROCESSOR_I486: case PROCESSOR_I486:
cpu = "i486"; if (arch && vendor == signature_CENTAUR_ebx)
{
if (model >= 6)
cpu = "c3";
else if (has_3dnow)
cpu = "winchip2";
else
/* Assume WinChip C6. */
cpu = "winchip-c6";
}
else
cpu = "i486";
break; break;
case PROCESSOR_PENTIUM: case PROCESSOR_PENTIUM:
if (arch && has_mmx) if (arch && has_mmx)
...@@ -817,8 +822,13 @@ const char *host_detect_local_cpu (int argc, const char **argv) ...@@ -817,8 +822,13 @@ const char *host_detect_local_cpu (int argc, const char **argv)
/* It is Pentium M. */ /* It is Pentium M. */
cpu = "pentium-m"; cpu = "pentium-m";
else if (has_sse) else if (has_sse)
/* It is Pentium III. */ {
cpu = "pentium3"; if (vendor == signature_CENTAUR_ebx)
cpu = "c3-2";
else
/* It is Pentium III. */
cpu = "pentium3";
}
else if (has_mmx) else if (has_mmx)
/* It is Pentium II. */ /* It is Pentium II. */
cpu = "pentium2"; cpu = "pentium2";
...@@ -902,6 +912,11 @@ const char *host_detect_local_cpu (int argc, const char **argv) ...@@ -902,6 +912,11 @@ const char *host_detect_local_cpu (int argc, const char **argv)
else else
cpu = "prescott"; cpu = "prescott";
} }
else if (has_longmode)
/* Perhaps some emulator? Assume x86-64, otherwise gcc
-march=native would be unusable for 64-bit compilations,
as all the CPUs below are 32-bit only. */
cpu = "x86-64";
else if (has_sse2) else if (has_sse2)
cpu = "pentium4"; cpu = "pentium4";
else if (has_cmov) else if (has_cmov)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment