From owner-freebsd-amd64@FreeBSD.ORG Thu May 19 17:01:47 2005 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B07E16A4CE for ; Thu, 19 May 2005 17:01:47 +0000 (GMT) Received: from coe.ufrj.br (roma.coe.ufrj.br [146.164.53.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 327DB43DAE for ; Thu, 19 May 2005 17:01:46 +0000 (GMT) (envelope-from jonny@jonny.eng.br) Received: from localhost (localhost [127.0.0.1]) by coe.ufrj.br (Postfix) with ESMTP id 14DE217716 for ; Thu, 19 May 2005 14:01:44 -0300 (BRT) Received: from coe.ufrj.br ([146.164.53.65]) by localhost (roma.coe.ufrj.br [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 32790-01 for ; Thu, 19 May 2005 14:01:35 -0300 (BRT) Received: from [10.0.8.17] (nat.int.gov.br [200.20.196.226]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by coe.ufrj.br (Postfix) with ESMTP id 3469B17715 for ; Thu, 19 May 2005 14:01:35 -0300 (BRT) Message-ID: <428CC670.50002@jonny.eng.br> Date: Thu, 19 May 2005 14:01:36 -0300 From: =?ISO-8859-1?Q?Jo=E3o_Carlos_Mendes_Lu=EDs?= User-Agent: Mozilla Thunderbird 1.0+ (Windows/20050315) MIME-Version: 1.0 To: freebsd-amd64@freebsd.org References: <42842F46.9040608@samsco.org> <4284FD37.2070009@jonny.eng.br> <20050519054630.GC68698@dragon.NUXI.org> In-Reply-To: <20050519054630.GC68698@dragon.NUXI.org> X-Enigmail-Version: 0.90.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at coe.ufrj.br Subject: Re: Actual benefits of amd64 over i386 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2005 17:01:47 -0000 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 that time. >> 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, Jonny