public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Richard Sandiford <richard.sandiford@arm.com>
Cc: gcc-patches@gcc.gnu.org, hongtao.liu@intel.com,
	ebotcazou@libertysurf.fr,  krebbel@linux.ibm.com,
	linkw@gcc.gnu.org, syq@gcc.gnu.org,  xuchenghua@loongson.cn,
	ams@baylibre.com, richard.earnshaw@arm.com
Subject: Re: [PATCH] middle-end/114189 - drop uses of vcond{,u,eq}_optab
Date: Fri, 14 Jun 2024 14:06:55 +0200 (CEST)	[thread overview]
Message-ID: <271q309s-rqn4-81n9-8r3p-799q36on9356@fhfr.qr> (raw)
In-Reply-To: <mpted8zpyn6.fsf@arm.com>

On Fri, 14 Jun 2024, Richard Sandiford wrote:

> Richard Biener <rguenther@suse.de> writes:
> > On Fri, 14 Jun 2024, Richard Sandiford wrote:
> >
> >> Richard Biener <rguenther@suse.de> writes:
> >> > The following retires vcond{,u,eq} optabs by stopping to use them
> >> > from the middle-end.  Targets instead (should) implement vcond_mask
> >> > and vec_cmp{,u,eq} optabs.  The PR this change refers to lists
> >> > possibly affected targets - those implementing these patterns,
> >> > and in particular it lists mips, sparc and ia64 as targets that
> >> > most definitely will regress while others might simply remove
> >> > their vcond{,u,eq} patterns.
> >> >
> >> > I'd appreciate testing, I do not expect fallout for x86 or arm/aarch64.
> >> > I know riscv doesn't implement any of the legacy optabs.  But less
> >> > maintained vector targets might need adjustments.
> >> >
> >> > I want to get rid of those optabs for GCC 15.  If I don't hear from
> >> > you I will assume your target is fine.
> >> 
> >> Great!  Thanks for doing this.
> >> 
> >> Is there a plan for how we should handle vector comparisons that
> >> have to be done as the inverse of the negated condition?  Should
> >> targets simply not provide vec_cmp for such conditions and leave
> >> the target-independent code to deal with the fallout?  (For a
> >> standalone comparison, it would invert the result.  For a VEC_COND_EXPR
> >> it would swap the true and false values.)
> >
> > I would expect that the ISEL pass which currently deals with finding
> > valid combos of .VCMP{,U,EQ} and .VCOND_MASK deals with this.
> > So how do we deal with this right now?  I expect RTL expansion will
> > do the inverse trick, no?
> 
> I think in practice (at least for the targets I've worked on),
> the target's vec_cmp handles the inversion itself.  Thus the
> main optimisation done by targets' vcond patterns is to avoid
> the inversion (and instead swap the true/false values) when the
> "opposite" comparison is the native one.

I see.  I suppose whether or not vec_cmp is handled is determined
by a FAIL so it's somewhat difficult to determine this at ISEL time.

Meanwhile I've opened PR115490 with the x86 fallout from applying the
patch.

Richard.

  reply	other threads:[~2024-06-14 12:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 10:31 Richard Biener
2024-06-14 11:03 ` Richard Sandiford
2024-06-14 11:07   ` Richard Biener
2024-06-14 11:11     ` Richard Sandiford
2024-06-14 12:06       ` Richard Biener [this message]
2024-06-14 12:10         ` Richard Biener
2024-06-17  9:13           ` Richard Sandiford
2024-06-18  6:17             ` Richard Biener
2024-06-20 18:38               ` Richard Sandiford
2024-06-21  9:53                 ` Richard Biener
2024-06-21 14:26                   ` Richard Sandiford
2024-06-14 14:53 ` Hongtao Liu
2024-06-17  2:59   ` Hongtao Liu
2024-06-14 18:33 ` Xi Ruoyao
2024-06-17  6:00 ` Kewen.Lin
2024-06-17  6:16   ` Richard Biener
2024-06-17  7:27     ` Kewen.Lin
2024-06-17 10:31     ` Stefan Schulze Frielinghaus
2024-06-17 10:16 ` 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=271q309s-rqn4-81n9-8r3p-799q36on9356@fhfr.qr \
    --to=rguenther@suse.de \
    --cc=ams@baylibre.com \
    --cc=ebotcazou@libertysurf.fr \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=krebbel@linux.ibm.com \
    --cc=linkw@gcc.gnu.org \
    --cc=richard.earnshaw@arm.com \
    --cc=richard.sandiford@arm.com \
    --cc=syq@gcc.gnu.org \
    --cc=xuchenghua@loongson.cn \
    /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).