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. > 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. Jakub