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]

RFC: 40 bit integer support


Here's my current patch for 40 bit integer support. This requires the
11-patch GET_MODE_PRECISION series I just posted.

C6X supports 40-bit integers in hardware; well enough that the old COFF
ABI apparently defined "long" as a 40-bit type. Add and subtract have
widening variants that can be used to synthesize 40-bit operations.
Shifts and comparisons with small constants are supported directly.

Other DSP-type CPUs are also likely to have a use for such operations.
Blackfin has multiply-accumulate instructions with 40 bit accumulators.
ARM Xscale supports this as well.

I'm not really asking for approval for the patch just yet as it's
untested in a 4.7 tree (4.5 c6x-elf testing shows that it basically
works), and I'd like to have some more testcases first. However, it's
IMO close to where it should be, and it would be good to know now if
this will eventually be acceptable or not.

Points that may be interesting.
 * Should we add an __int40_t keyword, or just do a pushdecl for it?
   The patch currently does the latter to match __int128_t, but
   decimal float and fixed-point support uses keywords. This may make
   a difference for (existing) code using "unsigned __int40_t".
 * What should be the name of the new mode? I'm using PImode, hoping
   to evoke the number five, but XImode by analogy with 80-bit floats
   might also work.
 * The __INT40_C macros use a cast, since using a new suffix is likely
   to conflict with something defined by a future standard. This means
   they are not usable in CPP tests. The TI compiler defines them in
   the same way, however, and mentions DR209.  The link they give is
   defunct:
     http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/dr_209.htm


Bernd

Attachment: pimode.diff
Description: Text document


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