On 28/6/23 09:11, Richard Henderson wrote:
> Changes from v2:
> * Patch 4 relaxes the checking on NPC:
> (1) save_npc has just asserted that if the low 2 bits are non-zero,
> then we have exactly one of our 3 special cases.
> (2) The difference between DYNAMIC_PC_LOOKUP and DYNAMIC_PC within
> NPC are not relevant to chaining, only those two values within PC.
> Therefore simplify the test in sparc_tr_tb_stop.
$ git diff v2..v3
-- >8 --
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index fcc1054943..bd877a5e4a 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -5683,14 +5683,6 @@ static void sparc_tr_tb_stop(DisasContextBase
*dcbase, CPUState *cs)
save_npc(dc);
- switch (dc->npc) {
- case DYNAMIC_PC_LOOKUP:
- if (may_lookup) {
- tcg_gen_lookup_and_goto_ptr();
- break;
- }
- /* fall through */
- case DYNAMIC_PC:
+ if (may_lookup) {
+ tcg_gen_lookup_and_goto_ptr();
+ } else {
tcg_gen_exit_tb(NULL, 0);
- break;
- default:
- g_assert_not_reached();
}
---
OK, this makes sense.