qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Luis Pires <luis.pires@eldorado.org.br>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org
Subject: Re: [PATCH] decodetree: Allow custom var width load functions
Date: Tue, 13 Apr 2021 18:10:11 -0700	[thread overview]
Message-ID: <f6cda241-4e11-cfa0-02fe-3119b5d0b8b9@linaro.org> (raw)
In-Reply-To: <20210413181615.414685-1-luis.pires@eldorado.org.br>

On 4/13/21 11:16 AM, Luis Pires wrote:
> This is useful in situations where you want decodetree
> to handle variable width instructions but you want to
> provide custom code to load the instructions. Suppressing
> the generation of the load function is necessary to avoid
> compilation errors due to the load function being unused.
> 
> This will be used by the PowerPC decodetree code.
> 
> Signed-off-by: Luis Pires<luis.pires@eldorado.org.br>
> ---
>   scripts/decodetree.py | 18 +++++++++++-------
>   1 file changed, 11 insertions(+), 7 deletions(-)

So, in the previous cases where we have very controlled "variable length", 
we've simply created separate decode files each with fixed length.

E.g. for arm thumb, in thumb_tr_translate_insn:

     insn = arm_lduw_code(env, dc->base.pc_next, dc->sctlr_b);
     is_16bit = thumb_insn_is_16bit(dc, dc->base.pc_next, insn);
...
     if (is_16bit) {
         disas_thumb_insn(dc, insn);
     } else {
         disas_thumb2_insn(dc, insn);
     }

Similarly, riscv's decode_opc.

I would think that Power would work the same, with 32-bit and 64-bit 
instructions.  I'd like you to talk me through what you want to do here.


r~


      parent reply	other threads:[~2021-04-14  1:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 18:16 [PATCH] decodetree: Allow custom var width load functions Luis Pires
2021-04-13 19:42 ` Luis Fernando Fujita Pires
2021-04-14  1:10 ` Richard Henderson [this message]

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=f6cda241-4e11-cfa0-02fe-3119b5d0b8b9@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=luis.pires@eldorado.org.br \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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).