qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 66/68] target/arm: Convert T16, long branches


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 66/68] target/arm: Convert T16, long branches
Date: Tue, 3 Sep 2019 09:23:21 +0100

On Wed, 28 Aug 2019 at 01:07, Richard Henderson
<address@hidden> wrote:
>
> On 8/27/19 2:34 AM, Peter Maydell wrote:
> >> +    tcg_gen_andi_i32(tmp, tmp, -4);
> >
> > Minor nit, but can we use 0xfffffffc like the old code did,
> > to avoid the reader having to do 2s-complement arithmetic
> > in their head to figure out that we're clearing the low 2 bits?
>
> I always preferred "x & -c" for exactly the same reason:
> to avoid the reader having to do 2s compliment arithmetic
> in their head to figure out that we're aligning to c.

I guess this is mostly a personal thing -- I don't
have in my head any idea of what doing a logical
operation on a negative number does, so I always
have to convert it back to "what are the actual
bits here" before I understand it.

thanks
-- PMM



reply via email to

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