sparc64: fix incorrect BPcc target sign extension
Fix wrong number of bits used when sign extending the branch offset of BPcc instructions. Reported-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
a2589e5cf2
commit
86f1f2aee8
|
@ -1893,7 +1893,7 @@ static void disas_sparc_insn(DisasContext * dc)
|
||||||
int cc;
|
int cc;
|
||||||
|
|
||||||
target = GET_FIELD_SP(insn, 0, 18);
|
target = GET_FIELD_SP(insn, 0, 18);
|
||||||
target = sign_extend(target, 18);
|
target = sign_extend(target, 19);
|
||||||
target <<= 2;
|
target <<= 2;
|
||||||
cc = GET_FIELD_SP(insn, 20, 21);
|
cc = GET_FIELD_SP(insn, 20, 21);
|
||||||
if (cc == 0)
|
if (cc == 0)
|
||||||
|
|
Loading…
Reference in New Issue