This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch 1/4] change specific int128 -> generic intN
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 02 Jul 2014 10:15:59 +0200
- Subject: Re: [patch 1/4] change specific int128 -> generic intN
- Authentication-results: sourceware.org; auth=none
- References: <201404142303 dot s3EN3ONP009938 at greed dot delorie dot com> <2471914 dot BhTlkUd4df at polaris> <201406272104 dot s5RL4nKa029229 at greed dot delorie dot com>
> The whole point of using _PRECISION is to have the size be exactly the
> same as the mode (bitsize is bigger than the mode for partial-int
> modes). TYPE_SIZE_UNIT should be its storage size, right? If the
> type is not a multiple of BITS_PER_UNIT, the actual size and
> stored-in-memory size are going to be different.
But you cannot use the PRECISION of a mode to set a size, since the SIZE of
the mode can be used by the machine to access the object in that mode, so
you'll end up with types whose TYPE_SIZE is smaller than the access size.
You need to use TYPE_PRECISION here.
> The problem in the old code is that BITSIZE is not the size in bits of
> the type, it's the size in bytes times BITS_PER_UNIT. This meant that
> all partial-int modes would be converted into their non-partial modes
> eventually. Most of my patch is about avoiding that.
Yes, BITSIZE is the size rounded up to BITS_PER_UNIT, but why is that a
problem exactly? Do you have modes whose size is not multiple of the unit?
> I'm not reducing it, I'm removing a case where it's rounded up.
> Rounding up a 20-bit PSImode gives you SImode eventually.
Yes, you are reducing it, the precision of bitsize must be at least that of
sizetype + BITS_PER_UNIT_LOG + 1.
--
Eric Botcazou