Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HU5n8-0008L9-T4 for qemu-devel@nongnu.org; Wed, 21 Mar 2007 14:44:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HU5n7-0008Kt-AH for qemu-devel@nongnu.org; Wed, 21 Mar 2007 14:44:10 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HU5n7-0008Kq-4F for qemu-devel@nongnu.org; Wed, 21 Mar 2007 13:44:09 -0500 Received: from bay0-omc3-s17.bay0.hotmail.com ([65.54.246.217]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HU5lO-0004kB-Si for qemu-devel@nongnu.org; Wed, 21 Mar 2007 14:42:23 -0400 Message-ID: In-Reply-To: <20070321124924.GB1091@farad.aurel32.net> From: "Blue Swirl" Subject: RE: [Qemu-devel] [SPARC] Branch condition problems Date: Wed, 21 Mar 2007 19:42:20 +0100 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aurelien@aurel32.net Cc: qemu-devel@nongnu.org >I have noticed that the branches have some problem on the sparc target >in very rare conditions. This happens when a store double instruction >(std) is used in the delay slot, as in the following test: > > tst %g0 > bne 9b5d8 > std %o2, [ %o1 ] > >Inserting a nop between bne and std "fixes" the problem. > >tst %g0 sets the zero flag, so that the branch should never be taked. It >happens however that it is sometimes taken. This seems to be due to the >fact that T2 holds the result of the condition, and std replace T2 with >another value. flush_T2() is called before altering T2, but it does not >seems to work. > >I am currently stuck at that point, I hope somebody who has better >understanding of the branch code on Sparc could fix that. Nice analysis, thanks. Flush_T2 is probably a misnomer. One solution could be adding a new field to CPU structure for std's (and stda's) use, so that T2 does not need to be used. _________________________________________________________________ Interest Rates near 39yr lows! $430,000 Mortgage for $1,399/mo - Calculate new payment http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9632-18466&moid=7581