[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 14/22] target-mips: add Addressing and PC-rel
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 14/22] target-mips: add Addressing and PC-relative instructions |
Date: |
Tue, 24 Jun 2014 11:00:28 +0100 |
On 24 June 2014 10:50, Leon Alrae <address@hidden> wrote:
> On 20/06/2014 21:50, Aurelien Jarno wrote:
>> I do wonder if we shouldn't use sextract32() instead of open coding that
>> now that it is available:
>>
>> offset = sextract32(ctx->opcode, 0, 19) << 3;
>
> This looks better, thanks for the suggestion (but since the offset's
> size is 18, third argument will be 18, not 19).
This is undefined behaviour in C because of the shift into
the sign bit. Better to shift first and then signextend:
offset = sextract32(ctx->opcode << 3, 0, 21);
thanks
-- PMM
[Qemu-devel] [PATCH v2 18/22] target-mips: do not allow Status.FR=0 mode in 64-bit FPU, Leon Alrae, 2014/06/11
[Qemu-devel] [PATCH v2 17/22] target-mips: add new Floating Point Comparison instructions, Leon Alrae, 2014/06/11
[Qemu-devel] [PATCH v2 16/22] target-mips: add new Floating Point instructions, Leon Alrae, 2014/06/11
[Qemu-devel] [PATCH v2 19/22] target-mips: remove JR, BLTZAL, BGEZAL and add NAL, BAL instructions, Leon Alrae, 2014/06/11