Re: [Qemu-devel] [PATCH v4] bitops.h: Add functions to extract and deposit bitfields

2012-07-08 Thread Peter Maydell
On 8 July 2012 11:59, Stefan Weil wrote: > Am 08.07.2012 12:01, schrieb Peter Maydell: >> On 8 July 2012 10:55, Lluís Vilanova wrote: >>> Wouldn't it be better to use "unsigned int" instead on all the "start" >>> and "length" arguments? >> >> See the arguments about this on one of the previous pa

Re: [Qemu-devel] [PATCH v4] bitops.h: Add functions to extract and deposit bitfields

2012-07-08 Thread Stefan Weil
Am 08.07.2012 12:01, schrieb Peter Maydell: On 8 July 2012 10:55, Lluís Vilanova wrote: Wouldn't it be better to use "unsigned int" instead on all the "start" and "length" arguments? See the arguments about this on one of the previous patch series: http://lists.gnu.org/archive/html/qemu-devel/

Re: [Qemu-devel] [PATCH v4] bitops.h: Add functions to extract and deposit bitfields

2012-07-08 Thread Peter Maydell
On 8 July 2012 10:55, Lluís Vilanova wrote: > Wouldn't it be better to use "unsigned int" instead on all the "start" and > "length" arguments? See the arguments about this on one of the previous patch series: http://lists.gnu.org/archive/html/qemu-devel/2012-06/msg04304.html -- PMM

Re: [Qemu-devel] [PATCH v4] bitops.h: Add functions to extract and deposit bitfields

2012-07-08 Thread Lluís Vilanova
Peter Maydell writes: [...] > +/** > + * extract32: > + * @value: the value to extract the bit field from > + * @start: the lowest bit in the bit field (numbered from 0) > + * @length: the length of the bit field > + * > + * Extract from the 32 bit input @value the bit field specified by the > + *

Re: [Qemu-devel] [PATCH v4] bitops.h: Add functions to extract and deposit bitfields

2012-07-07 Thread Blue Swirl
On Fri, Jul 6, 2012 at 2:48 PM, Peter Maydell wrote: > Add functions deposit32(), deposit64(), extract32() and extract64() > to extract and deposit bitfields in 32 and 64 bit words. Based on > ideas by Jia Liu and Avi Kivity. > > Suggested-by: Jia Liu > Suggested-by: Avi Kivity > Signed-off-by:

[Qemu-devel] [PATCH v4] bitops.h: Add functions to extract and deposit bitfields

2012-07-06 Thread Peter Maydell
Add functions deposit32(), deposit64(), extract32() and extract64() to extract and deposit bitfields in 32 and 64 bit words. Based on ideas by Jia Liu and Avi Kivity. Suggested-by: Jia Liu Suggested-by: Avi Kivity Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Reviewed-by: Andreas Färber