public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Richard Biener <richard.guenther@gmail.com>,
	"Kewen.Lin" <linkw@linux.ibm.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	 Bill Schmidt <wschmidt@linux.ibm.com>,
	Richard Sandiford <richard.sandiford@arm.com>
Subject: Re: [RFC/PATCH] vect: Recog mul_highpart pattern
Date: Tue, 13 Jul 2021 11:44:35 +0200	[thread overview]
Message-ID: <CAFiYyc0Fp9bcyx8nhpo0AwHhyK3bq89ta6yGNXZWqCvna3ugWA@mail.gmail.com> (raw)
In-Reply-To: <mptzguqd014.fsf@arm.com>

On Tue, Jul 13, 2021 at 11:40 AM Richard Sandiford
<richard.sandiford@arm.com> wrote:
>
> Richard Biener <richard.guenther@gmail.com> writes:
> > On Tue, Jul 13, 2021 at 10:53 AM Kewen.Lin <linkw@linux.ibm.com> wrote:
> >>
> >> Hi,
> >>
> >> When I added the support for Power10 newly introduced multiply
> >> highpart instrutions, I noticed that currently vectorizer
> >> doesn't try to vectorize multiply highpart pattern, I hope
> >> this isn't intentional?
> >>
> >> This patch is to extend the existing pattern mulhs handlings
> >> to cover multiply highpart.  Another alternative seems to
> >> recog mul_highpart operation in a general place applied for
> >> scalar code when the target supports the optab for the scalar
> >> operation, it's based on the assumption that one target which
> >> supports vector version of multiply highpart should have the
> >> scalar version.  I noticed that the function can_mult_highpart_p
> >> can check/handle mult_highpart well even without mul_highpart
> >> optab support, I think to recog this pattern in vectorizer
> >> is better.  Is it on the right track?
> >
> > I think it's on the right track, using IFN_LAST is a bit awkward
> > in case yet another case pops up so maybe you can use
> > a code_helper instance instead which unifies tree_code,
> > builtin_code and internal_fn?
> >
> > I also notice that can_mult_highpart_p will return true if
> > only vec_widen_[us]mult_{even,odd,hi,lo} are available,
> > but then the result might be less optimal (or even not
> > handled later)?
> >
> > That is, what about adding optab internal functions
> > for [us]mul_highpart instead, much like the existing
> > ones for MULH{R,}S?
>
> Yeah, that's be my preference too FWIW.  All uses of MULT_HIGHPART_EXPR
> already have to be guarded by can_mult_highpart_p, so replacing it with
> a directly-mapped ifn seems like a natural fit.  (Then can_mult_highpart_p
> should be replaced with a direct_internal_fn_supported_p query.)

But note can_mult_highpart_t covers use via vec_widen_[us]mult_{even,odd,hi,lo}
but I think this specific pattern should key on [us]mul_highpart only?

Because vec_widen_* implies a higher VF (or else we might miss vectorizing?)?

Richard.


> Thanks,
> Richard

  reply	other threads:[~2021-07-13  9:44 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  8:52 Kewen.Lin
2021-07-13  8:58 ` [PATCH] rs6000: Support [u]mul<mode>3_highpart for vector Kewen.Lin
2021-07-13 22:07   ` Segher Boessenkool
2021-07-14  2:12     ` Kewen.Lin
2021-07-14 18:38       ` Segher Boessenkool
2021-07-13  9:35 ` [RFC/PATCH] vect: Recog mul_highpart pattern Richard Biener
2021-07-13  9:40   ` Richard Sandiford
2021-07-13  9:44     ` Richard Biener [this message]
2021-07-13 10:11       ` Richard Sandiford
2021-07-13 10:25   ` Kewen.Lin
2021-07-13 12:42     ` Richard Biener
2021-07-13 14:59       ` Kewen.Lin
2021-07-14  6:38         ` Richard Biener
2021-07-14  7:45           ` Kewen.Lin
2021-07-14  8:38             ` Richard Sandiford
2021-07-14 10:02               ` Kewen.Lin
2021-07-14 11:32                 ` Richard Sandiford
2021-07-14 19:32                   ` Segher Boessenkool
2021-07-15  1:40                     ` Kewen.Lin
2021-07-15 23:08                       ` Segher Boessenkool
2021-07-15  1:37                   ` Kewen.Lin
2021-07-15  7:06             ` [PATCH v3] " Kewen.Lin
2021-07-15  7:17               ` Uros Bizjak
2021-07-15  8:04                 ` Kewen.Lin
2021-07-15  8:23                   ` Uros Bizjak
2021-07-15  8:49                     ` Kewen.Lin
2021-07-15  9:41                       ` Uros Bizjak
2021-07-15  8:40                   ` Kewen.Lin
2021-07-15 11:58                     ` Richard Biener
2021-07-16  5:33                       ` [PATCH v4] " Kewen.Lin
2021-07-19 10:35                         ` Richard Biener

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=CAFiYyc0Fp9bcyx8nhpo0AwHhyK3bq89ta6yGNXZWqCvna3ugWA@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    --cc=richard.sandiford@arm.com \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.ibm.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).