From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4GjS-0003Ml-O0 for qemu-devel@nongnu.org; Tue, 20 Apr 2010 12:55:30 -0400 Received: from [140.186.70.92] (port=58681 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4GjR-0003Ma-6y for qemu-devel@nongnu.org; Tue, 20 Apr 2010 12:55:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4GjP-00043x-2P for qemu-devel@nongnu.org; Tue, 20 Apr 2010 12:55:28 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:42832) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4GjO-00043m-To for qemu-devel@nongnu.org; Tue, 20 Apr 2010 12:55:27 -0400 Received: by wyb35 with SMTP id 35so2649418wyb.4 for ; Tue, 20 Apr 2010 09:55:26 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Artyom Tarasenko Date: Tue, 20 Apr 2010 18:55:00 +0200 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Subject: [Qemu-devel] Re: sparc: potentially incorrect if dynamic npc? List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel 2010/4/20 Blue Swirl : > On 4/20/10, Artyom Tarasenko wrote: >> /* XXX: potentially incorrect if dynamic npc */ >> static void do_branch >> >> There are few comments like this in target-sparc/translate.c . >> In what case is it incorrect? >> >> Can do_branch functions be called with dynamic npc? > > Maybe, if there are two branches or jumps in a row. The last time I > checked, at least for successive branches we do the correct thing. > It's pretty obscure, no compiler will generate such sequences and > nobody with asm skills either. Why not? That's how you can implement a very compact 'case' operator in asm. It is used in OBP. But you are right, this seems to work (at least with ss-5 and ss-20 OBP). > Another corner case that IIRC we don't handle is where a jump > instruction is at the end of the page and its delay slot instruction > is at next page. Do you mean that npc is dynamic in this case, or that if npc is dynamic and the instruction is at the end of the page we have a problem? > I think one commit for Microblaze added support for > this case. -- Regards, Artyom Tarasenko solaris/sparc under qemu blog: http://tyom.blogspot.com/