From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54600 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLiGo-0008VC-Rt for qemu-devel@nongnu.org; Mon, 07 Jun 2010 15:46:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLiGl-0003ZF-JL for qemu-devel@nongnu.org; Mon, 07 Jun 2010 15:46:02 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:51235) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLiGl-0003Z6-G3 for qemu-devel@nongnu.org; Mon, 07 Jun 2010 15:45:59 -0400 Received: by gyd5 with SMTP id 5so2696662gyd.4 for ; Mon, 07 Jun 2010 12:45:58 -0700 (PDT) Sender: Richard Henderson Message-ID: <4C0D4C5E.8030708@twiddle.net> Date: Mon, 07 Jun 2010 12:45:34 -0700 From: Richard Henderson MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/2] tcg-i386: Use segment registers to implement GUEST_BASE. References: <1275611718-32630-1-git-send-email-rth@twiddle.net> <1275611718-32630-3-git-send-email-rth@twiddle.net> <7222640D-96FF-41DA-A41D-6D2CB6D669DB@suse.de> In-Reply-To: <7222640D-96FF-41DA-A41D-6D2CB6D669DB@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org, aurelien@aurel32.net On 06/03/2010 11:35 PM, Alexander Graf wrote: > > On 04.06.2010, at 02:35, Richard Henderson wrote: > >> For 32-bit, using a segment override is smaller than the 4-byte >> immediate offset. For 64-bit, segments can hold the entire 64-bit >> offset whereas the 4-byte immediate cannot. > > Very nice idea indeed :). Have you found it to be faster? IIRC > segment accesses are slower when seg_offs != 0. But then again the > code is smaller, so it might weigh it up. I've not yet tried to do any proper benchmarking. I had thought that the segment access was slower only when limit != 4G, i.e. when the segment boundaries need to be checked. And that 64-bit segments don't have boundaries, so the slowdown does not apply there either. I'll put it on my queue for the weekend. r~