Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LrK5p-0002Ap-Ps for qemu-devel@nongnu.org; Tue, 07 Apr 2009 18:48:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LrK5o-0002A7-48 for qemu-devel@nongnu.org; Tue, 07 Apr 2009 18:48:33 -0400 Received: from [199.232.76.173] (port=37453 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LrK5o-0002A3-0r for qemu-devel@nongnu.org; Tue, 07 Apr 2009 18:48:32 -0400 Received: from hall.aurel32.net ([88.191.82.174]:53410) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LrK5n-0000lj-Fp for qemu-devel@nongnu.org; Tue, 07 Apr 2009 18:48:31 -0400 Date: Wed, 8 Apr 2009 00:48:26 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH target-arm] Don' use T[x] in helper Message-ID: <20090407224826.GD11877@volta.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-15?Q?Torbj=F6rn?= Andersson Cc: qemu-devel@nongnu.org On Tue, Mar 24, 2009 at 08:59:16PM +0100, Torbjörn Andersson wrote: > Hi all! > > I hit a strange issue with add_cc, can't really explain how it appeared but > it did. The patch below solved my problem. > > Can someone make a qualified guess why? I'm compling with gcc 4. > > However, T0 and T1 in a helper should not be used, because it creates a > unnecessary dependency between translate.c and op_helper.c. Am I correct? > > Further, if we cannot trust T0 and T1 in a helper, what about the global > env-variable? Thanks, I applied your patch. > /Best regards Torbjörn Andersson > > Index: op_helper.c > =================================================================== > --- op_helper.c (revision 6883) > +++ op_helper.c (working copy) > @@ -307,7 +307,7 @@ > uint32_t HELPER (add_cc)(uint32_t a, uint32_t b) > { > uint32_t result; > - result = T0 + T1; > + result = a + b; > env->NF = env->ZF = result; > env->CF = result < a; > env->VF = (a ^ b ^ -1) & (a ^ result); > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net