On 23 August 2013 19:09, Richard Henderson wrote:
> 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;
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
In the decode of ARM B and BL insns, swap the order of the
"append 2 implicit zeros to imm24" and the sign extend, and
use the new sextract32() utility function to do the latter.
This avoids a direct dependency on the undefined C behaviour
of shifting into the sign bit of an integer.
Signed-off-by