public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Shalnov, Sergey" <sergey.shalnov@intel.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: "Peryt, Sebastian" <sebastian.peryt@intel.com>,
	"Ivchenko, Alexander"	<alexander.ivchenko@intel.com>,
	'Uros Bizjak' <ubizjak@gmail.com>,
	"Kirill Yukhin" <kirill.yukhin@gmail.com>
Subject: [PATCH, i386] Fix ix86_multiplication_cost for SKX
Date: Wed, 07 Feb 2018 13:02:00 -0000	[thread overview]
Message-ID: <71475DE127B5E94A8E189586234C0888234A1D33@irsmsx111.ger.corp.intel.com> (raw)

Hi,
This patch is one of the set of patches to fix SKX costs.

I think multiplication costs calculation algorithm needs to be adjusted in gcc/config/i386/i386.c ix86_multiplication_cost() function.
For TARGET_AVX512DQ emulation is not used and single vpmullq instruction emitted.
I think we have to align costs calculation algorithm with sequence of emitted instructions.

I don't see visible regressions for this change. This patch helps to avoid a regressions with further changes.

Could you please merge the patch to the main trunk?

Thank you
Sergey

2018-02-06  Sergey Shalnov  <Sergey.Shalnov@intel.com>
	gcc/
	* config/i386/i386.c (ix86_multiplication_cost): Fix multiplication
	cost for TARGET_AVX512DQ since it uses vpmullq instead
	emulated sequence


diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 70b6775..6f4ec5d 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -40393,6 +40393,10 @@ ix86_multiplication_cost (const struct processor_costs *cost,
 			   ? cost->mulsd : cost->mulss, true);
   else if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT)
     {
+      /* vpmullq is used in this case. No emulation is needed.  */
+      if (TARGET_AVX512DQ)
+	return ix86_vec_cost (mode, cost->mulss, true);
+
       /* V*QImode is emulated with 7-13 insns.  */
       if (mode == V16QImode || mode == V32QImode)
 	{

             reply	other threads:[~2018-02-07 13:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 13:02 Shalnov, Sergey [this message]
2018-02-07 13:16 ` Uros Bizjak
2018-02-08 11:55   ` Shalnov, Sergey

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=71475DE127B5E94A8E189586234C0888234A1D33@irsmsx111.ger.corp.intel.com \
    --to=sergey.shalnov@intel.com \
    --cc=alexander.ivchenko@intel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kirill.yukhin@gmail.com \
    --cc=sebastian.peryt@intel.com \
    --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).