public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amonakov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/108401] gcc defeats vector constant generation with intrinsics
Date: Mon, 16 Jan 2023 07:00:40 +0000	[thread overview]
Message-ID: <bug-108401-4-simPM5hhiG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108401-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108401

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu.org

--- Comment #4 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
(In reply to Hongtao.liu from comment #3)
> > and gcc 12 generates a worse code:
> > 
> >         movabs  rax, 71777214294589695
> >         vmovq   xmm1, rax
> >         vpbroadcastq    ymm0, xmm1
> >         ret
> > 
> 
> It's on purpose by edafb35bdadf309ebb9d1eddc5549f9e1ad49c09 since
> microbenchmark shows moving from imm is faster than memory.

But the bug is not asking you to reinstate loading from memory. The bug is
asking you to notice that the result can be constructed via cmpeq+psrlw, which
is even better than a broadcast (cmpeq with dst same as src is usually a
dependency-breaking instruction that does not occupy an execution port).

  parent reply	other threads:[~2023-01-16  7:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-14  0:24 [Bug target/108401] New: " andysem at mail dot ru
2023-01-16  5:06 ` [Bug target/108401] " pinskia at gcc dot gnu.org
2023-01-16  5:23 ` pinskia at gcc dot gnu.org
2023-01-16  5:28 ` crazylht at gmail dot com
2023-01-16  7:00 ` amonakov at gcc dot gnu.org [this message]
2023-01-16  7:47 ` rguenth at gcc dot gnu.org
2023-01-16 10:04 ` andysem at mail dot ru
2023-01-16 10:42 ` andysem at mail dot ru
2023-01-17  5:42 ` crazylht at gmail dot com

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=bug-108401-4-simPM5hhiG@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).