Actual benefits of amd64 over i386
João Carlos Mendes Luís
jonny at jonny.eng.br
Thu May 19 10:01:47 PDT 2005
David O'Brien wrote:
> On Fri, May 13, 2005 at 04:17:11PM -0300, Joo Carlos Mendes Lus wrote:
>> What about a 64 bit kernel, and mixed mode (32bit and 64bit)
>>userland? Solaris does this, and it sounds efficient, from the comments
>>I've seen in this list.
> When Sparc went from 32-bits to 64-bits the calling ABI was not changed.
> Nor were the number of registers increased. So it is w/o a doubt that a
> 32-bit Sparc binary runs faster than a 64-bit one (abit 64-bit math and
> large memory). This is not true of AMD64 - the number of registers was
> doubled and the calling ABI changed and optimized.
Would these benefits outcome the losses caused by bigger binaries?
Isn't it possible to use 64 bit registers in a 32 bit segment? Just
like i386 segments, where one could define the default register size...
IIRC, in i386 arch the same instruction opcodes could be used for 16
or 32 bit operations, depending on a bit on the segment descriptor. But
this behaviour could be changed with a prefix opcode.
In a college homework, years ago, I used this facility to execute
Borland Turbo C executables in a protected mode i386 environment I've
created, just by putting them in a 16 bit segment. The 32 bit segments
could only run assembly code, since I did not use any 32 bit compiler at
>> The bad part: Most (probably all) libraries would duplicated, and
>>the kernel and compiler should be modified to understand this "feature".
> We already duplicate all the shared libraries.
>> If amd64 32bit executables were compatible with (maybe the same)
>>i386 executables, even better. Note that I am not talking about i386
>>emulation. I am talking about native 32 bit executables in amd64 arch.
> What is the difference of "i386 emulation" and "native 32 bit executables
> in amd64 arch"??
IMHO, the 32bit binaries prepared to run in amd64 32bit segments are
not the same as 32 binaries prepared to run in i386 mode. These "32bit
amd64 executables" would take advantage of the extra registers and 64
bit extensions when possible. So, they cannot be the same executables
prepared to run on an i386 arch. These later could still be run, but in
compatibility mode, just like today.
Indeed, from the last emails in this thread, I know I shold first do
my homework and study a little bit more of the amd64 architecture. If
somebody could please point me to some easy tutorial, I'd leave the AMD
reference manuals for later.
Thanks in advance,
More information about the freebsd-amd64