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: Merge C++ conversion into trunk (5/6 - double_int rewrite)


On Tue, Aug 14, 2012 at 10:04 AM, Richard Guenther <rguenther@suse.de> wrote:
> On Mon, 13 Aug 2012, Lawrence Crowl wrote:
>
>> On 8/13/12, Richard Guenther <richard.guenther@gmail.com> wrote:
>> > Increment/decrement operations did not exist, please do not add
>> > them at this point.
>>
>> Note that I have also added +=, -= and *= operations.  Having them
>> has three advantages.  First, it matches expectations on what
>> numeric types allow.  Second, it results in more concise code.
>> Third, it results in potentially faster code.  I think we should
>> be able to use those operators.
>>
>> When I run through changing call sites, I really want to change
>> the sites to the final form, not do two passes.
>
> Ok.

Btw, I noticed we now have

  /* Conversion functions.  */

  HOST_WIDE_INT to_signed () const;
  unsigned HOST_WIDE_INT to_unsigned () const;

  /* Conversion query functions.  */

  bool fits_unsigned () const;
  bool fits_signed () const;
  bool fits (bool uns) const;

the function names make no sense - they should be talking about
host-wide-ints, because that is what they are about.  Thus,

  /* Conversion functions.  */

  HOST_WIDE_INT to_signed_hwi () const;
  unsigned HOST_WIDE_INT to_unsigned_hwi () const;

  /* Conversion query functions.  */

  bool fits_unsigned_hwi () const;
  bool fits_signed_hwi () const;
  bool fits_hwi (bool uns) const;

Likewise for

  static double_int from_unsigned (unsigned HOST_WIDE_INT cst);
  static double_int from_signed (HOST_WIDE_INT cst);

I'm going to install a patch, after testing, that adjusts the names accordingly.

Richard.

> Thanks,
> Richard.


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