This is the mail archive of the
mailing list for the GCC project.
Re: [patch 1/4] change specific int128 -> generic intN
- From: DJ Delorie <dj at redhat dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Jul 2014 12:34:48 -0400
- 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> <3286026 dot Mx0bBiaKZx at polaris> <201407070601 dot s6761iXu005256 at greed dot delorie dot com> <1878297 dot 97iUzkpC0g at polaris>
> which means that the precision of the mode is used to set the size
> of the type, which very likely means that the size of the mode is
> larger. So the size of the mode will be larger than the size of the
> type, which is a lie.
For partial int modes, the precision and size are the same, and
normally not a power of two. The assumption that "PSImode is the same
size as SImode" is no longer valid.
> > The code was biting me when TYPE_SIZE was bigger than PSImode, and
> > the code kept choosing SImode instead.
> IMO you're papering over the real issue, which appears to be the
> choice of the mode. Why does the code choose PSImode instead of
> SImode, if the type and the mode have the same precision (20) and
> size (24)?
PSImode is 20 bits, fits in a 20 bit register, and uses 20 bit operations.
SImode is 32 bits, fits in two 16 bit registers, and uses 32 bit operations.
If a type is 17-20 bits, PSImode is chosen. If it's 21 bits or
larger, SImode is chosen. If it's 16 or fewer bits, HImode is chosen.
If you look at part 2 of the patch, you'll see lots of code that
implements this logic, although the change to specify the sizes of
partial int modes has been in for a while.