qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/8] sparc64: fix missing address masking


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 2/8] sparc64: fix missing address masking
Date: Wed, 02 Jun 2010 06:47:18 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Thunderbird/3.0.4

On 06/01/2010 09:29 PM, Igor Kovalenko wrote:
> On Wed, Jun 2, 2010 at 12:44 AM, Richard Henderson <address@hidden> 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~





reply via email to

[Prev in Thread] Current Thread [Next in Thread]