From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDS7n-0007BS-HX for qemu-devel@nongnu.org; Fri, 10 Jul 2015 02:49:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDS7k-0006WH-24 for qemu-devel@nongnu.org; Fri, 10 Jul 2015 02:49:31 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:35568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDS7j-0006VI-R6 for qemu-devel@nongnu.org; Fri, 10 Jul 2015 02:49:27 -0400 Received: by wgjx7 with SMTP id x7so240922615wgj.2 for ; Thu, 09 Jul 2015 23:48:42 -0700 (PDT) Sender: Richard Henderson References: <1436426122-12276-1-git-send-email-rth@twiddle.net> <1436426122-12276-6-git-send-email-rth@twiddle.net> <559E778E.6090903@redhat.com> From: Richard Henderson Message-ID: <559F6ABF.3090101@twiddle.net> Date: Fri, 10 Jul 2015 07:48:31 +0100 MIME-Version: 1.0 In-Reply-To: <559E778E.6090903@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/10] target-i386: Access segs via TCG registers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org On 07/09/2015 02:30 PM, Paolo Bonzini wrote: > > > On 09/07/2015 09:15, Richard Henderson wrote: >> Having segs[].base as a register significantly improves code >> generation for real and protected modes, particularly for TBs >> that have multiple memory references where the segment base >> can be held in a hard register through the TB. > > On top of this, "is base 0" could be cached in HFLAGS, and CS.BASE does > not need to be in a register at all. Or, to avoid wasting too many > HFLAGS, "is DS/ES/SS base equal to CS base" since the CS base is known > and usually all four of them (unlike FS and GS) are zero. We do have CS/DS/ES/SS base not-equal to zero in hflags -- this is HF_ADDSEG_SHIFT. You're right about CS.BASE being known via the TB though, I hadn't thought about that. I'm not sure that CS=DS/ES/SS really helps much 16-bit code though; afaik except for the smallest COMs they're always different. r~