This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 128-bit long long?
- From: Erik Trulsson <ertr1013 at student dot uu dot se>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: Scott Robert Ladd <coyote at coyotegulch dot com>, gcc at gcc dot gnu dot org
- Date: Sun, 21 Mar 2004 19:08:06 +0100
- Subject: Re: 128-bit long long?
- References: <405DB46B.80208@coyotegulch.com> <m3oeqq1acs.fsf@gromit.moeb>
On Sun, Mar 21, 2004 at 04:35:47PM +0100, Andreas Jaeger wrote:
> Scott Robert Ladd <coyote@coyotegulch.com> writes:
>
> > On a 64-bit AMD64 architecture, GCC defines long long as 64 bits, the
> > same as a long.
> >
> > Given that certain 64-bit instructions (multiply) produce 128-bit
> > results, doesn't it seem logical the long long be defined as 128 bits?
> >
> > I'm just wonder...
>
> That will break too many "portable" software ;-(.
And probably some software that actually is (or rather was) portable.
In C90 it was (implicitly) guaranteed that 'long' was the largest
integer type. This is not guaranteed in C99, but there is almost
certainly code out there that relies on 'long' being the largest
integer type.
Having 'long long' and 'long' being the same size keeps the compiler
compatible with C90.
(I don't know if that is the reason the sizes where chosen as they
were, but it is certainly *a* good reason for doing it.)
Then there are of course loads of buggy software that make invalid
assumptions and break when faced with a 128-bit 'long long', but I
suspect that many of them will break when faced with a 64-bit 'long' as
well, so I don't know if they are much to worry about.
--
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se