From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: mark.cave-ayland@ilande.co.uk
Subject: Re: [PATCH v2 4/8] target/sparc: Introduce DYNAMIC_PC_LOOKUP
Date: Tue, 27 Jun 2023 11:08:16 +0200 [thread overview]
Message-ID: <4eaf927c-673b-5f44-8f76-b825cc0e135d@linaro.org> (raw)
In-Reply-To: <20230621180607.1516336-5-richard.henderson@linaro.org>
On 21/6/23 20:06, Richard Henderson wrote:
> Create a new artificial "next pc" which also indicates
> that nothing has changed within the cpu state which
> requires returning to the main loop.
>
> Pipe this new value though all pc/npc checks.
> Do not produce this new value yet.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/sparc/translate.c | 155 ++++++++++++++++++++++++++++-----------
> 1 file changed, 111 insertions(+), 44 deletions(-)
> @@ -5608,20 +5649,46 @@ static void sparc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
> static void sparc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
> {
> DisasContext *dc = container_of(dcbase, DisasContext, base);
> + bool may_lookup;
>
> switch (dc->base.is_jmp) {
> case DISAS_NEXT:
> case DISAS_TOO_MANY:
> - if (dc->pc != DYNAMIC_PC &&
> - (dc->npc != DYNAMIC_PC && dc->npc != JUMP_PC)) {
> + if (((dc->pc | dc->npc) & 3) == 0) {
> /* static PC and NPC: we can use direct chaining */
> gen_goto_tb(dc, 0, dc->pc, dc->npc);
> - } else {
> - if (dc->pc != DYNAMIC_PC) {
> - tcg_gen_movi_tl(cpu_pc, dc->pc);
> + break;
> + }
> +
> + if (dc->pc & 3) {
> + switch (dc->pc) {
> + case DYNAMIC_PC_LOOKUP:
> + may_lookup = true;
> + break;
> + case DYNAMIC_PC:
> + may_lookup = false;
> + break;
> + default:
> + g_assert_not_reached();
> }
> - save_npc(dc);
> + } else {
> + tcg_gen_movi_tl(cpu_pc, dc->pc);
> + may_lookup = true;
> + }
> +
> + save_npc(dc);
> + switch (dc->npc) {
switch (dc->npc & 3)?
> + case DYNAMIC_PC_LOOKUP:
> + if (may_lookup) {
> + tcg_gen_lookup_and_goto_ptr();
> + break;
> + }
> + /* fall through */
> + case DYNAMIC_PC:
> tcg_gen_exit_tb(NULL, 0);
> + break;
> + default:
> + g_assert_not_reached();
> }
> break;
>
next prev parent reply other threads:[~2023-06-27 9:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 18:05 [PATCH v2 0/8] target/sparc: Use tcg_gen_lookup_and_goto_ptr Richard Henderson
2023-06-21 18:06 ` [PATCH v2 1/8] target/sparc: Use tcg_gen_lookup_and_goto_ptr in gen_goto_tb Richard Henderson
2023-06-22 9:03 ` Philippe Mathieu-Daudé
2023-06-21 18:06 ` [PATCH v2 2/8] target/sparc: Fix npc comparison in sparc_tr_insn_start Richard Henderson
2023-06-27 9:11 ` Philippe Mathieu-Daudé
2023-06-21 18:06 ` [PATCH v2 3/8] target/sparc: Drop inline markers from translate.c Richard Henderson
2023-06-27 8:58 ` Philippe Mathieu-Daudé
2023-06-28 7:05 ` Richard Henderson
2023-06-21 18:06 ` [PATCH v2 4/8] target/sparc: Introduce DYNAMIC_PC_LOOKUP Richard Henderson
2023-06-27 9:08 ` Philippe Mathieu-Daudé [this message]
2023-06-21 18:06 ` [PATCH v2 5/8] target/sparc: Use DYNAMIC_PC_LOOKUP for conditional branches Richard Henderson
2023-06-27 9:09 ` Philippe Mathieu-Daudé
2023-06-21 18:06 ` [PATCH v2 6/8] target/sparc: Use DYNAMIC_PC_LOOKUP for JMPL Richard Henderson
2023-06-27 9:12 ` Philippe Mathieu-Daudé
2023-06-21 18:06 ` [PATCH v2 7/8] target/sparc: Use DYNAMIC_PC_LOOKUP for v9 RETURN Richard Henderson
2023-06-27 9:10 ` Philippe Mathieu-Daudé
2023-06-21 18:06 ` [PATCH v2 8/8] target/sparc: Use tcg_gen_lookup_and_goto_ptr for v9 WRASI Richard Henderson
2023-06-22 9:04 ` Philippe Mathieu-Daudé
2023-06-22 12:26 ` [PATCH v2 0/8] target/sparc: Use tcg_gen_lookup_and_goto_ptr Mark Cave-Ayland
2023-06-27 6:46 ` Mark Cave-Ayland
2023-06-27 9:37 ` Philippe Mathieu-Daudé
2023-06-27 10:12 ` Richard Henderson
2023-06-27 11:19 ` Mark Cave-Ayland
2023-06-27 11:57 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4eaf927c-673b-5f44-8f76-b825cc0e135d@linaro.org \
--to=philmd@linaro.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).