diff mbox series

[v2,2/8] target/sparc: Fix npc comparison in sparc_tr_insn_start

Message ID 20230621180607.1516336-3-richard.henderson@linaro.org
State Superseded
Headers show
Series target/sparc: Use tcg_gen_lookup_and_goto_ptr | expand

Commit Message

Richard Henderson June 21, 2023, 6:06 p.m. UTC
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.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/sparc/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé June 27, 2023, 9:11 a.m. UTC | #1
On 21/6/23 20:06, Richard Henderson wrote:
> 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.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/sparc/translate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff mbox series

Patch

diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index 28d4cdb8b4..eec6f9ca67 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -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 {