This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: 40 bit integer support
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 1 Jul 2011 19:49:34 +0000 (UTC)
- Subject: Re: RFC: 40 bit integer support
- References: <4E0E10C5.3000804@codesourcery.com>
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, and in
any case libc's stdint.h is used in most cases instead of GCC's.
> * 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
Don't try to understand anything about stdint.h with reference to C99
versions before TC3; there were several defects fixed in the TCs. DR#209
was fixed by correcting the definitions of the types produced from certain
macros.
Yes, you need a way of producing something usable in #if to define such a
macro. This is evidence that the type does not belong in stdint.h....
--
Joseph S. Myers
joseph@codesourcery.com