From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHiiu-0007zQ-H2 for qemu-devel@nongnu.org; Wed, 04 May 2011 16:31:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHiit-0001Ym-Ft for qemu-devel@nongnu.org; Wed, 04 May 2011 16:31:04 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:60322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHiit-0001Yf-7z for qemu-devel@nongnu.org; Wed, 04 May 2011 16:31:03 -0400 Received: by pwi6 with SMTP id 6so834282pwi.4 for ; Wed, 04 May 2011 13:31:01 -0700 (PDT) Sender: Richard Henderson Message-ID: <4DC1B782.9090600@twiddle.net> Date: Wed, 04 May 2011 13:30:58 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1304470768-16924-1-git-send-email-jcmvbkbc@gmail.com> <1304470768-16924-20-git-send-email-jcmvbkbc@gmail.com> <4DC1B204.9040501@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 20/28] target-xtensa: implement windowed registers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Max Filippov , qemu-devel@nongnu.org On 05/04/2011 01:13 PM, Blue Swirl wrote: >> Sparc loses out on some TCG optimizations because of that, although >> to be fair the most effective of these are still in Aurlien's trees. > > Interesting. Which optimizations? What trees? How would you implement > the register windows then? Constant propagation for one. This one in particular would allow the tcg backend to see full constants, rather than seeing the constant being built up from risc instructions. git://git.aurel32.net/qemu.git tcg-optimizations I have previously built on this to streamline the code generated for target load/store operations. We currently always force the address into a register and do the arithmetic on that. If we have the full constant for the address, we can push the parts of that constant into the TLB load etc. git://repo.or.cz/qemu/rth.git tcg-const-addr-1 As for how to implement the register windows... I'm not 100% sure. The easiest way is indeed to copy values to and fro a consolidated register file, as Max is doing here. I've also experimented briefly with extending TCG to handle "indirect" registers. Where the register values are consistent as far as the TCG optimizers are concerned, but when it comes time to expand the code, we perform the indirect read, just as you currently expand by hand ahead of time. I never got either solution totally working for sparc. r~