From: Richard Biener <richard.guenther@gmail.com>
To: Andrew Stubbs <ams@codesourcery.com>
Cc: GCC Development <gcc@gcc.gnu.org>,
Tamar Christina <Tamar.Christina@arm.com>
Subject: Re: Complex multiply optimization working?
Date: Mon, 11 Apr 2022 14:02:32 +0200 [thread overview]
Message-ID: <CAFiYyc2pVBh-zrH9WnDw1vHKSASTeMgcEqHhb9AW2EU98gFU9A@mail.gmail.com> (raw)
In-Reply-To: <19966fd3-8bfe-5a1a-41cf-4d95d99e69fd@codesourcery.com>
On Mon, Apr 11, 2022 at 1:26 PM Andrew Stubbs <ams@codesourcery.com> wrote:
>
> Hi all,
>
> I've been looking at implementing the complex multiply patterns for the
> amdgcn port, but I'm not getting the code I was hoping for. When I try
> to use the patterns on x86_64 or AArch64 they don't seem to work there
> either, so is there something wrong with the middle-end? I've tried both
> current HEAD and GCC 11.
>
> The example shown in the internals manual is a simple loop multiplying
> two arrays of complex numbers, and writing the results to a third. I had
> expected that it would use the largest vectorization factor available,
> with the real/imaginary numbers in even/odd lanes as described, but the
> vectorization factor is only 2 (so, a single complex number), and I have
> to set -fvect-cost-model=unlimited to get even that.
>
> I tried another example with SLP and that too uses the cmul patterns
> only for a single real/imaginary pair.
>
> Did proper vectorization of cmul ever really work? There is a case in
> the testsuite for the pattern match, but it isn't in a loop.
You need to check the vectorizer dump whether a complex pattern
was recognized or not. Did you properly use -ffast-math?
>
> Thanks
>
> Andrew
>
> P.S. I attached my testcase, in case I'm doing something stupid.
>
> P.P.S. The manual says the pattern is "cmulm4", etc., but it's actually
> "cmulm3" in the implementation.
next prev parent reply other threads:[~2022-04-11 12:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-11 11:19 Andrew Stubbs
2022-04-11 12:02 ` Richard Biener [this message]
2022-04-11 12:47 ` Andrew Stubbs
2022-04-11 12:03 ` Tamar Christina
2022-04-11 12:51 ` Andrew Stubbs
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=CAFiYyc2pVBh-zrH9WnDw1vHKSASTeMgcEqHhb9AW2EU98gFU9A@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=Tamar.Christina@arm.com \
--cc=ams@codesourcery.com \
--cc=gcc@gcc.gnu.org \
/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).