diff mbox

[i386] Handle extended family cpuid info for AMD

Message ID EB4625145972F94C9680D8CADD651615787D3293@SATLEXDAG02.amd.com
State New
Headers show

Commit Message

Gopalasubramanian, Ganesh July 31, 2014, 11:28 a.m. UTC
Hi,

The below patch handles the AMD's cpuid family information.
With the information from cpuid, BTVER2 cpu for -march=native flag is handled.

Bootstrap passes.
Is it OK for trunk and branches?

Regards
Ganesh

Comments

Uros Bizjak July 31, 2014, 11:37 a.m. UTC | #1
On Thu, Jul 31, 2014 at 1:28 PM, Gopalasubramanian, Ganesh
<Ganesh.Gopalasubramanian@amd.com> wrote:

> The below patch handles the AMD's cpuid family information.
> With the information from cpuid, BTVER2 cpu for -march=native flag is handled.

But, looking to processor_alias_table in config/i386/i386.c, only
PROCESSOR_BTVER2 defines PTA_MOVBE. According to this, the logic is
already correct, so the patch is not needed.

Uros.
Gopalasubramanian, Ganesh July 31, 2014, 11:46 a.m. UTC | #2
> But, looking to processor_alias_table in config/i386/i386.c, only

> PROCESSOR_BTVER2 defines PTA_MOVBE. According to this, the logic is already correct, so the patch is not needed.


We are evaluating bdver4 cpu. Bdver4 also supports MOVBE. I will submit patch for bdver4 PTA after our evaluation.

Ganesh.
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6223bd6..3f8bb2c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2014-07-31  Ganesh Gopalasubramanian  <Ganesh.Gopalasubramanian@amd.com>
+
+	* tree-sra.c (host_detect_local_cpu): Handle AMD's extended family
+	information. Handle BTVER2 cpu with cpuid family value.  
+
 2014-07-30  Martin Jambor  <mjambor@suse.cz>
 
 	* tree-sra.c (sra_ipa_modify_assign): Change type of the first
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 1c6385f..21ae1f3 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 (has_movbe && family == 22)
 	processor = PROCESSOR_BTVER2;
       else if (has_avx2)
         processor = PROCESSOR_BDVER4;