[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why the 64 bit ISA is better



On Fri, 18 Jan 2013, Stan Hoeppner wrote:
> Given the recent threads regarding 32 vs 64 bit I thought I'd take a
> moment to present information often omitted in responses to these posts.
> 
> First, the i386 kernel/user space have access to only the original 8
> general purpose registers of the 80386 ISA that are 32 bits wide, and
> cannot generally access the more recent multimedia/floating point
> registers used for things like SSE3/4 and AVX.
> 
> The AMD64 ISA has twice as many GPRs and twice as wide, 16 general
> purpose registers each 64 bits wide, and also can access the 128 bit and
> 256 bit wide multimedia/FP registers of the newest CPUs, allowing for
> SSE3/4, AVX, etc.  These give greatly enhanced performance for some
> kernel operations (md RAID5/6 for example) and many applicaitons.
> 
> So beyond the advantage of linear memory addressing far beyond the 4GB
> limit of the i386 kernel/apps, the AMD64 kernel/apps have some serious
> performance advantages.

Expanding on that a bit: the x86-64/amd64/Intel64 ISA allows the compilers
to assume the availability of certain instruction sets which allow for
better code:  SSE and SSE2, everything implied by i686, CMPXCHG8B, and a few
others.

This doesn't matter much on source-package-based distros like Gentoo, where
you should set the default compiler options to whatever will generate the
best code for that particular box, but for binary-package-based distros like
Debian it can be a big deal.

The kernel benefits a _lot_ of the better ISA and smaller registre pressure
of x86-64, to the point that it is almost always better to run 32bit
userspace under a 64bit kernel, than running the entire box in 32bit mode.

Basically, unless you must run 8086 virtual mode or real mode code that
requires the CPU to be in legacy mode (refer to the wikipedia page for
details[1]), you should always use a 64bit kernel in x86 CPUs that can do
"long mode" (aka 64bit mode).  Whether you'll be better off with a 32bit or
64bit userspace depends on what you're going to run on that box.  And you
can run both at the same time, anyway...

[1] http://en.wikipedia.org/wiki/X86-64

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh


Reply to: