This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Changes to the wide-int classes


On Sep 1, 2013, at 7:37 PM, Kenneth Zadeck <zadeck@naturalbridge.com> wrote:
> On 09/01/2013 03:21 PM, Richard Sandiford wrote:
>> 
>> * As Richard requested, the main wide int class is parameterised by the
>>   storage:
>> 
>>     template <typename storage>
>>     class GTY(()) generic_wide_int : public storage

Careful of GTY, it gets finicky around the corners.  I suspect you already tested this and it works...

>>   Hmm, if we decide to forbid the use of "and" in gcc,

Why would we do that?

>> * A static assert also prevents fixed_wide_ints from being initialised
>>   from wide_ints.  I think combinations like that would always be a
>>   mistake.

I don't see why.  In C, this:

  int i;
  long l = i;

is not an error, and while a user might not want to do this, other times, it is completely reasonable.

>> I've deliberately not tackled any of the other things that have been
>> talked about, such as whether excess bits should be defined, whether
>> the blocks should be HWIs, etc.  I've also kept things like
>> "wi::one (prec)", although this is now exactly equivalent to
>> "wi::shwi (1, prec)".  I'm not sure either way on whether the
>> one() form is worth keeping.

wi::one(prec) is 3 words, wi::shwi (1, prec) is 4.  Not a big point.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]