> -----Original Message----- > From: Jakub Jelinek <ja...@redhat.com> > Sent: Monday, November 27, 2023 8:13 AM > To: Tamar Christina <tamar.christ...@arm.com> > Cc: Xi Ruoyao <xry...@xry111.site>; Segher Boessenkool > <seg...@kernel.crashing.org>; David Edelsohn <dje....@gmail.com>; gcc- > patc...@gcc.gnu.org; Andrew Pinski <apin...@marvell.com> > Subject: Re: [PATCH] rs6000: Canonicalize copysign (x, -1) back to -abs (x) in > the backend [PR112606] > > On Mon, Nov 27, 2023 at 07:55:52AM +0000, Tamar Christina wrote: > > > 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. > > https://gcc.gnu.org/r14-5613
Oh, that's nice! If that's the case a simpler fix could be to let COPYSIGN become one of these as well, and then just have PPC do a FAIL on the abs and neg cases. Expand_copysign already does the fneg (fabs ()) rewriting if the target rejects the optab through expand_copysign_absneg That would also fix the i386 and Arm assembly scan failures and te phi-opts case when the IFN isn't available.. I can do that if you prefer? Since those are on my list to fix anyway. Thanks, Tamar > > Jakub