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]

Re: RFC: 40 bit integer support


On Fri, 1 Jul 2011, Bernd Schmidt wrote:

> On 07/01/11 21:49, Joseph S. Myers wrote:
> > On Fri, 1 Jul 2011, Bernd Schmidt wrote:
> > 
> >>  * 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".
> > 
> > My advice is neither, initially; leave it to the user to define typedefs 
> > using the mode (possibly providing a header that the user can include with 
> > -include).  __int128_t is legacy and undocumented, with the __int128 
> > keyword (from the x86_64 ABI) being preferred.  I also don't recommend 
> > adding any types to stdint.h (so eliminating a lot more of the 
> > complexity); there is no requirement to have those types there, 
> 
> Well, this was done for compatibility with an existing toolchain (which
> unfortunately also allows "unsigned __int40_t"). I guess I could be
> persuaded that we don't care enough and people must include
> "c6x_intrinsics.h" when using gcc.

Maybe there's a case for an __int40 keyword (and a built-in macro for 
__int40_t), but the point at which a second such keyword is added is the 
point to figure out a generic approach that also covers __int128, 
__float80 and __float128 - and doesn't need a load of code in the 
target-independent compiler for each type.  And I think that should really 
be kept separate from simply making the types work in the same way that 
TImode types worked for years (i.e. using mode attributes to access them, 
but having the required libgcc functions).

This patch does too much.  Once the series to make 40-bit types work is 
in, the next natural step would be adding such a type as target-specific.  
(FWIW, I wonder if all the new libgcc functions are really useful, or if 
the core compiler should just handle calling 64-bit functions and 
truncating as needed for most of the functions.)  When there are multiple 
targets, then share things between only the targets that need them.

> > Don't try to understand anything about stdint.h with reference to C99 
> > versions before TC3; there were several defects fixed in the TCs.
> 
> Is this available anywhere (even if only inside CS?)

C99+TC1+TC2+TC3 is WG14 document N1256, more readily available than the 
original C99.

-- 
Joseph S. Myers
joseph@codesourcery.com


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