diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2009-05-20 13:32:14 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2009-05-20 06:32:14 -0700 |
commit | 37c5043589c8a28e3e2dc64bdc78fa22be5f96e1 (patch) | |
tree | 41964ad742db29084178987a593e112ec35cd908 /gcc | |
parent | dbb6088f89fe3cc22845097dc17f9f6a06682be1 (diff) | |
download | gcc-37c5043589c8a28e3e2dc64bdc78fa22be5f96e1.zip gcc-37c5043589c8a28e3e2dc64bdc78fa22be5f96e1.tar.gz gcc-37c5043589c8a28e3e2dc64bdc78fa22be5f96e1.tar.bz2 |
driver-i386.c (host_detect_local_cpu): Check extended family and model for Intel processors.
2009-05-20 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/driver-i386.c (host_detect_local_cpu): Check
extended family and model for Intel processors. Support Intel
Atom.
From-SVN: r147736
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/i386/driver-i386.c | 19 |
2 files changed, 22 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 59721f4..4ac176d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-05-20 H.J. Lu <hongjiu.lu@intel.com> + + * config/i386/driver-i386.c (host_detect_local_cpu): Check + extended family and model for Intel processors. Support Intel + Atom. + 2009-05-20 Olivier Hainque <hainque@adacore.com> * gstab.h (stab_code_type): Define, to be used instead of the diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c index cb66937..d4ba466 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -395,9 +395,22 @@ const char *host_detect_local_cpu (int argc, const char **argv) __cpuid (1, eax, ebx, ecx, edx); - /* We don't care for extended family. */ model = (eax >> 4) & 0x0f; family = (eax >> 8) & 0x0f; + if (vendor == SIG_INTEL) + { + unsigned int extended_model, extended_family; + + extended_model = (eax >> 12) & 0xf0; + extended_family = (eax >> 20) & 0xff; + if (family == 0x0f) + { + family += extended_family; + model += extended_model; + } + else if (family == 0x06) + model += extended_model; + } has_sse3 = ecx & bit_SSE3; has_ssse3 = ecx & bit_SSSE3; @@ -496,8 +509,8 @@ const char *host_detect_local_cpu (int argc, const char **argv) break; case PROCESSOR_PENTIUMPRO: if (has_longmode) - /* It is Core 2 Duo. */ - cpu = "core2"; + /* It is Core 2 or Atom. */ + cpu = (model == 28) ? "atom" : "core2"; else if (arch) { if (has_sse3) |