This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [wide-int] small cleanup in wide-int.*
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Kenneth Zadeck <zadeck at naturalbridge dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Mike Stump <mikestump at comcast dot net>
- Date: Sat, 07 Dec 2013 10:40:08 +0000
- Subject: Re: [wide-int] small cleanup in wide-int.*
- Authentication-results: sourceware.org; auth=none
- References: <52977927 dot 5010008 at naturalbridge dot com> <CAFiYyc0+GZC6yGQjoOo66srn9-SaiDCJFf0TsVMLdFP_==qTow at mail dot gmail dot com> <529E04A3 dot 9060806 at naturalbridge dot com> <87txepanch dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <52A1FF29 dot 3050909 at naturalbridge dot com> <8761r1sud1 dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <52A24F58 dot 1070802 at naturalbridge dot com>
Kenneth Zadeck <zadeck@naturalbridge.com> writes:
>>>>> #define WIDE_INT_MAX_ELTS \
>>>>> - ((4 * MAX_BITSIZE_MODE_ANY_INT + HOST_BITS_PER_WIDE_INT - 1) \
>>>>> - / HOST_BITS_PER_WIDE_INT)
>>>>> + (((MAX_BITSIZE_MODE_ANY_INT + HOST_BITS_PER_WIDE_INT - 1) \
>>>>> + / HOST_BITS_PER_WIDE_INT) + 1)
>>>> I think this should be:
>>>>
>>>> (MAX_BITSIZE_MODE_ANY_INT / HOST_BITS_PER_WIDE_INT + 1)
>>>>
>>>> We only need an extra HWI if MAX_BITSIZE_MODE_ANY_INT is an exact multiple
>>>> of HOST_BITS_PER_WIDE_INT.
>>> we will do this later when some other issues that Eric B raised are settled.
>> I think you're talking about defining MAX_BITSIZE_MODE_ANY_INT as
>> MAX_SIZE_MODE_ANY_INT * BITS_PER_UNIT, but that's orthogonal to the
>> change above. IMO it doesn't make sense to both round up the division
>> and also add 1 to the result. So I think we should make this change
>> regardless of whatever follows.
>>
>> Looks good to me otherwise, thanks.
>>
>> Richard
>>
> so this one works the way you want. While it is true the the problems
> are disjoint, the solution will likely evolving change the same lines of
> source in two different ways.
Well, if we're changing the definition of WIDE_INT_MAX_ELTS now (and we are)
I think we should change it to something that makes sense. All we want is
1 extra bit. We don't need to round up the size and then add a whole
HWI on top. Doing that will potentially pessimise targets that don't
need anything beyond SImode.
It's not like I can approve the patch anyway though, so I'll leave it there.
Thanks,
Richard