From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53672 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJoHy-0006H3-AZ for qemu-devel@nongnu.org; Wed, 02 Jun 2010 09:47:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJoHx-00057M-59 for qemu-devel@nongnu.org; Wed, 02 Jun 2010 09:47:22 -0400 Received: from are.twiddle.net ([75.149.56.221]:56773) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJoHw-000573-Vt for qemu-devel@nongnu.org; Wed, 02 Jun 2010 09:47:21 -0400 Message-ID: <4C0660E6.20703@twiddle.net> Date: Wed, 02 Jun 2010 06:47:18 -0700 From: Richard Henderson MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/8] sparc64: fix missing address masking References: <20100601200434.5908.19495.stgit@skyserv> <20100601201227.5908.12931.stgit@skyserv> <4C057114.7000308@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Kovalenko Cc: qemu-devel@nongnu.org On 06/01/2010 09:29 PM, Igor Kovalenko wrote: > On Wed, Jun 2, 2010 at 12:44 AM, Richard Henderson wrote: >> On 06/01/2010 01:12 PM, Igor V. Kovalenko wrote: >>> + if ((env->pstate & PS_AM) && is_translating_asi(asi)) { >>> + addr &= 0xffffffffULL; >>> + } >> >> I suggest that these be written instead as >> >> if (is_translating_asi(asi)) { >> addr = address_mask(addr); >> } >> >> That should allow you to remove some of the ifdefs. > > All address masking is done for sparc64 target only, sparc32 does not > have the notion of translating asi. Of course I know that. > I think it's better to do debug printf macro trick ... ... with no evidence. The compiler is happy to optimize away the entire if statement without having to resort to macros. > ... then but I see no real benefit at the moment. Avoiding ifdefs isn't a benefit? r~