> 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 via email to