qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>,
	Aleksandar Rikalo <arikalo@gmail.com>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: Re: [PATCH v3 16/16] target/mips: Convert nanoMIPS LI opcodes to decodetree
Date: Tue, 26 Nov 2024 16:35:42 -0600	[thread overview]
Message-ID: <9a4840cd-0076-43e1-b523-3c073aa3d699@linaro.org> (raw)
In-Reply-To: <20241126140003.74871-17-philmd@linaro.org>

On 11/26/24 08:00, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/mips/tcg/nanomips16.decode        |  8 ++++++++
>   target/mips/tcg/nanomips48.decode        |  8 ++++++++
>   target/mips/tcg/nanomips_translate.c     | 21 +++++++++++++++++++++
>   target/mips/tcg/nanomips_translate.c.inc | 17 -----------------
>   4 files changed, 37 insertions(+), 17 deletions(-)
> 
> diff --git a/target/mips/tcg/nanomips16.decode b/target/mips/tcg/nanomips16.decode
> index 81fdc68e98b..12815161d9c 100644
> --- a/target/mips/tcg/nanomips16.decode
> +++ b/target/mips/tcg/nanomips16.decode
> @@ -6,3 +6,11 @@
>   #
>   # Reference: nanoMIPS32 Instruction Set Technical Reference Manual
>   #            (Document Number: MD01247)
> +
> +&rd_imm             rd imm not_in_nms
> +
> +%s_eu               0:s7 !function=s_eu
> +
> +@rt3_s          ...... rd:3 .......         &rd_imm         imm=%s_eu
> +
> +LI              110100 ... .......          @rt3_s          not_in_nms=0        # LI[16]

I think probably it is a mistake to include not_in_nms in the argument set.
I think it would be better to have separate trans_LI and trans_LI_nnms.


> diff --git a/target/mips/tcg/nanomips48.decode b/target/mips/tcg/nanomips48.decode
> index 696cc15607a..778bff4ec06 100644
> --- a/target/mips/tcg/nanomips48.decode
> +++ b/target/mips/tcg/nanomips48.decode
> @@ -6,3 +6,11 @@
>   #
>   # Reference: nanoMIPS32 Instruction Set Technical Reference Manual
>   #            (Document Number: MD01247)
> +
> +&rd_imm     rd  imm not_in_nms                                       !extern
> +
> +%imm        16:16 0:s16

These subfields are swapped.

That said...  I will note that all 48-bit instructions are 16-bit plus a 32-bit immediate. 
There's a trick we used over in target/rx/ where we (ab)use !function to read immediate 
data. Using this would mean that we can treat all of these 48-bit insns as 16-bit insns.

%i48       !func=i48
@ri48      ...... rt:5  .....  &ri imm=%i48

LI_nnmi    011000 ..... 00000  @ri48


r~


  reply	other threads:[~2024-11-26 22:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-26 13:59 [PATCH v3 00/16] target/mips: Convert nanoMIPS LSA opcode to decodetree Philippe Mathieu-Daudé
2024-11-26 13:59 ` [PATCH v3 01/16] target/mips: Extract gen_base_index_addr() helper Philippe Mathieu-Daudé
2024-11-26 13:59 ` [PATCH v3 02/16] target/mips: Extract generic gen_lx() helper Philippe Mathieu-Daudé
2024-11-26 13:59 ` [PATCH v3 03/16] target/mips: Convert Octeon LX instructions to decodetree Philippe Mathieu-Daudé
2024-11-26 13:59 ` [PATCH v3 04/16] target/mips: Call translator_ld() in translate_insn() callees Philippe Mathieu-Daudé
2024-11-26 16:03   ` Richard Henderson
2024-11-26 13:59 ` [PATCH v3 05/16] target/mips: Have gen_[d]lsa() callers add 1 to shift amount argument Philippe Mathieu-Daudé
2024-11-26 13:59 ` [PATCH v3 06/16] target/mips: Decode LSA shift amount using decodetree function Philippe Mathieu-Daudé
2024-11-26 13:59 ` [PATCH v3 07/16] target/mips: Introduce decode tree bindings for MIPS16e ASE Philippe Mathieu-Daudé
2024-11-26 16:16   ` Richard Henderson
2024-11-26 13:59 ` [PATCH v3 08/16] target/mips: Introduce decode tree bindings for microMIPS ISA Philippe Mathieu-Daudé
2024-11-26 16:26   ` Richard Henderson
2024-11-26 13:59 ` [PATCH v3 09/16] scripts/decodetree: Add support for 48-bit instructions Philippe Mathieu-Daudé
2024-11-26 16:27   ` Richard Henderson
2024-11-26 13:59 ` [PATCH v3 10/16] target/mips: Introduce decode tree bindings for nanoMIPS ISA Philippe Mathieu-Daudé
2024-11-26 16:33   ` Richard Henderson
2024-11-26 13:59 ` [PATCH v3 11/16] target/mips: Convert microMIPS LSA opcode to decodetree Philippe Mathieu-Daudé
2024-11-26 13:59 ` [PATCH v3 12/16] target/mips: Convert nanoMIPS " Philippe Mathieu-Daudé
2024-11-26 13:59 ` [PATCH v3 13/16] target/mips: Add gen_li() helper Philippe Mathieu-Daudé
2024-11-26 16:36   ` Richard Henderson
2024-11-26 14:00 ` [PATCH v3 14/16] target/mips: Convert microMIPS LI opcode to decodetree Philippe Mathieu-Daudé
2024-11-26 21:25   ` Richard Henderson
2024-11-26 14:00 ` [PATCH v3 15/16] target/mips: Convert MIPS16e LI opcodes " Philippe Mathieu-Daudé
2024-11-26 21:55   ` Richard Henderson
2024-11-26 14:00 ` [PATCH v3 16/16] target/mips: Convert nanoMIPS " Philippe Mathieu-Daudé
2024-11-26 22:35   ` Richard Henderson [this message]
2025-07-15  6:02 ` [PATCH v3 00/16] target/mips: Convert nanoMIPS LSA opcode " Philippe Mathieu-Daudé

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=9a4840cd-0076-43e1-b523-3c073aa3d699@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=arikalo@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@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).