> In this case, having only check for family ID should be enough. If
>BTVER1 and BTVER2 can be uniquely determined by their family IDs ,

>IMO, this would be the most future-proof approach. Signature checks will 
>override family id checks which will override cpuid checks.

Thank you Uros!

I have modified source only for BTVER2. 
The way BTVER1 is currently assigned to processor includes more than one 
family. So, I am leaving that unmoved.

Bootstrap passes.
Is it OK for trunk and backport to open branches.

Regards
-Ganesh


diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 706fedc..202bd99 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-01  Ganesh Gopalasubramanian  <ganesh.gopalasubraman...@amd.com>
+
+       * config/i386/driver-i386.c (host_detect_local_cpu): Handle AMD's 
extended family
+       information. Handle BTVER2 cpu with cpuid family value.  
+
 2014-07-31  James Greenhalgh  <james.greenha...@arm.com>
 
        * config/aarch64/arm_neon.h (vpadd_<suf><8,16,32,64>): Move to
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 1c6385f..0402c90 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -432,7 +432,8 @@ const char *host_detect_local_cpu (int argc, const char 
**argv)
 
   model = (eax >> 4) & 0x0f;
   family = (eax >> 8) & 0x0f;
-  if (vendor == signature_INTEL_ebx)
+  if ((vendor == signature_INTEL_ebx) ||
+      (vendor == signature_AMD_ebx))
     {
       unsigned int extended_model, extended_family;
 
@@ -576,7 +577,7 @@ const char *host_detect_local_cpu (int argc, const char 
**argv)
 
       if (name == signature_NSC_ebx)
        processor = PROCESSOR_GEODE;
-      else if (has_movbe)
+      else if (family == 22)
        processor = PROCESSOR_BTVER2;
       else if (has_avx2)
         processor = PROCESSOR_BDVER4;

Reply via email to