On 07/07/2014 11:13 AM, Bastian Koppelmann wrote:
> +/* This creates a mask with bits start .. end set to 1 and applies it to op 
> */
> +#define MASK_BITS(op, start, end) (op & (((1 << (end-start+1)) - 1) << 
> start))

This is extract32(op, (start), (end) - (start)) << (start)

Do you ever use the unshifted bits, and if so, why?

> +#define MASK_BITS_SHIFT(op, start, end) (MASK_BITS(op, start, end) >> start)

This is extract32(op, (start), (end) - (start))

I note that quite a few times within the later patch you actually sign-extend
this result, duplicating the field width all over the place.  It might be
better to just use sextract32 as required in the first place to treat the
fields that ought to be sign-extended as sign-extended.


r~

Reply via email to