From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14740 invoked by alias); 21 Mar 2004 18:08:09 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 14723 invoked from network); 21 Mar 2004 18:08:08 -0000 Received: from unknown (HELO falcon.midgard.homeip.net) (212.181.162.201) by sources.redhat.com with SMTP; 21 Mar 2004 18:08:08 -0000 Received: (qmail 57039 invoked by uid 1001); 21 Mar 2004 18:08:07 -0000 Date: Sun, 21 Mar 2004 20:27:00 -0000 From: Erik Trulsson To: Andreas Jaeger Cc: Scott Robert Ladd , gcc@gcc.gnu.org Subject: Re: 128-bit long long? Message-ID: <20040321180806.GA56974@falcon.midgard.homeip.net> Mail-Followup-To: Andreas Jaeger , Scott Robert Ladd , gcc@gcc.gnu.org References: <405DB46B.80208@coyotegulch.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-SW-Source: 2004-03/txt/msg01259.txt.bz2 On Sun, Mar 21, 2004 at 04:35:47PM +0100, Andreas Jaeger wrote: > Scott Robert Ladd 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. -- Erik Trulsson ertr1013@student.uu.se