This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 128-bit long long?
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Scott Robert Ladd <coyote at coyotegulch dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 29 Mar 2004 16:38:28 -0800
- Subject: Re: 128-bit long long?
- References: <405DB46B.80208@coyotegulch.com>
Scott Robert Ladd wrote:
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?
Part of the reason here is historical accident. Early 64-bit targets
had to be supported via cross compilation from 32-bit hosts. Gcc
internally represents tree and rtl values as 2 HOST_WIDE_INT values.
This was before most compilers had long long support, so HOST_WIDE_INT
had to be long. Thus a 32-bit host could support at most a 64-bit
integer type. So all early 64-bit ports had to limit long long to
64-bits. This restriction was removed relatively recently, between 3.3
and 3.4. So it wasn't until 3.4 that we can have a 128-bit long long
type and still support cross compilation from a 32-bit host. However,
by now, 64-bit long long assumptions have been written into so much
software that changing it would be too painful.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com