public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tamar Christina <Tamar.Christina@arm.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Xi Ruoyao <xry111@xry111.site>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	David Edelsohn <dje.gcc@gmail.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Andrew Pinski <apinski@marvell.com>
Subject: RE: [PATCH] rs6000: Canonicalize copysign (x, -1) back to -abs (x) in the backend [PR112606]
Date: Mon, 27 Nov 2023 07:55:52 +0000	[thread overview]
Message-ID: <VI1PR08MB53250CD94CF678D543201B95FFBDA@VI1PR08MB5325.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <ZWHj5tbGxptjCQ3A@tucnak>

> On Sat, Nov 25, 2023 at 12:03:56PM +0000, Tamar Christina wrote:
> > For the C99 versions of copysign, expand_COPYSIGN has optimized
> expansions inplace.
> > One of the hooks there forces it to abs/neg.  There is also  code in
> > place for if the target prefers integer expansion over floating point one etc.
> 
> I thought the simplify-rtx.cc canonicalization of copysign (x, negative) to (neg
> (abs ()) was disabled shortly after your change.

Yeah, but it was unclear what that code was supposed to do as it was dead code
before.  Tbf the patch you posted is probably the right thing to do for now.

> 
> > However the issue here is that IFNs at the moment only support direct
> > expansion.  That is, you need an optab to get the rewriting done.  So you
> have a catch 22, unlike the C99 versions which have a libcall fallback.
> 
> For POPCOUNT I've introduced recently a way to provide custom expand_*
> function and decide there what optimizations to use, even when it otherwise
> is an integral unary optab ifn.
> 

Oh that sounds interesting, do you have a commit for me to look at? I couldn't
Spot anything obvious in the history.

Cheers,
Tamar

> 	Jakub


  reply	other threads:[~2023-11-27  7:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-25 10:17 Jakub Jelinek
2023-11-25 10:42 ` Xi Ruoyao
2023-11-25 12:03   ` Tamar Christina
2023-11-25 12:09     ` Jakub Jelinek
2023-11-27  7:55       ` Tamar Christina [this message]
2023-11-27  8:12         ` Jakub Jelinek
2023-11-27  8:22           ` Tamar Christina
2023-12-04  8:35 ` Patch ping: " Jakub Jelinek
2023-12-04  9:21 ` Kewen.Lin

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=VI1PR08MB53250CD94CF678D543201B95FFBDA@VI1PR08MB5325.eurprd08.prod.outlook.com \
    --to=tamar.christina@arm.com \
    --cc=apinski@marvell.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=segher@kernel.crashing.org \
    --cc=xry111@xry111.site \
    /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).