]> xenbits.xensource.com Git - people/aperard/qemu-dm.git/commitdiff
target/sparc: Use tcg_gen_lookup_and_goto_ptr for v9 WRASI
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 28 Jun 2023 07:12:02 +0000 (09:12 +0200)
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Wed, 28 Jun 2023 09:53:57 +0000 (10:53 +0100)
We incorporate %asi into tb->flags so that we may generate
inline code for the many ASIs for which it is easy to do so.
Setting %asi is common for e.g. memcpy and memset performing
block copy and clear, so it is worth noticing this case.

We must end the TB but do not need to return to the main loop.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230628071202.230991-9-richard.henderson@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
target/sparc/translate.c

index 9148e332833f2bb9938c84d23f11165f6988edb2..bd877a5e4ab119b45d2df06b53fc7c9fd2f70f1b 100644 (file)
@@ -4147,10 +4147,14 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
                                 tcg_gen_andi_tl(cpu_tmp0, cpu_tmp0, 0xff);
                                 tcg_gen_st32_tl(cpu_tmp0, cpu_env,
                                                 offsetof(CPUSPARCState, asi));
-                                /* End TB to notice changed ASI.  */
+                                /*
+                                 * End TB to notice changed ASI.
+                                 * TODO: Could notice src1 = %g0 and IS_IMM,
+                                 * update DisasContext and not exit the TB.
+                                 */
                                 save_state(dc);
                                 gen_op_next_insn();
-                                tcg_gen_exit_tb(NULL, 0);
+                                tcg_gen_lookup_and_goto_ptr();
                                 dc->base.is_jmp = DISAS_NORETURN;
                                 break;
                             case 0x6: /* V9 wrfprs */