Re: RFC [1/3] divmod transform v2

2017-01-02 Thread Prathamesh Kulkarni
On 2 January 2017 at 20:37, Martin Liška wrote: > On 10/16/2016 07:59 AM, Prathamesh Kulkarni wrote: >> + /* Disable the transform if either is a constant, since >> division-by-constant >> + may have specialized expansion. */ >> + if (CONSTANT_CLASS_P (op1) ||

Re: RFC [1/3] divmod transform v2

2017-01-02 Thread Martin Liška
On 10/16/2016 07:59 AM, Prathamesh Kulkarni wrote: > + /* Disable the transform if either is a constant, since > division-by-constant > + may have specialized expansion. */ > + if (CONSTANT_CLASS_P (op1) || CONSTANT_CLASS_P (op2)) > +return false; Hello. I've just played a bit with

Re: RFC [1/3] divmod transform v2

2016-10-28 Thread Prathamesh Kulkarni
On 26 October 2016 at 16:17, Richard Biener wrote: > On Wed, 26 Oct 2016, Prathamesh Kulkarni wrote: > >> On 25 October 2016 at 18:47, Richard Biener wrote: >> > On Tue, 25 Oct 2016, Prathamesh Kulkarni wrote: >> > >> >> On 25 October 2016 at 16:17, Richard

Re: RFC [1/3] divmod transform v2

2016-10-26 Thread Richard Biener
On Wed, 26 Oct 2016, Prathamesh Kulkarni wrote: > On 25 October 2016 at 18:47, Richard Biener wrote: > > On Tue, 25 Oct 2016, Prathamesh Kulkarni wrote: > > > >> On 25 October 2016 at 16:17, Richard Biener wrote: > >> > On Tue, 25 Oct 2016, Prathamesh

Re: RFC [1/3] divmod transform v2

2016-10-26 Thread Prathamesh Kulkarni
On 25 October 2016 at 18:47, Richard Biener wrote: > On Tue, 25 Oct 2016, Prathamesh Kulkarni wrote: > >> On 25 October 2016 at 16:17, Richard Biener wrote: >> > On Tue, 25 Oct 2016, Prathamesh Kulkarni wrote: >> > >> >> On 25 October 2016 at 13:43, Richard

Re: RFC [1/3] divmod transform v2

2016-10-25 Thread Richard Biener
On Tue, 25 Oct 2016, Prathamesh Kulkarni wrote: > On 25 October 2016 at 16:17, Richard Biener wrote: > > On Tue, 25 Oct 2016, Prathamesh Kulkarni wrote: > > > >> On 25 October 2016 at 13:43, Richard Biener > >> wrote: > >> > On Sun, Oct 16, 2016

Re: RFC [1/3] divmod transform v2

2016-10-25 Thread Prathamesh Kulkarni
On 25 October 2016 at 16:17, Richard Biener wrote: > On Tue, 25 Oct 2016, Prathamesh Kulkarni wrote: > >> On 25 October 2016 at 13:43, Richard Biener >> wrote: >> > On Sun, Oct 16, 2016 at 7:59 AM, Prathamesh Kulkarni >> >

Re: RFC [1/3] divmod transform v2

2016-10-25 Thread Richard Biener
On Tue, 25 Oct 2016, Prathamesh Kulkarni wrote: > On 25 October 2016 at 13:43, Richard Biener > wrote: > > On Sun, Oct 16, 2016 at 7:59 AM, Prathamesh Kulkarni > > wrote: > >> Hi, > >> After approval from Bernd Schmidt, I committed

Re: RFC [1/3] divmod transform v2

2016-10-25 Thread Prathamesh Kulkarni
On 25 October 2016 at 13:43, Richard Biener wrote: > On Sun, Oct 16, 2016 at 7:59 AM, Prathamesh Kulkarni > wrote: >> Hi, >> After approval from Bernd Schmidt, I committed the patch to remove >> optab functions for >> sdivmod_optab and

Re: RFC [1/3] divmod transform v2

2016-10-25 Thread Richard Biener
On Sun, Oct 16, 2016 at 7:59 AM, Prathamesh Kulkarni wrote: > Hi, > After approval from Bernd Schmidt, I committed the patch to remove > optab functions for > sdivmod_optab and udivmod_optab in optabs.def, which removes the block > for divmod patch. > > This patch

Re: RFC [1/3] divmod transform v2

2016-10-24 Thread Jeff Law
On 10/24/2016 09:35 AM, Prathamesh Kulkarni wrote: On 24 October 2016 at 20:23, Jeff Law wrote: On 10/24/2016 01:28 AM, Richard Biener wrote: [ big snip ] + + /* Update all statements in stmts. + if stmt is lhs = op1 TRUNC_DIV_EXPR op2, change to lhs = REALPART_EXPR

Re: RFC [1/3] divmod transform v2

2016-10-24 Thread Prathamesh Kulkarni
On 24 October 2016 at 20:23, Jeff Law wrote: > On 10/24/2016 01:28 AM, Richard Biener wrote: > [ big snip ] > > >> >>> + >>> + /* Update all statements in stmts. >>> + if stmt is lhs = op1 TRUNC_DIV_EXPR op2, change to lhs = >>> REALPART_EXPR >>> +

Re: RFC [1/3] divmod transform v2

2016-10-24 Thread Jeff Law
On 10/24/2016 01:28 AM, Richard Biener wrote: [ big snip ] + + /* Update all statements in stmts. + if stmt is lhs = op1 TRUNC_DIV_EXPR op2, change to lhs = REALPART_EXPR + if stmt is lhs = op1 TRUNC_MOD_EXPR op2, change to lhs = IMAGPART_EXPR. */ I'd just emit a copy from RES to

Re: RFC [1/3] divmod transform v2

2016-10-24 Thread Richard Biener
On Fri, 21 Oct 2016, Jeff Law wrote: > On 10/21/2016 04:34 AM, Prathamesh Kulkarni wrote: > > On 20 October 2016 at 15:02, Richard Biener wrote: > > > On Wed, 19 Oct 2016, Jeff Law wrote: > > > > > > > On 10/15/2016 11:59 PM, Prathamesh Kulkarni wrote: > > > > > Hi, > > > > >

Re: RFC [1/3] divmod transform v2

2016-10-21 Thread Jeff Law
On 10/21/2016 04:34 AM, Prathamesh Kulkarni wrote: On 20 October 2016 at 15:02, Richard Biener wrote: On Wed, 19 Oct 2016, Jeff Law wrote: On 10/15/2016 11:59 PM, Prathamesh Kulkarni wrote: Hi, After approval from Bernd Schmidt, I committed the patch to remove optab

Re: RFC [1/3] divmod transform v2

2016-10-21 Thread Jeff Law
On 10/20/2016 03:32 AM, Richard Biener wrote: Starting with some high level design comments. If these conflict with comments from others, let me know and we'll work through the issues. I don't really like introducing code conditional on the target capabilities this early in the gimple

Re: RFC [1/3] divmod transform v2

2016-10-21 Thread Prathamesh Kulkarni
On 20 October 2016 at 15:02, Richard Biener wrote: > On Wed, 19 Oct 2016, Jeff Law wrote: > >> On 10/15/2016 11:59 PM, Prathamesh Kulkarni wrote: >> > Hi, >> > After approval from Bernd Schmidt, I committed the patch to remove >> > optab functions for >> > sdivmod_optab and

Re: RFC [1/3] divmod transform v2

2016-10-20 Thread Richard Biener
On Wed, 19 Oct 2016, Jeff Law wrote: > On 10/15/2016 11:59 PM, Prathamesh Kulkarni wrote: > > Hi, > > After approval from Bernd Schmidt, I committed the patch to remove > > optab functions for > > sdivmod_optab and udivmod_optab in optabs.def, which removes the block > > for divmod patch. > > >

Re: RFC [1/3] divmod transform v2

2016-10-19 Thread Jeff Law
On 10/15/2016 11:59 PM, Prathamesh Kulkarni wrote: Hi, After approval from Bernd Schmidt, I committed the patch to remove optab functions for sdivmod_optab and udivmod_optab in optabs.def, which removes the block for divmod patch. This patch is mostly the same as previous one, except it drops

Re: RFC [1/3] divmod transform v2

2016-10-18 Thread Prathamesh Kulkarni
On 19 October 2016 at 03:03, Jeff Law wrote: > On 10/17/2016 11:23 PM, Prathamesh Kulkarni wrote: >> >> The divmod transform isn't enabled if target supports hardware div in >> the same or wider mode even if divmod libfunc is available for the >> given mode. > > Good. That seems

Re: RFC [1/3] divmod transform v2

2016-10-18 Thread Jeff Law
On 10/17/2016 11:23 PM, Prathamesh Kulkarni wrote: The divmod transform isn't enabled if target supports hardware div in the same or wider mode even if divmod libfunc is available for the given mode. Good. That seems like the right thing to do. Thanks. I had erroneously assumed

Re: RFC [1/3] divmod transform v2

2016-10-18 Thread Jeff Law
On 10/18/2016 02:25 AM, Richard Biener wrote: I don't even think we have a way of knowing in the compiler if the target has enabled divmod support in libgcc. Yeah, that's what bothers me with the current optab libfunc query setup -- it isn't reliable. I wonder if we ought to just have them

Re: RFC [1/3] divmod transform v2

2016-10-18 Thread Prathamesh Kulkarni
On 18 October 2016 at 13:55, Richard Biener wrote: > On Tue, 18 Oct 2016, Prathamesh Kulkarni wrote: > >> On 18 October 2016 at 02:46, Jeff Law wrote: >> > On 10/15/2016 11:59 PM, Prathamesh Kulkarni wrote: >> >> >> >> This patch is mostly the same as previous

Re: RFC [1/3] divmod transform v2

2016-10-18 Thread Richard Biener
On Tue, 18 Oct 2016, Prathamesh Kulkarni wrote: > On 18 October 2016 at 02:46, Jeff Law wrote: > > On 10/15/2016 11:59 PM, Prathamesh Kulkarni wrote: > >> > >> This patch is mostly the same as previous one, except it drops > >> targeting __udivmoddi4() because it gave undefined

Re: RFC [1/3] divmod transform v2

2016-10-17 Thread Prathamesh Kulkarni
On 18 October 2016 at 02:46, Jeff Law wrote: > On 10/15/2016 11:59 PM, Prathamesh Kulkarni wrote: >> >> This patch is mostly the same as previous one, except it drops >> targeting __udivmoddi4() because it gave undefined reference link >> error for calling __udivmoddi4() on

Re: RFC [1/3] divmod transform v2

2016-10-17 Thread Jeff Law
On 10/15/2016 11:59 PM, Prathamesh Kulkarni wrote: This patch is mostly the same as previous one, except it drops targeting __udivmoddi4() because it gave undefined reference link error for calling __udivmoddi4() on aarch64-linux-gnu. It appears aarch64 has hardware insn for DImode div, so

Re: RFC [1/3] divmod transform v2

2016-10-16 Thread Prathamesh Kulkarni
On 16 October 2016 at 11:29, Prathamesh Kulkarni wrote: > Hi, > After approval from Bernd Schmidt, I committed the patch to remove > optab functions for > sdivmod_optab and udivmod_optab in optabs.def, which removes the block > for divmod patch. > > This patch is