Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-22 Thread Kenneth Zadeck
On 04/22/2013 08:20 AM, Richard Biener wrote: That said, a lot of my pushback is because I feel a little lonesome in this wide-int review and don't want to lone-some decide about that (generic) interface part as well. yeh, now sandiford is back from vacation so there are two of us to beat on

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-22 Thread Richard Sandiford
Richard Biener writes: > Richard Sandiford wrote: >>Richard Biener writes: At the rtl level your idea does not work. rtl constants do not >>have a mode or type. >>> >>> Which is not true and does not matter. I tell you why. Quote: >> >>It _is_ true, as long as you read "rtl constan

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-22 Thread Richard Biener
Richard Sandiford wrote: >Richard Biener writes: >>> At the rtl level your idea does not work. rtl constants do not >have a mode >>> or type. >> >> Which is not true and does not matter. I tell you why. Quote: > >It _is_ true, as long as you read "rtl constants" as "rtl integer >constants" :

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-22 Thread Richard Sandiford
Richard Biener writes: >> At the rtl level your idea does not work. rtl constants do not have a mode >> or type. > > Which is not true and does not matter. I tell you why. Quote: It _is_ true, as long as you read "rtl constants" as "rtl integer constants" :-) > +#if TARGET_SUPPORTS_WIDE_INT

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-22 Thread Kenneth Zadeck
On 04/19/2013 09:31 AM, Richard Biener wrote: + number of elements of the vector that are in use. When LEN * + HOST_BITS_PER_WIDE_INT < the precision, the value has been + compressed. The values of the elements of the vector greater than + LEN - 1. are all equal to the highest order bit

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-22 Thread Richard Biener
On Sun, Apr 21, 2013 at 10:54 PM, Kenneth Zadeck wrote: > Richard, > > i pulled these two frags out of your comments because i wanted to get some > input from you on it while i addressed the other issues you raised. > > >> + enum SignOp { >> +/* Many of the math functions produce different re

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-21 Thread Kenneth Zadeck
Richard, i pulled these two frags out of your comments because i wanted to get some input from you on it while i addressed the other issues you raised. + enum SignOp { +/* Many of the math functions produce different results depending + on if they are SIGNED or UNSIGNED. In genera

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-19 Thread Richard Biener
On Tue, Apr 16, 2013 at 10:07 PM, Kenneth Zadeck wrote: > Richard, > > I made major changes to wide-int along the lines you suggested. Each of the > binary operations is now a template. > There are 5 possible implementations of those operations, one for each of > HWI, unsigned HWI, wide-int, rtl,

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-08 Thread Richard Biener
On Fri, Apr 5, 2013 at 2:34 PM, Kenneth Zadeck wrote: > Richard, > > There has been something that has bothered me about you proposal for the > storage manager and i think i can now characterize that problem. Say i want > to compute the expression > > (a + b) / c > > converting from tree values,

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-05 Thread Kenneth Zadeck
Richard, There has been something that has bothered me about you proposal for the storage manager and i think i can now characterize that problem. Say i want to compute the expression (a + b) / c converting from tree values, using wide-int as the engine and then storing the result in a tre

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-04 Thread Richard Biener
On Wed, Apr 3, 2013 at 6:16 PM, Kenneth Zadeck wrote: > On 04/03/2013 09:53 AM, Richard Biener wrote: >> >> On Wed, Apr 3, 2013 at 2:05 PM, Kenneth Zadeck >> wrote: >>> >>> On 04/03/2013 05:17 AM, Richard Biener wrote: >>> In the end you will have a variable-size storage in TREE_INT_CST thus

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-03 Thread Kenneth Zadeck
On 04/03/2013 09:53 AM, Richard Biener wrote: On Wed, Apr 3, 2013 at 2:05 PM, Kenneth Zadeck wrote: On 04/03/2013 05:17 AM, Richard Biener wrote: In the end you will have a variable-size storage in TREE_INT_CST thus you will have at least to emit _code_ copying over meta-data and data from th

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-03 Thread Richard Biener
On Wed, Apr 3, 2013 at 2:05 PM, Kenneth Zadeck wrote: > > On 04/03/2013 05:17 AM, Richard Biener wrote: > >> In the end you will have a variable-size storage in TREE_INT_CST thus >> you will have at least to emit _code_ copying over meta-data and data >> from the tree representation to the wide-in

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-03 Thread Kenneth Zadeck
On 04/03/2013 05:17 AM, Richard Biener wrote: In the end you will have a variable-size storage in TREE_INT_CST thus you will have at least to emit _code_ copying over meta-data and data from the tree representation to the wide-int (similar for RTX CONST_DOUBLE/INT). I'm objecting to the amount

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-03 Thread Richard Biener
On Tue, Apr 2, 2013 at 7:35 PM, Kenneth Zadeck wrote: > Yes, I agree that you win the challenge that it can be done.What you > have always failed to address is why anyone would want to do this. Or how > this would at all be desirable.But I completely agree that from a purely > abstract po

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-02 Thread Kenneth Zadeck
Yes, I agree that you win the challenge that it can be done.What you have always failed to address is why anyone would want to do this. Or how this would at all be desirable.But I completely agree that from a purely abstract point of view you can add a storage model. Now here is why w

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-04-02 Thread Richard Biener
On Wed, Feb 27, 2013 at 2:59 AM, Kenneth Zadeck wrote: > This patch contains a large number of the changes requested by Richi. It > does not contain any of the changes that he requested to abstract the > storage layer. That suggestion appears to be quite unworkable. I of course took this clai

Re: patch to fix constant math - 4th patch - the wide-int class - patch ping for the next stage 1

2013-03-27 Thread Richard Biener
On Wed, Feb 27, 2013 at 2:59 AM, Kenneth Zadeck wrote: > This patch contains a large number of the changes requested by Richi. It > does not contain any of the changes that he requested to abstract the > storage layer. That suggestion appears to be quite unworkable. > > I believe that the wide

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Mike Stump
On Oct 31, 2012, at 7:05 AM, Richard Biener wrote: > You have an artificial limit on what 'len' can be. No. There is no limit, and nothing artificial. We take the maximum of the needs of the target, the maximum of the front-ends and the maximum of the mid-end and the back-end. We can drop a

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Mike Stump
On Oct 31, 2012, at 6:54 AM, Richard Biener wrote: > I propose that no wide-int member function > may _change_ it's len (to something larger). We never do that, so, we already do as you wish. We construct wide ints, and we have member functions to construct values. We need to construct values

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Mike Stump
On Oct 31, 2012, at 5:44 AM, Richard Biener wrote: > the > fact that len ends up being mutable is another thing I dislike about > wide-int. We expose len for construction only, it is non-mutating. During construction, there is no previous value. > If wide-ints are cheap then all ops should be

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Kenneth Zadeck
On 10/31/2012 09:30 AM, Richard Sandiford wrote: Richard Biener writes: But that means that wide_int has to model a P-bit operation as a "normal" len*HOST_WIDE_INT operation and then fix up the result after the fact, which seems unnecessarily convoluted. It does that right now. The operation

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Kenneth Zadeck
On 10/31/2012 08:44 AM, Richard Biener wrote: On Wed, Oct 31, 2012 at 1:22 PM, Richard Sandiford wrote: Richard Biener writes: On Wed, Oct 31, 2012 at 1:05 PM, Richard Sandiford wrote: Richard Biener writes: On Wed, Oct 31, 2012 at 11:43 AM, Richard Sandiford wrote: Richard Biener wri

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Kenneth Zadeck
On 10/31/2012 10:24 AM, Richard Biener wrote: On Wed, Oct 31, 2012 at 3:18 PM, Kenneth Zadeck wrote: On 10/31/2012 10:05 AM, Richard Biener wrote: On Wed, Oct 31, 2012 at 2:54 PM, Kenneth Zadeck wrote: On 10/31/2012 08:11 AM, Richard Biener wrote: On Wed, Oct 31, 2012 at 1:05 PM, Richard S

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Kenneth Zadeck
On 10/31/2012 09:54 AM, Richard Biener wrote: On Wed, Oct 31, 2012 at 2:30 PM, Richard Sandiford wrote: Richard Biener writes: But that means that wide_int has to model a P-bit operation as a "normal" len*HOST_WIDE_INT operation and then fix up the result after the fact, which seems unnecess

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Richard Biener
On Wed, Oct 31, 2012 at 3:18 PM, Kenneth Zadeck wrote: > > On 10/31/2012 10:05 AM, Richard Biener wrote: >> >> On Wed, Oct 31, 2012 at 2:54 PM, Kenneth Zadeck >> wrote: >>> >>> On 10/31/2012 08:11 AM, Richard Biener wrote: On Wed, Oct 31, 2012 at 1:05 PM, Richard Sandiford wrote:

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Kenneth Zadeck
On 10/31/2012 10:05 AM, Richard Biener wrote: On Wed, Oct 31, 2012 at 2:54 PM, Kenneth Zadeck wrote: On 10/31/2012 08:11 AM, Richard Biener wrote: On Wed, Oct 31, 2012 at 1:05 PM, Richard Sandiford wrote: Richard Biener writes: On Wed, Oct 31, 2012 at 11:43 AM, Richard Sandiford wrote:

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Richard Biener
On Wed, Oct 31, 2012 at 2:54 PM, Kenneth Zadeck wrote: > > On 10/31/2012 08:11 AM, Richard Biener wrote: >> >> On Wed, Oct 31, 2012 at 1:05 PM, Richard Sandiford >> wrote: >>> >>> Richard Biener writes: On Wed, Oct 31, 2012 at 11:43 AM, Richard Sandiford wrote: > > Richar

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Richard Biener
On Wed, Oct 31, 2012 at 2:30 PM, Richard Sandiford wrote: > Richard Biener writes: >>> But that means that wide_int has to model a P-bit operation as a >>> "normal" len*HOST_WIDE_INT operation and then fix up the result >>> after the fact, which seems unnecessarily convoluted. >> >> It does that

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Kenneth Zadeck
On 10/31/2012 08:11 AM, Richard Biener wrote: On Wed, Oct 31, 2012 at 1:05 PM, Richard Sandiford wrote: Richard Biener writes: On Wed, Oct 31, 2012 at 11:43 AM, Richard Sandiford wrote: Richard Biener writes: On Thu, Oct 25, 2012 at 12:55 PM, Kenneth Zadeck wrote: On 10/25/2012 06:42 A

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Richard Sandiford
Richard Biener writes: >> But that means that wide_int has to model a P-bit operation as a >> "normal" len*HOST_WIDE_INT operation and then fix up the result >> after the fact, which seems unnecessarily convoluted. > > It does that right now. The operations are carried out in a loop > over len HO

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Richard Biener
On Wed, Oct 31, 2012 at 1:22 PM, Richard Sandiford wrote: > Richard Biener writes: >> On Wed, Oct 31, 2012 at 1:05 PM, Richard Sandiford >> wrote: >>> Richard Biener writes: On Wed, Oct 31, 2012 at 11:43 AM, Richard Sandiford wrote: > Richard Biener writes: >> On Thu, Oct 25

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Richard Sandiford
Richard Biener writes: > On Wed, Oct 31, 2012 at 1:05 PM, Richard Sandiford > wrote: >> Richard Biener writes: >>> On Wed, Oct 31, 2012 at 11:43 AM, Richard Sandiford >>> wrote: Richard Biener writes: > On Thu, Oct 25, 2012 at 12:55 PM, Kenneth Zadeck > wrote: >> >> On 10

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Richard Biener
On Wed, Oct 31, 2012 at 1:05 PM, Richard Sandiford wrote: > Richard Biener writes: >> On Wed, Oct 31, 2012 at 11:43 AM, Richard Sandiford >> wrote: >>> Richard Biener writes: On Thu, Oct 25, 2012 at 12:55 PM, Kenneth Zadeck wrote: > > On 10/25/2012 06:42 AM, Richard Biener wr

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Richard Sandiford
Richard Biener writes: > On Wed, Oct 31, 2012 at 11:43 AM, Richard Sandiford > wrote: >> Richard Biener writes: >>> On Thu, Oct 25, 2012 at 12:55 PM, Kenneth Zadeck >>> wrote: On 10/25/2012 06:42 AM, Richard Biener wrote: > > On Wed, Oct 24, 2012 at 7:23 PM, Mike Stump wrote:

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Richard Biener
On Wed, Oct 31, 2012 at 11:43 AM, Richard Sandiford wrote: > Richard Biener writes: >> On Thu, Oct 25, 2012 at 12:55 PM, Kenneth Zadeck >> wrote: >>> >>> On 10/25/2012 06:42 AM, Richard Biener wrote: On Wed, Oct 24, 2012 at 7:23 PM, Mike Stump wrote: > > On Oct 24, 2012, at 2:

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-31 Thread Richard Sandiford
Richard Biener writes: > On Thu, Oct 25, 2012 at 12:55 PM, Kenneth Zadeck > wrote: >> >> On 10/25/2012 06:42 AM, Richard Biener wrote: >>> >>> On Wed, Oct 24, 2012 at 7:23 PM, Mike Stump wrote: On Oct 24, 2012, at 2:43 AM, Richard Biener wrote: > > On Tue, Oct 23, 2012 at

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-25 Thread Richard Biener
On Thu, Oct 25, 2012 at 12:55 PM, Kenneth Zadeck wrote: > > On 10/25/2012 06:42 AM, Richard Biener wrote: >> >> On Wed, Oct 24, 2012 at 7:23 PM, Mike Stump wrote: >>> >>> On Oct 24, 2012, at 2:43 AM, Richard Biener >>> wrote: On Tue, Oct 23, 2012 at 6:12 PM, Kenneth Zadeck wrote:

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-25 Thread Kenneth Zadeck
On 10/25/2012 06:42 AM, Richard Biener wrote: On Wed, Oct 24, 2012 at 7:23 PM, Mike Stump wrote: On Oct 24, 2012, at 2:43 AM, Richard Biener wrote: On Tue, Oct 23, 2012 at 6:12 PM, Kenneth Zadeck wrote: On 10/23/2012 10:12 AM, Richard Biener wrote: + HOST_WIDE_INT val[2 * MAX_BITSIZE_MOD

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-25 Thread Richard Biener
On Wed, Oct 24, 2012 at 7:23 PM, Mike Stump wrote: > On Oct 24, 2012, at 2:43 AM, Richard Biener > wrote: >> On Tue, Oct 23, 2012 at 6:12 PM, Kenneth Zadeck >> wrote: >>> >>> On 10/23/2012 10:12 AM, Richard Biener wrote: + HOST_WIDE_INT val[2 * MAX_BITSIZE_MODE_ANY_INT / HOST_BI

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-24 Thread Mike Stump
On Oct 24, 2012, at 2:43 AM, Richard Biener wrote: > On Tue, Oct 23, 2012 at 6:12 PM, Kenneth Zadeck > wrote: >> >> On 10/23/2012 10:12 AM, Richard Biener wrote: >>> >>> + HOST_WIDE_INT val[2 * MAX_BITSIZE_MODE_ANY_INT / >>> HOST_BITS_PER_WIDE_INT]; >>> >>> are we sure this rounds properly?

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-24 Thread Richard Biener
On Tue, Oct 23, 2012 at 6:12 PM, Kenneth Zadeck wrote: > > On 10/23/2012 10:12 AM, Richard Biener wrote: >> >> On Tue, Oct 9, 2012 at 5:09 PM, Kenneth Zadeck >> wrote: >>> >>> This patch implements the wide-int class.this is a more general >>> version >>> of the double-int class and is meant

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-23 Thread Kenneth Zadeck
On 10/23/2012 04:25 PM, Lawrence Crowl wrote: On 10/23/12, Kenneth Zadeck wrote: On 10/23/2012 02:38 PM, Lawrence Crowl wrote: On 10/23/12, Kenneth Zadeck wrote: On 10/23/2012 10:12 AM, Richard Biener wrote: + inline bool minus_one_p () const; + inline bool zero_p () const; + inline boo

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-23 Thread Lawrence Crowl
On 10/23/12, Kenneth Zadeck wrote: > On 10/23/2012 02:38 PM, Lawrence Crowl wrote: >> On 10/23/12, Kenneth Zadeck wrote: >>> On 10/23/2012 10:12 AM, Richard Biener wrote: + inline bool minus_one_p () const; + inline bool zero_p () const; + inline bool one_p () const; + inl

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-23 Thread Kenneth Zadeck
On 10/23/2012 02:38 PM, Lawrence Crowl wrote: On 10/23/12, Kenneth Zadeck wrote: On 10/23/2012 10:12 AM, Richard Biener wrote: + inline bool minus_one_p () const; + inline bool zero_p () const; + inline bool one_p () const; + inline bool neg_p () const; what's wrong with w == -1, w == 0,

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-23 Thread Lawrence Crowl
On 10/23/12, Kenneth Zadeck wrote: > On 10/23/2012 10:12 AM, Richard Biener wrote: > > + inline bool minus_one_p () const; > > + inline bool zero_p () const; > > + inline bool one_p () const; > > + inline bool neg_p () const; > > > > what's wrong with w == -1, w == 0, w == 1, etc.? > > I would

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-23 Thread Lawrence Crowl
On 10/23/12, Richard Biener wrote: > I wonder if for the various ways to specify precision/len there > is a nice C++ way of moving this detail out of wide-int. I can > think only of one: > > struct WIntSpec { > WIntSpec (unsigned int len, unsigned int precision); > WIntSpec (const_tree); >

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-23 Thread Kenneth Zadeck
On 10/23/2012 10:12 AM, Richard Biener wrote: On Tue, Oct 9, 2012 at 5:09 PM, Kenneth Zadeck wrote: This patch implements the wide-int class.this is a more general version of the double-int class and is meant to be the eventual replacement for that class.The use of this class removes a

Re: patch to fix constant math - 4th patch - the wide-int class.

2012-10-23 Thread Richard Biener
On Tue, Oct 9, 2012 at 5:09 PM, Kenneth Zadeck wrote: > This patch implements the wide-int class.this is a more general version > of the double-int class and is meant to be the eventual replacement for that > class.The use of this class removes all dependencies of the host from > the targe