public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/103905] [12 Regression] Miscompiled i386-expand.c with -march=bdver1 and -O3 since r12-1789-g836328b2c99f5b8d
Date: Tue, 04 Jan 2022 21:03:44 +0000	[thread overview]
Message-ID: <bug-103905-4-tQiNsbeVsL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103905-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Martin Liška from comment #1)
> Created attachment 52120 [details]
> Isolated test-case
> 
> Isolated test-case where only the miscompiled function
> ix86_expand_vec_extract_even_odd uses -O3.
> 
> @Uros: Can you please compare -fdump-tree-optimized before and after the
> revision?

When compiled with -O2 -march=bdver1, there are indeed a bunch of suspicious
XOP vpperm instructions in the function:

        vmovd   12(%rsp), %xmm6 # 303   [c=9 l=6]  *movsi_internal/10
        vpperm  %xmm3, %xmm0, %xmm1, %xmm0      # 124   [c=4 l=5]  mmx_ppermv64
        vpaddd  %xmm4, %xmm1, %xmm1     # 129   [c=8 l=4]  *mmx_addv2si3/2
        vpperm  %xmm3, %xmm1, %xmm2, %xmm1      # 131   [c=4 l=5]  mmx_ppermv64
        vpperm  .LC165(%rip), %xmm1, %xmm0, %xmm0       # 134   [c=13 l=9] 
mmx_ppermv64
        vpaddb  %xmm0, %xmm0, %xmm0     # 137   [c=8 l=4]  *mmx_addv8qi3/2
        vpshuflw        $0, %xmm6, %xmm1        # 140   [c=8 l=5] 
*vec_dupv4hi/1
        vpaddb  %xmm1, %xmm0, %xmm0     # 142   [c=8 l=4]  *mmx_addv8qi3/2
        vmovq   %xmm0, 32(%rsp,%rdi)    # 143   [c=4 l=6]  *movv8qi_internal/14
        je      .L4198  # 150   [c=12 l=2]  *jcc

I was not able to test them on my target, so I bet these are the problem.

  parent reply	other threads:[~2022-01-04 21:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 19:29 [Bug target/103905] New: " marxin at gcc dot gnu.org
2022-01-04 19:30 ` [Bug target/103905] " pinskia at gcc dot gnu.org
2022-01-04 19:56 ` marxin at gcc dot gnu.org
2022-01-04 20:12 ` ubizjak at gmail dot com
2022-01-04 21:03 ` ubizjak at gmail dot com [this message]
2022-01-04 21:14 ` ubizjak at gmail dot com
2022-01-04 21:31 ` jakub at gcc dot gnu.org
2022-01-04 21:44 ` ubizjak at gmail dot com
2022-01-05  5:43 ` marxin at gcc dot gnu.org
2022-01-05  7:48 ` rguenth at gcc dot gnu.org
2022-01-05  8:57 ` ubizjak at gmail dot com
2022-01-05  9:02 ` marxin at gcc dot gnu.org
2022-01-05  9:17 ` jakub at gcc dot gnu.org
2022-01-05  9:29 ` ubizjak at gmail dot com
2022-01-05 10:01 ` marxin at gcc dot gnu.org
2022-01-05 19:07 ` cvs-commit at gcc dot gnu.org
2022-01-05 19:14 ` ubizjak at gmail dot com
2022-01-06 21:26 ` pinskia at gcc dot gnu.org

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-103905-4-tQiNsbeVsL@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).