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]

[0/11] GET_MODE_PRECISION vs GET_MODE_BITSIZE


I'm working on a patch to support __int40_t for the C6X target. This
will involve a new integer mode with bitsize 64, and precision 40. A lot
of the existing code doesn't make a distinction between the two values,
since at the moment they are identical for all integer modes (except
BImode).

This patch set tries to address that problem. Roughly speaking, these
are the categories where we should use GET_MODE_SIZE/GET_MODE_BITSIZE:
 * computing subreg words
 * accessing memory
For the following, we should use GET_MODE_PRECISION:
 * shift counts
 * sign bit positions, sign/zero-extending and all other arithmetic
 * testing for paradoxical subregs (or generally, whether we're
   extending or truncating)
 * testing TRULY_NOOP_TRUNCATION
 * testing whether a value can be represented in HOST_WIDE_INT

Undoubtedly there are spots I've missed, but it doesn't all have to be
fixed in one go. Existing targets should be unaffected by any of these
changes, it only becomes important once a new fractional integer mode is
added.

Testing was done with all 11 patches applied, not for each of them
individually. Bootstrapped and regression tested on i686-linux, all
languages except Go. Regression tested on cris-elf. An earlier version,
including support for int40_t, was tested in a 4.5 c6x-elf tree. I've
built at least cc1 for the following compilers, and verified that
generated code is identical on a large set of input files.

i686-linux
i686-linux x cris-elf
i686-linux x ia64-hppa-hpux
x86_64-linux x mips64-linux
x86_64-linux x m68k-elf

All of these tests, except the ia64-linux cross, were with a slightly
earlier version that did not have the BImode special case in patch 11;
the need for that was shown only with ia64 testing.


Bernd


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