public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Robin Dapp <rdapp.gcc@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, Tamar.Christina@arm.com
Subject: Re: [PATCH] match.pd: Use element_mode instead of TYPE_MODE.
Date: Tue, 27 Jun 2023 08:46:58 +0000 (UTC)	[thread overview]
Message-ID: <nycvar.YFH.7.77.849.2306270840440.4723@jbgna.fhfr.qr> (raw)
In-Reply-To: <802f50c6-6e1d-9e93-a75c-ce947bd1784b@gmail.com>

On Tue, 27 Jun 2023, Robin Dapp wrote:

> > Why does the expander not have a fallback here?  If we put up
> > restrictions like this like we do for vector operations (after
> > vector lowering!), we need to document this.  Your check covers
> > more than just FP16 types as well which I think is undesirable.
> 
> I'm not sure I follow.  What would we fall back to if
> (_Float16)a + (_Float16)b is not supported?  Should I provide
> a (_Float16)((float)a + (float)b) fallback?  But that would just
> undo the simplification we performed.  Or do you mean in optabs
> already?

Yeah, the optab should already have the fallback of WIDENing here?
So why does that fail?

> > So it seems for FP16 we need this for correctness (to not ICE)
> > while for other modes it might be appropriate for performance
> > (though I cannot imagine a target supporting say long double
> > not supporting float).
> 
> What about something like:
> 
> -                  && target_supports_op_p (newtype, op, optab_default)
> +                  && (!target_supports_op_p (itype, op, optab_default)
> +                      || element_mode (newtype) != HFmode
> +                      || target_supports_op_p (newtype, op, optab_default))

I'd say

      && (!target_supports_op_p (itype, op, optab_default)
          || target_supports_op_p (newtype, op, optab_default))

would make sense in general.  But as said you'll likely find (many?)
other places affected.  Singling out HFmode probably doesn't work
across targets since this mode isn't defined in generic code.

Richard.

  reply	other threads:[~2023-06-27  8:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 14:26 Robin Dapp
2023-06-26 23:18 ` Jeff Law
2023-06-27  6:30 ` Richard Biener
2023-06-27  6:47   ` Robin Dapp
2023-06-27  7:03     ` Richard Biener
2023-06-27  7:42       ` Robin Dapp
2023-06-27  8:46         ` Richard Biener [this message]
2023-06-27  9:42           ` Robin Dapp
2023-06-27  9:50             ` Richard Biener
2023-06-27  9:55               ` Robin Dapp
2023-06-27 10:05                 ` Richard Biener
2023-06-27 15:55                   ` Robin Dapp
2023-06-27 23:05                     ` Andrew Pinski
2023-06-28  7:27                       ` Andrew Pinski

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=nycvar.YFH.7.77.849.2306270840440.4723@jbgna.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=Tamar.Christina@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rdapp.gcc@gmail.com \
    /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).