Re: [PATCH] rs6000: Canonicalize copysign (x, -1) back to -abs (x) in the backend [PR112606]

2023-12-04 Thread Kewen.Lin
Hi Jakub, on 2023/11/25 18:17, Jakub Jelinek wrote: > Hi! > > The middle-end has been changed quite recently to canonicalize > -abs (x) to copysign (x, -1) rather than the other way around. > While I agree with that at GIMPLE level, since it matches the GIMPLE > goal of as few operations as

RE: [PATCH] rs6000: Canonicalize copysign (x, -1) back to -abs (x) in the backend [PR112606]

2023-11-27 Thread Tamar Christina
> -Original Message- > From: Jakub Jelinek > Sent: Monday, November 27, 2023 8:13 AM > To: Tamar Christina > Cc: Xi Ruoyao ; Segher Boessenkool > ; David Edelsohn ; gcc- > patc...@gcc.gnu.org; Andrew Pinski > Subject: Re: [PATCH] rs6000: Canonicalize copysign

Re: [PATCH] rs6000: Canonicalize copysign (x, -1) back to -abs (x) in the backend [PR112606]

2023-11-27 Thread Jakub Jelinek
On Mon, Nov 27, 2023 at 07:55:52AM +, 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

RE: [PATCH] rs6000: Canonicalize copysign (x, -1) back to -abs (x) in the backend [PR112606]

2023-11-26 Thread Tamar Christina
> On Sat, Nov 25, 2023 at 12:03:56PM +, 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

Re: [PATCH] rs6000: Canonicalize copysign (x, -1) back to -abs (x) in the backend [PR112606]

2023-11-25 Thread Jakub Jelinek
On Sat, Nov 25, 2023 at 12:03:56PM +, 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

RE: [PATCH] rs6000: Canonicalize copysign (x, -1) back to -abs (x) in the backend [PR112606]

2023-11-25 Thread Tamar Christina
> -Original Message- > From: Xi Ruoyao > Sent: Saturday, November 25, 2023 10:43 AM > To: Jakub Jelinek ; Segher Boessenkool > ; David Edelsohn > Cc: gcc-patches@gcc.gnu.org; Tamar Christina ; > Andrew Pinski > Subject: Re: [PATCH] rs6000: Canonicalize copysign

Re: [PATCH] rs6000: Canonicalize copysign (x, -1) back to -abs (x) in the backend [PR112606]

2023-11-25 Thread Xi Ruoyao
On Sat, 2023-11-25 at 11:17 +0100, Jakub Jelinek wrote: > The middle-end has been changed quite recently to canonicalize > -abs (x) to copysign (x, -1) rather than the other way around. > While I agree with that at GIMPLE level, since it matches the GIMPLE > goal of as few operations as possible