Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Biener
On Wed, Apr 24, 2013 at 5:29 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 4:35 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 04/24/2013 09:36 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 2:44

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Biener
On Wed, Apr 24, 2013 at 5:55 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 5:00 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Biener
On Thu, Apr 25, 2013 at 1:18 AM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 04/24/2013 11:13 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 5:00 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Bienerrichard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 4:29

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Kenneth Zadeck
On 05/03/2013 07:34 AM, Richard Biener wrote: On Thu, Apr 25, 2013 at 1:18 AM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 04/24/2013 11:13 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 5:00 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Biener
On Fri, May 3, 2013 at 1:49 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 05/03/2013 07:34 AM, Richard Biener wrote: On Thu, Apr 25, 2013 at 1:18 AM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 04/24/2013 11:13 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 5:00 PM,

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Kenneth Zadeck
On 05/03/2013 08:12 AM, Richard Biener wrote: On Fri, May 3, 2013 at 1:49 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 05/03/2013 07:34 AM, Richard Biener wrote: On Thu, Apr 25, 2013 at 1:18 AM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 04/24/2013 11:13 AM, Richard Biener

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Sandiford
Richard Biener richard.guent...@gmail.com writes: See e.g. the hoops that cselib has to jump through: /* We need to pass down the mode of constants through the hash table functions. For that purpose, wrap them in a CONST of the appropriate mode. */ static rtx wrap_constant (enum

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Biener
On Fri, May 3, 2013 at 2:31 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 05/03/2013 08:12 AM, Richard Biener wrote: On Fri, May 3, 2013 at 1:49 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 05/03/2013 07:34 AM, Richard Biener wrote: On Thu, Apr 25, 2013 at 1:18 AM, Kenneth

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Kenneth Zadeck
On 05/03/2013 07:19 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 5:29 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 4:35 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 04/24/2013 09:36 AM, Richard

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Sandiford
Kenneth Zadeck zad...@naturalbridge.com writes: There are several problems with just dropping a mode into the already existing mode field of an rtx constant. 1) There may be places where the a back end is testing equality to see if constants of different modes are in fact the same value. 2)

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Biener
On Fri, May 3, 2013 at 2:37 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: See e.g. the hoops that cselib has to jump through: /* We need to pass down the mode of constants through the hash table functions. For that purpose, wrap

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Biener
On Fri, May 3, 2013 at 2:45 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 05/03/2013 07:19 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 5:29 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 4:35

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Biener
On Fri, May 3, 2013 at 2:48 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Kenneth Zadeck zad...@naturalbridge.com writes: There are several problems with just dropping a mode into the already existing mode field of an rtx constant. 1) There may be places where the a back end is

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Sandiford
Richard Biener richard.guent...@gmail.com writes: 5) All const_ints in the .md files would need to be given a mode (except for those places where const_int actually represents a C++ constant, such as in attributes). I realise your list wasn't supposed to be exhaustive, and neither's

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Richard Sandiford
Richard Biener richard.guent...@gmail.com writes: But storing the mode in the rtx is orthogonal to what Kenny is doing. The mode of each rtx constant is already available in the places that Kenny is changing, because we already do the work to keep track of the mode separately. Being able to

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Kenneth Zadeck
On 05/03/2013 08:40 AM, Richard Biener wrote: On Fri, May 3, 2013 at 2:31 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 05/03/2013 08:12 AM, Richard Biener wrote: On Fri, May 3, 2013 at 1:49 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 05/03/2013 07:34 AM, Richard Biener

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Kenneth Zadeck
On 05/03/2013 08:53 AM, Richard Biener wrote: On Fri, May 3, 2013 at 2:37 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: See e.g. the hoops that cselib has to jump through: /* We need to pass down the mode of constants through the

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Kenneth Zadeck
On 05/03/2013 09:02 AM, Richard Biener wrote: On Fri, May 3, 2013 at 2:45 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 05/03/2013 07:19 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 5:29 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener

Re: patch to fix constant math -5th patch, rtl

2013-05-03 Thread Kenneth Zadeck
Richi, I also think that it is a digression to have this discussion about rtl.The root problem is really that Mike, Richard, and myself do not believe that infinite precision math is the proper way to do math for the majority of the compiler. Most of the compiler, at both the rtl and

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Sandiford
Richard Biener richard.guent...@gmail.com writes: I suppose the above should use immed_double_int_const (v, mode), too, In practice it doesn't matter, because... which oddly only ever truncates to mode for modes = HOST_BITS_PER_WIDE_INT via gen_int_mode. ...right. That's because there's not

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Kenneth Zadeck
On 04/24/2013 09:36 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 2:44 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: Can we in such cases please to a preparatory patch and change the CONST_INT/CONST_DOUBLE paths to do an explicit

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Biener
On Wed, Apr 24, 2013 at 4:29 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: I suppose the above should use immed_double_int_const (v, mode), too, In practice it doesn't matter, because... which oddly only ever truncates to mode for

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Kenneth Zadeck
On 04/24/2013 10:42 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 4:29 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: I suppose the above should use immed_double_int_const (v, mode), too, In practice it doesn't matter, because...

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Sandiford
Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 4:29 PM, Richard Sandiford rdsandif...@googlemail.com wrote: In other words, one of the reasons wide_int can't be exactly 1:1 in practice is because it is clearing out these mistakes (GEN_INT rather than gen_int_mode)

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Biener
On Wed, Apr 24, 2013 at 4:35 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 04/24/2013 09:36 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 2:44 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: Can we in such cases please

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Biener
On Wed, Apr 24, 2013 at 5:00 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 4:29 PM, Richard Sandiford rdsandif...@googlemail.com wrote: In other words, one of the reasons wide_int can't be exactly 1:1 in

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Sandiford
Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 4:35 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: On 04/24/2013 09:36 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 2:44 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Sandiford
Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 5:00 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 4:29 PM, Richard Sandiford rdsandif...@googlemail.com wrote: In other words, one of

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Kenneth Zadeck
On 04/24/2013 11:13 AM, Richard Biener wrote: On Wed, Apr 24, 2013 at 5:00 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Bienerrichard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 4:29 PM, Richard Sandiford rdsandif...@googlemail.com wrote: In other words, one of

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Biener
On Tue, Apr 16, 2013 at 10:17 PM, Kenneth Zadeck zad...@naturalbridge.com wrote: Here is a refreshed version of the rtl changes for wide-int. the only change from the previous versions is that the wide-int binary operations have been simplified to use the new wide-int binary templates.

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Sandiford
Richard Biener richard.guent...@gmail.com writes: Can we in such cases please to a preparatory patch and change the CONST_INT/CONST_DOUBLE paths to do an explicit [sz]ext to mode precision first? I'm not sure what you mean here. CONST_INT HWIs are already sign-extended from mode precision to

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Biener
On Wed, Apr 24, 2013 at 2:44 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: Can we in such cases please to a preparatory patch and change the CONST_INT/CONST_DOUBLE paths to do an explicit [sz]ext to mode precision first? I'm not

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Sandiford
Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 2:44 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: Can we in such cases please to a preparatory patch and change the CONST_INT/CONST_DOUBLE paths to do an

Re: patch to fix constant math -5th patch, rtl

2013-04-24 Thread Richard Biener
On Wed, Apr 24, 2013 at 4:03 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: On Wed, Apr 24, 2013 at 2:44 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Richard Biener richard.guent...@gmail.com writes: Can we in such cases