This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, i386] Handle extended family cpuid info for AMD
- From: "Gopalasubramanian, Ganesh" <Ganesh dot Gopalasubramanian at amd dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: "Uros Bizjak (ubizjak at gmail dot com)" <ubizjak at gmail dot com>
- Date: Thu, 31 Jul 2014 11:28:11 +0000
- Subject: [PATCH, i386] Handle extended family cpuid info for AMD
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is 165.204.84.221) smtp dot mailfrom=Ganesh dot Gopalasubramanian at amd dot com;
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
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;