Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
target/sparc: Fix npc comparison in sparc_tr_insn_start
During translation, npc == address, DYNAMIC_PC, or JUMP_PC.
It is only the encoding between here and sparc_restore_state_to_opc
that considers JUMP_PC to be a bit within a larger value.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230628071202.230991-3-richard.henderson@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  • Loading branch information
rth7680 authored and mcayland committed Jun 28, 2023
1 parent f67ccb2 commit 611a168
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/sparc/translate.c
Expand Up @@ -5594,7 +5594,7 @@ static void sparc_tr_insn_start(DisasContextBase *dcbase, CPUState *cs)
{
DisasContext *dc = container_of(dcbase, DisasContext, base);

if (dc->npc & JUMP_PC) {
if (dc->npc == JUMP_PC) {
assert(dc->jump_pc[1] == dc->pc + 4);
tcg_gen_insn_start(dc->pc, dc->jump_pc[0] | JUMP_PC);
} else {
Expand Down

0 comments on commit 611a168

Please sign in to comment.