qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V3 2/7] nios2: Add architecture emulation suppor


From: Marek Vasut
Subject: Re: [Qemu-devel] [PATCH V3 2/7] nios2: Add architecture emulation support
Date: Thu, 20 Oct 2016 15:39:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0

On 10/20/2016 07:05 AM, Richard Henderson wrote:
> On 10/19/2016 08:01 PM, Marek Vasut wrote:
>>> > You might like 0xfffffffc better, but that does require that you count
>>> > f's appropriately for the type.  That's why I like -4: it's obvious
>>> (or
>>> > should be) that it masks to a multiple of 4, and type promotion
>>> extends
>>> > bits to the left as needed for the type of the other AND argument.
>> But then you can also use ~3 , right ?
> 
> Yes.
> 
>> In which case, you'd avoid doing
>> bitwise operations with negative numbers, which is nice.
> 
> Eh.  Since ~3 == -4, ~3 is a negative number.  So it's a false argument.
> 
> (C triviallities aside, such as the fact that there are no negative
> constants, only positive constants to which unary negation may be applied.)
> 
> The reason I like -4 is that it aligns to 4, spelled the same way.

OK

-- 
Best regards,
Marek Vasut



reply via email to

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