qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 26/60] AArch64: Add ADR instruction emulation


From: Michael Matz
Subject: Re: [Qemu-devel] [PATCH 26/60] AArch64: Add ADR instruction emulation
Date: Wed, 20 Nov 2013 15:40:53 +0100 (CET)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)

Hi,

On Tue, 19 Nov 2013, Claudio Fontana wrote:

> > +    uint64_t imm;
> > +    uint64_t base;
> > +
> > +    imm = get_sbits(insn, 5, 19) << 2;
> > +    imm |= get_bits(insn, 29, 2);
> 
> does this work with negative values?

Yes.  get_sbits returns a sign extended (32bit) int, the shift doesn't 
change that, the conversion to uint64_t first sign extends to 64bit and 
then converts to unsigned (conceptually).  From then on it's an unsigned 
value (with high bits set when input was negative), but two complement 
arithmetic makes that irrelevant.


Ciao,
Michael.



reply via email to

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