Commit 44f276c6 by H.J. Lu Committed by H.J. Lu

Properly detect Atom, Core 2 and Core i7.

2010-05-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/44046
	* config/i386/driver-i386.c (host_detect_local_cpu): Properly
	detect Atom, Core 2 and Core i7.

From-SVN: r159202
parent d6205185
2010-05-09 H.J. Lu <hongjiu.lu@intel.com>
PR target/44046
* config/i386/driver-i386.c (host_detect_local_cpu): Properly
detect Atom, Core 2 and Core i7.
2010-05-09 Richard Guenther <rguenther@suse.de> 2010-05-09 Richard Guenther <rguenther@suse.de>
* gcc.c (store_arg): Handle temporary file deletion for * gcc.c (store_arg): Handle temporary file deletion for
......
...@@ -538,16 +538,41 @@ const char *host_detect_local_cpu (int argc, const char **argv) ...@@ -538,16 +538,41 @@ const char *host_detect_local_cpu (int argc, const char **argv)
cpu = "pentium"; cpu = "pentium";
break; break;
case PROCESSOR_PENTIUMPRO: case PROCESSOR_PENTIUMPRO:
if (model == 28) switch (model)
cpu = "atom"; {
else if (model >= 28 && l2sizekb < 2048) case 0x1c:
/* Assume it's a small core if there's less than 2MB cache */ case 0x26:
/* Atom. */
cpu = "atom"; cpu = "atom";
else if (has_longmode) break;
case 0x1a:
case 0x1e:
case 0x1f:
case 0x2e:
/* FIXME: Optimize for Nehalem. */
cpu = "core2";
break;
case 0x25:
case 0x2f:
/* FIXME: Optimize for Westmere. */
cpu = "core2";
break;
case 0x17:
case 0x1d:
/* Penryn. FIXME: -mtune=core2 is slower than -mtune=generic */
cpu = "core2";
break;
case 0x0f:
/* Merom. FIXME: -mtune=core2 is slower than -mtune=generic */
cpu = "core2"; cpu = "core2";
else if (arch) break;
default:
if (arch)
{ {
if (has_sse3) if (has_ssse3)
/* If it is an unknown CPU with SSSE3, assume Core 2. */
cpu = "core2";
else if (has_sse3)
/* It is Core Duo. */ /* It is Core Duo. */
cpu = "pentium-m"; cpu = "pentium-m";
else if (has_sse2) else if (has_sse2)
...@@ -567,6 +592,8 @@ const char *host_detect_local_cpu (int argc, const char **argv) ...@@ -567,6 +592,8 @@ const char *host_detect_local_cpu (int argc, const char **argv)
/* For -mtune, we default to -mtune=generic. */ /* For -mtune, we default to -mtune=generic. */
cpu = "generic"; cpu = "generic";
break; break;
}
break;
case PROCESSOR_PENTIUM4: case PROCESSOR_PENTIUM4:
if (has_sse3) if (has_sse3)
{ {
......
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