On 08/23/2013 09:12 AM, Peter Maydell wrote:
> -                offset = (((int32_t)insn << 8) >> 8);
> -                val += (offset << 2) + 4;
> +                offset = sextract32(insn << 2, 0, 26);
> +                val += offset + 4;

I read this incorrectly at first, considering the shift of insn, and
I wonder if it's really the best way to write this because of that.

What about just changing the one line to sextract(insn, 0, 24)?

The second line by itself ought not trigger a warning from clang,
because the << 2 never changes the sign bit.  If it still does,
perhaps just multiply by 4 instead...

It's a stupid warning.  When was the last ones-compliment machine built?


r~

Reply via email to