public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/106069] [12/13 Regression] wrong code with -O -fno-tree-forwprop -maltivec on ppc64le
Date: Wed, 03 Aug 2022 08:24:43 +0000	[thread overview]
Message-ID: <bug-106069-4-UQH4HjERgY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106069-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #22 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 3 Aug 2022, linkw at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106069
> 
> --- Comment #21 from Kewen Lin <linkw at gcc dot gnu.org> ---
> I didn't look into this in details, but something in the culprit commit caught
> my eyes, take altivec_vmrghh as example:
> 
> Before the patch, the pattern
> 
>    [(set (match_operand:V8HI 0 "register_operand" "=v")
>          (vec_select:V8HI
>            (vec_concat:V16HI
>              (match_operand:V8HI 1 "register_operand" "v")
>              (match_operand:V8HI 2 "register_operand" "v"))
>            (parallel [(const_int 0) (const_int 8)
>                       (const_int 1) (const_int 9)
>                       (const_int 2) (const_int 10)
>                       (const_int 3) (const_int 11)])))]
> 
> can match vmrghh on BE while vmrglh on LE. It indicates this pattern has
> different semantic from underlying instruction perspectives.
> 
> After the patch, this pattern only matches vmrghh.
> 
> IMHO, this part has semantic change before and after the patch. The code before
> the patch looks more reasonable to me, since the pattern can have different
> meanings on BE and LE (underlying behavior).

Ideally we would avoid semantic difference of RTL depending on the target.
If that's not avoidable there should be target macros/hooks that specify
the desired semantics.  I assume the semantic difference is in
vec_concat behavior but that's just documented as

@findex vec_concat
@item (vec_concat:@var{m} @var{x1} @var{x2})
Describes a vector concat operation.  The result is a concatenation of the
vectors or scalars @var{x1} and @var{x2}; its length is the sum of the
lengths of the two inputs.

which is a bit unspecific.  To me it implies that
vec_select of a single lane N of the concat result can be distributed
to the operands of the vec_concat in the obvious way (if N >=
GET_MODE_NUNITS (x1) subtract GET_MODE_NUNITS and use x2)

  parent reply	other threads:[~2022-08-03  8:24 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 23:13 [Bug target/106069] New: " mpolacek at gcc dot gnu.org
2022-06-23 23:15 ` [Bug target/106069] [12/13 Regression] " mpolacek at gcc dot gnu.org
2022-06-23 23:18 ` mpolacek at gcc dot gnu.org
2022-06-24  3:25 ` luoxhu at gcc dot gnu.org
2022-06-24 13:03 ` mpolacek at gcc dot gnu.org
2022-06-30  8:13 ` luoxhu at gcc dot gnu.org
2022-06-30  8:15 ` luoxhu at gcc dot gnu.org
2022-06-30 17:32 ` segher at gcc dot gnu.org
2022-06-30 17:34 ` segher at gcc dot gnu.org
2022-07-01  1:52 ` luoxhu at gcc dot gnu.org
2022-07-25 15:54 ` rguenth at gcc dot gnu.org
2022-07-25 20:16 ` segher at gcc dot gnu.org
2022-07-25 20:18 ` segher at gcc dot gnu.org
2022-07-26  3:34 ` luoxhu at gcc dot gnu.org
2022-07-26  3:34 ` luoxhu at gcc dot gnu.org
2022-07-26  3:35 ` luoxhu at gcc dot gnu.org
2022-07-26  3:53 ` luoxhu at gcc dot gnu.org
2022-07-26  6:28 ` luoxhu at gcc dot gnu.org
2022-07-29 11:10 ` rguenth at gcc dot gnu.org
2022-07-29 11:21 ` rguenth at gcc dot gnu.org
2022-08-03  6:10 ` yinyuefengyi at gmail dot com
2022-08-03  6:38 ` yinyuefengyi at gmail dot com
2022-08-03  8:06 ` linkw at gcc dot gnu.org
2022-08-03  8:24 ` rguenther at suse dot de [this message]
2022-08-03  8:50 ` linkw at gcc dot gnu.org
2022-08-03  8:59 ` rguenth at gcc dot gnu.org
2022-08-03  9:20 ` rsandifo at gcc dot gnu.org
2022-08-03  9:25 ` rsandifo at gcc dot gnu.org
2022-08-03 18:01 ` segher at gcc dot gnu.org
2022-08-03 18:06 ` segher at gcc dot gnu.org
2022-08-04  9:17 ` rsandifo at gcc dot gnu.org
2022-08-04  9:21 ` rearnsha at gcc dot gnu.org
2022-08-04  9:59 ` yinyuefengyi at gmail dot com
2022-08-04 10:01 ` yinyuefengyi at gmail dot com
2023-01-16 18:00 ` jakub at gcc dot gnu.org
2023-03-24 16:16 ` jakub at gcc dot gnu.org
2023-03-24 17:01 ` bergner at gcc dot gnu.org
2023-03-31  2:57 ` yinyuefengyi at gmail dot com
2023-05-08 12:24 ` [Bug target/106069] [12/13/14 " rguenth 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-106069-4-UQH4HjERgY@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).