Date: Mon, 15 Dec 2003 13:57:56 -0800
From: keith bierman <[log in to unmask]>
Peter Shenkin wrote:
>
>I suspect the only thing a 64-bit compilation will buy
>you on Opteron is extra address space, which is good if
>
As far as I can tell (and I lack hands on experience so this is a bit
second hand) the biggest improvement are the increased number of
registers available. So this is quite different than the experience on
many other 32->64 bit transitions ... there is a reason why otherwise
32-bit codes will often run faster on an Opteron (with a suitably
modified compiler).
There are several inter-related issues that I didn't see covered, so
I'll give this a whack.
Most systems have access to 64 bit data types, be they called
'INTEGER*8' or 'long' or 'long long' for integers, and 'REAL*8' or
'double' or 'long double' for reals.
CPUs have various registers of various sizes. 32-bit CPUs when
dealing with 64-bit data generally have to use two registers, so 64
bit data can increase register pressure. CPUs with 64-bit registers
generally use one register per datum, even if the datum is 32, 16 or 8
bits; i.e., you generally can't over-use a register just because you
aren't taking advantage of its full width. I get the impression from
this discussion that Opteron in "64-bit mode" has more and perhaps
wider registers available. CPUs often have separate integer and
floating registers, so the count and width may depend on the type.
CPUs have memory addressing capabilities. The 80186 had a segment
register (4 bits?) which would get loaded before doing a segmented
memory operation with a 16 bit offset. Thus, 20 bits of addrss space
on a 16 bit machine. 32 bit machines are generally limitted to 32
bits of virtual address space. 64 bit machines generally have 40+
bits of virtual and physical addressing CAPABILITY. However, many
vendors offer a compilation and/or linking mode (in cahoots with the
OS and runtimes) to keep all addresses within 31 or 32 bits. There
are two primary reasons for doing this: (1) a lot of source is not "clean"
typically meaning some apps assume an int and a pointer occupy the
same amount of storage, and (2) memory footprint and cache effects
from memory poitner sizes.
The registers for data types and the memory addressing issues are
generally independent. If compilers,etc for Opteron (or any other
processor) provides more and wider registers in "64 bit mode" and can
continue keeping memory and pointers in 32 bits, that's the best
situation for many apps that don't need large addressing capability.
|