[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 03/15] Openrisc: add instructions translation
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 03/15] Openrisc: add instructions translation |
Date: |
Sat, 19 May 2012 11:57:11 +0100 |
On 19 May 2012 11:02, Blue Swirl <address@hidden> wrote:
>> +static inline uint32_t field(uint32_t val, int start, int length)
>> +{
>> + val >>= start;
>> + val &= ~(~0 << length);
>> + return val;
>> +}
>
> Nice function, maybe I could use it in Sparc as well if generalized (later).
We should totally have something like this in our generic bitops
header file. I've previously worked on a codebase that used something
similar consistently, and it's much easier to read than code which
does inline mask-and-shift code.
We probably want a 64 bit variant (or maybe we can just work
on uint64_t and trust the compiler to throw away the top halves
in the 32 bit case?)
-- PMM
- Re: [Qemu-devel] [PATCH 02/15] Openrisc: add MMU support, (continued)
[Qemu-devel] [PATCH 03/15] Openrisc: add instructions translation, Jia Liu, 2012/05/17
Re: [Qemu-devel] [PATCH 03/15] Openrisc: add instructions translation, Blue Swirl, 2012/05/19
Re: [Qemu-devel] [PATCH 03/15] Openrisc: add instructions translation, Jia Liu, 2012/05/23
Re: [Qemu-devel] [PATCH 03/15] Openrisc: add instructions translation, Blue Swirl, 2012/05/23
Re: [Qemu-devel] [PATCH 03/15] Openrisc: add instructions translation, Jia Liu, 2012/05/25
Re: [Qemu-devel] [PATCH 03/15] Openrisc: add instructions translation, Jia Liu, 2012/05/25
[Qemu-devel] [PATCH 04/15] Openrisc: add interrupt support, Jia Liu, 2012/05/17
[Qemu-devel] [PATCH 05/15] Openrisc: add exception support, Jia Liu, 2012/05/17