RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Tamar Christina
1): New. > > > > > > (maybe_expand_mult_copysign): Likewise. > > > > > > (expand_expr_real_2): Expand copysign. > > > > > > * optabs.def (xorsign_optab): New. > > > > > > > > > > > > ___

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Richard Biener
opysign. > > > > > * optabs.def (xorsign_optab): New. > > > > > > > > > > > > > > > From: Andrew Pinski > > > > > Sent: Monday, July 10, 2017 12:21:29 AM > > > &g

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Tamar Christina
n): Likewise. > > > > (expand_expr_real_2): Expand copysign. > > > > * optabs.def (xorsign_optab): New. > > > > > > > > ____________________________ > > > > From: Andrew Pinski > > > > Sent: Monday,

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Richard Biener
call_with_1): New. > > > (maybe_expand_mult_copysign): Likewise. > > > (expand_expr_real_2): Expand copysign. > > > * optabs.def (xorsign_optab): New. > > > > > > ____ > > > From: Andrew Pinski > >

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Tamar Christina
ki > > Sent: Monday, July 10, 2017 12:21:29 AM > > To: Tamar Christina > > Cc: GCC Patches; nd; l...@redhat.com; i...@airs.com; rguent...@suse.de > > Subject: Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) > > [Patch (1/2)] > > > > On Mon, Jun 12, 2017 at

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Richard Biener
(xorsign_optab): New. > > > From: Andrew Pinski > Sent: Monday, July 10, 2017 12:21:29 AM > To: Tamar Christina > Cc: GCC Patches; nd; l...@redhat.com; i...@airs.com; rguent...@suse.de > Subject: Re: [GCC][PATCH][mid-end] Optimize x

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-18 Thread Tamar Christina
Ping. From: Tamar Christina Sent: Monday, July 10, 2017 4:47 PM To: Andrew Pinski Cc: GCC Patches; nd; l...@redhat.com; i...@airs.com; rguent...@suse.de Subject: Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)] Hi All, I've re

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-10 Thread Tamar Christina
bject: Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)] On Mon, Jun 12, 2017 at 12:56 AM, Tamar Christina wrote: > Hi All, > > this patch implements a optimization rewriting > > x * copysign (1.0, y) and > x * copysign (-1.0, y) > > to: > > x ^ (y &a

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-07-09 Thread Andrew Pinski
On Mon, Jun 12, 2017 at 12:56 AM, Tamar Christina wrote: > Hi All, > > this patch implements a optimization rewriting > > x * copysign (1.0, y) and > x * copysign (-1.0, y) > > to: > > x ^ (y & (1 << sign_bit_position)) > > This is done by creating a special builtin during matching and generate th

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-26 Thread Tamar Christina
guent...@suse.de Subject: Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)] On Sat, Jun 24, 2017 at 4:53 PM, Andrew Pinski wrote: > On Mon, Jun 12, 2017 at 12:56 AM, Tamar Christina > wrote: >> Hi All, >> >> this patch implements a optimization rewriti

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-26 Thread Richard Biener
On Sat, 24 Jun 2017, Andrew Pinski wrote: > On Mon, Jun 12, 2017 at 12:56 AM, Tamar Christina > wrote: > > Hi All, > > > > this patch implements a optimization rewriting > > > > x * copysign (1.0, y) and > > x * copysign (-1.0, y) > > > This reminds me: > copysign(-1.0, y) can be just optimized

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-25 Thread Andrew Pinski
On Sat, Jun 24, 2017 at 4:53 PM, Andrew Pinski wrote: > On Mon, Jun 12, 2017 at 12:56 AM, Tamar Christina > wrote: >> Hi All, >> >> this patch implements a optimization rewriting >> >> x * copysign (1.0, y) and >> x * copysign (-1.0, y) > > > This reminds me: > copysign(-1.0, y) can be just optim

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-24 Thread Andrew Pinski
On Mon, Jun 12, 2017 at 12:56 AM, Tamar Christina wrote: > Hi All, > > this patch implements a optimization rewriting > > x * copysign (1.0, y) and > x * copysign (-1.0, y) This reminds me: copysign(-1.0, y) can be just optimized to: copysign(1.0, y) I did that in my patch here: https://gcc.gnu

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-13 Thread Tamar Christina
Hi Richard, > > First, nowadays please add an internal function instead of builtins. > > You can even take advantage of Richards work to directly tie those to > > optabs (he might want to chime in to tell you how). You don't need > > the fortran FE changes in that case. > > Yeah, it should just

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-13 Thread Tamar Christina
Hi Richard, Thanks for the feedback, I'll update the patch accordingly. > What does > > > (copysigns @0 (negate @1)): Likewise. > > do? > Sorry this slipped through my clean-up. The patch doesn't actually contain this definition anymore. > Third, new IL that is present throughout the

RE: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-13 Thread Tamar Christina
> > Please only enable this if you have XORSIGN and XORSIGNF. > > On the PowerPC this would involve moving the value from the > vector/floating point registers to the general purpose registers to do the XOR > operation and then back to the vector/floating point registers. > Fair enough, I thi

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-12 Thread Michael Meissner
On Mon, Jun 12, 2017 at 07:56:54AM +, Tamar Christina wrote: > Hi All, > > this patch implements a optimization rewriting > > x * copysign (1.0, y) and > x * copysign (-1.0, y) > > to: > > x ^ (y & (1 << sign_bit_position)) > > This is done by creating a special builtin during matching a

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-12 Thread Joseph Myers
On Mon, 12 Jun 2017, Tamar Christina wrote: > x * copysign (1.0, y) and > x * copysign (-1.0, y) > > to: > > x ^ (y & (1 << sign_bit_position)) Note that this needs to be disabled for -fsignaling-nans, as if x is a signaling NaN, the multiplication converts it to a quiet NaN and raises "inv

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-12 Thread Richard Sandiford
Richard Biener writes: > On Mon, 12 Jun 2017, Tamar Christina wrote: >> Hi All, >> >> this patch implements a optimization rewriting >> >> x * copysign (1.0, y) and >> x * copysign (-1.0, y) >> >> to: >> >> x ^ (y & (1 << sign_bit_position)) >> >> This is done by creating a special builtin

Re: [GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-12 Thread Richard Biener
On Mon, 12 Jun 2017, Tamar Christina wrote: > Hi All, > > this patch implements a optimization rewriting > > x * copysign (1.0, y) and > x * copysign (-1.0, y) > > to: > > x ^ (y & (1 << sign_bit_position)) > > This is done by creating a special builtin during matching and generate the > ap

[GCC][PATCH][mid-end] Optimize x * copysign (1.0, y) [Patch (1/2)]

2017-06-12 Thread Tamar Christina
Hi All, this patch implements a optimization rewriting x * copysign (1.0, y) and x * copysign (-1.0, y) to: x ^ (y & (1 << sign_bit_position)) This is done by creating a special builtin during matching and generate the appropriate instructions during expand. This new builtin is called XORSIG