public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch] [x86_64]: Add bdver4 for multi versioning and fix AMD cpu model detection.
@ 2015-10-09  9:50 Kumar, Venkataramanan
  2015-10-09  9:55 ` Uros Bizjak
  0 siblings, 1 reply; 6+ messages in thread
From: Kumar, Venkataramanan @ 2015-10-09  9:50 UTC (permalink / raw)
  To: Uros Bizjak (ubizjak@gmail.com), gcc-patches

Hi Uros,

Please find below patch that adds bdver4 target for multi versioning. 
Also I while computing model, the extended_model is incorrectly left shifted  by 4. I have removed it now.

Is below patch Ok for trunk ? 
GCC bootstrap and regressions passed.

diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index bb3a722..8676747 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-09  Venkataramanan Kumar <venkataramanan.kumar@amd.com>
+
+       * config/i386/cpuinfo.c (get_amd_cpu): Detect bdver4.
+       (__cpu_indicator_init): Fix model selection for AMD CPUs.
+
 2015-10-05  Kirill Yukhin  <kirill.yukhin@intel.com>

        * config/i386/cpuinfo.c (get_intel_cpu): Detect "skylake-avx512".
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index 0cbbc85..1313ca3 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -169,6 +169,9 @@ get_amd_cpu (unsigned int family, unsigned int model)
       /* Bulldozer version 3 "Steamroller"  */
       if (model >= 0x30 && model <= 0x4f)
        __cpu_model.__cpu_subtype = AMDFAM15H_BDVER3;
+      /* Bulldozer version 4 "Excavator"   */
+      if (model >= 0x60 && model <= 0x7f)
+       __cpu_model.__cpu_subtype = AMDFAM15H_BDVER4;
       break;
     /* AMD Family 16h "btver2" */
     case 0x16:
@@ -455,7 +458,7 @@ __cpu_indicator_init (void)
       if (family == 0x0f)
        {
          family += extended_family;
-         model += (extended_model << 4);
+         model += extended_model;
        }

       /* Get CPU type.  */

Regards,
Venkat.






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-18 18:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-09  9:50 [Patch] [x86_64]: Add bdver4 for multi versioning and fix AMD cpu model detection Kumar, Venkataramanan
2015-10-09  9:55 ` Uros Bizjak
2015-10-09 10:01   ` Kumar, Venkataramanan
2015-10-13 15:16   ` Kumar, Venkataramanan
2015-10-13 15:42     ` Uros Bizjak
2015-10-18 19:28       ` Kumar, Venkataramanan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).