summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorRichard Henderson2021-11-03 05:03:45 +0100
committerPeter Maydell2021-12-15 11:35:26 +0100
commit0bb72bca7cb1cd282d2a55549db06a54d0319d7f (patch)
treef3755bd27113ba8bc51c4fd423728f7e80246811 /target
parenttarget/arm: Hoist pc_next to a local variable in arm_tr_translate_insn (diff)
downloadqemu-0bb72bca7cb1cd282d2a55549db06a54d0319d7f.tar.gz
qemu-0bb72bca7cb1cd282d2a55549db06a54d0319d7f.tar.xz
qemu-0bb72bca7cb1cd282d2a55549db06a54d0319d7f.zip
target/arm: Hoist pc_next to a local variable in thumb_tr_translate_insn
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/arm/translate.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/target/arm/translate.c b/target/arm/translate.c
index c721b2ce42..1c2a7274df 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -9618,25 +9618,25 @@ static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
{
DisasContext *dc = container_of(dcbase, DisasContext, base);
CPUARMState *env = cpu->env_ptr;
+ uint32_t pc = dc->base.pc_next;
uint32_t insn;
bool is_16bit;
if (arm_pre_translate_insn(dc)) {
- dc->base.pc_next += 2;
+ dc->base.pc_next = pc + 2;
return;
}
- dc->pc_curr = dc->base.pc_next;
- insn = arm_lduw_code(env, &dc->base, dc->base.pc_next, dc->sctlr_b);
+ dc->pc_curr = pc;
+ insn = arm_lduw_code(env, &dc->base, pc, dc->sctlr_b);
is_16bit = thumb_insn_is_16bit(dc, dc->base.pc_next, insn);
- dc->base.pc_next += 2;
+ pc += 2;
if (!is_16bit) {
- uint32_t insn2 = arm_lduw_code(env, &dc->base, dc->base.pc_next,
- dc->sctlr_b);
-
+ uint32_t insn2 = arm_lduw_code(env, &dc->base, pc, dc->sctlr_b);
insn = insn << 16 | insn2;
- dc->base.pc_next += 2;
+ pc += 2;
}
+ dc->base.pc_next = pc;
dc->insn = insn;
if (dc->pstate_il) {