Commit 6a0d8a1d233120592abc547dcfd47005dac18396
1 parent
2637a3be
Fix the offset in Thumb bl instruction.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4204 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
3 additions
and
3 deletions
target-arm/translate.c
... | ... | @@ -6912,7 +6912,7 @@ static int disas_thumb2_insn(CPUState *env, DisasContext *s, uint16_t insn_hw1) |
6912 | 6912 | /* Second half of bl. */ |
6913 | 6913 | offset = ((insn & 0x7ff) << 1) | 1; |
6914 | 6914 | tmp = load_reg(s, 14); |
6915 | - tcg_gen_addi_i32(tmp, tmp, 14); | |
6915 | + tcg_gen_addi_i32(tmp, tmp, offset); | |
6916 | 6916 | |
6917 | 6917 | tmp2 = new_tmp(); |
6918 | 6918 | tcg_gen_movi_i32(tmp2, s->pc | 1); |
... | ... | @@ -8308,7 +8308,7 @@ static void disas_thumb_insn(CPUState *env, DisasContext *s) |
8308 | 8308 | tmp = load_reg(s, 13); |
8309 | 8309 | val = (insn & 0x7f) * 4; |
8310 | 8310 | if (insn & (1 << 7)) |
8311 | - val = -(int32_t)val; | |
8311 | + val = -(int32_t)val; | |
8312 | 8312 | tcg_gen_addi_i32(tmp, tmp, val); |
8313 | 8313 | store_reg(s, 13, tmp); |
8314 | 8314 | break; |
... | ... | @@ -8529,7 +8529,7 @@ static void disas_thumb_insn(CPUState *env, DisasContext *s) |
8529 | 8529 | |
8530 | 8530 | case 15: |
8531 | 8531 | if (disas_thumb2_insn(env, s, insn)) |
8532 | - goto undef32; | |
8532 | + goto undef32; | |
8533 | 8533 | break; |
8534 | 8534 | } |
8535 | 8535 | return; | ... | ... |