public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kumar, Venkataramanan" <Venkataramanan.Kumar@amd.com>
To: "Uros Bizjak (ubizjak@gmail.com)" <ubizjak@gmail.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [Patch] [x86_64]: Add bdver4 for multi versioning and fix AMD cpu model detection.
Date: Fri, 09 Oct 2015 09:50:00 -0000	[thread overview]
Message-ID: <7794A52CE4D579448B959EED7DD0A4723DD6E9EB@satlexdag06.amd.com> (raw)

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.






             reply	other threads:[~2015-10-09  9:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09  9:50 Kumar, Venkataramanan [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7794A52CE4D579448B959EED7DD0A4723DD6E9EB@satlexdag06.amd.com \
    --to=venkataramanan.kumar@amd.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).