diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-06-12 16:33:23 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-06-24 08:12:38 -0700 |
commit | 134f7c941929b3d099322a89928c04e5ac69267e (patch) | |
tree | 56a35aef501d5b9b5fdbabdd9b45f0b31004242d /gcc | |
parent | 403e166b974f53982d78efdd70938d05b6983b2a (diff) | |
download | gcc-134f7c941929b3d099322a89928c04e5ac69267e.zip gcc-134f7c941929b3d099322a89928c04e5ac69267e.tar.gz gcc-134f7c941929b3d099322a89928c04e5ac69267e.tar.bz2 |
x86: Remove brand ID check for Intel processors
Brand ID was a feature that briefly existed in some Pentium III and
Pentium 4 CPUs. The CPUs that had non-zero brand ID still have had
valid family/model. Brand ID just gives a marketing name for the CPU.
Remove the extra code for brand ID check.
gcc/
PR target/95660
* common/config/i386/cpuinfo.h (get_intel_cpu): Remove brand_id.
(cpu_indicator_init): Likewise.
* config/i386/driver-i386.c (host_detect_local_cpu): Updated.
gcc/testsuite/
PR target/95660
* gcc.target/i386/builtin_target.c (check_detailed): Updated.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/common/config/i386/cpuinfo.h | 12 | ||||
-rw-r--r-- | gcc/config/i386/driver-i386.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/builtin_target.c | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/gcc/common/config/i386/cpuinfo.h b/gcc/common/config/i386/cpuinfo.h index 27b7b4d..3eda532 100644 --- a/gcc/common/config/i386/cpuinfo.h +++ b/gcc/common/config/i386/cpuinfo.h @@ -254,13 +254,12 @@ get_amd_cpu (struct __processor_model *cpu_model, static inline const char * get_intel_cpu (struct __processor_model *cpu_model, struct __processor_model2 *cpu_model2, - unsigned int *cpu_features2, - unsigned int brand_id) + unsigned int *cpu_features2) { const char *cpu = NULL; - /* Parse family and model only for brand ID 0 and model 6. */ - if (brand_id != 0 || cpu_model2->__cpu_family != 0x6) + /* Parse family and model only for model 6. */ + if (cpu_model2->__cpu_family != 0x6) return cpu; switch (cpu_model2->__cpu_model) @@ -758,7 +757,7 @@ cpu_indicator_init (struct __processor_model *cpu_model, int max_level; unsigned int vendor; - unsigned int model, family, brand_id; + unsigned int model, family; unsigned int extended_model, extended_family; /* This function needs to run just once. */ @@ -791,7 +790,6 @@ cpu_indicator_init (struct __processor_model *cpu_model, model = (eax >> 4) & 0x0f; family = (eax >> 8) & 0x0f; - brand_id = ebx & 0xff; extended_model = (eax >> 12) & 0xf0; extended_family = (eax >> 20) & 0xff; @@ -813,7 +811,7 @@ cpu_indicator_init (struct __processor_model *cpu_model, get_available_features (cpu_model, cpu_model2, cpu_features2, ecx, edx); /* Get CPU type. */ - get_intel_cpu (cpu_model, cpu_model2, cpu_features2, brand_id); + get_intel_cpu (cpu_model, cpu_model2, cpu_features2); cpu_model->__cpu_vendor = VENDOR_INTEL; } else if (vendor == signature_AMD_ebx) diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c index e9e4d6e..6da2a15 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -555,7 +555,7 @@ const char *host_detect_local_cpu (int argc, const char **argv) cpu = "pentium"; break; case PROCESSOR_PENTIUMPRO: - cpu = get_intel_cpu (&cpu_model, &cpu_model2, cpu_features2, 0); + cpu = get_intel_cpu (&cpu_model, &cpu_model2, cpu_features2); if (cpu == NULL) { if (arch) diff --git a/gcc/testsuite/gcc.target/i386/builtin_target.c b/gcc/testsuite/gcc.target/i386/builtin_target.c index e87f262..aa96805 100644 --- a/gcc/testsuite/gcc.target/i386/builtin_target.c +++ b/gcc/testsuite/gcc.target/i386/builtin_target.c @@ -46,7 +46,7 @@ check_detailed () { case VENDOR_INTEL: assert (__builtin_cpu_is ("intel")); - get_intel_cpu (&cpu_model, &cpu_model2, cpu_features2, 0); + get_intel_cpu (&cpu_model, &cpu_model2, cpu_features2); break; case VENDOR_AMD: assert (__builtin_cpu_is ("amd")); |